We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have been trying to use the SD Card on the MCB2300 with either the 2387 or 2388. In both cases, the example code for USB\Device\Memory_FlashFS\SD_FILE\Memory.uvproj and RL\FlashFS\SD_File projects, the SD card may or may not initialize correctly upon startup. Usually you get the message that it's not formatted, but that's just because the finit fails. However, this only happens every other time. If it works at startup, it will fail on reset, and then work again after a second reset. If it fails at startup, the next reset will make it work, etc. I traced it back to finit, but then I can't debug past that because I don't have source code (yet). I tried contacting Keil directly, but after numerous requests all I got was:
We've had some issues with the SD Card library letely. Please download and install v4.22, which may address some of them.
Let me know if you still have problems with the new version.
The new version worked the same way, which I reported, and I've heard nothing since. Has anyone else seen this behavior, and is there a workaround?
From what I can tell, yes. I thought about initialization timing after reset as well, but that does not seem to be it, I've changed a bunch of timing in the code with no effect. The only other thing I can think of that's different is that the SanDisk card I'm using is full size, and the one that fails is actually a Mini-SD in an adapter. What's so strange is that it fails exactly every other reset. If it were just some timing on the edge, you'd expect to fail more or less randomly.
It also occurs to me that we may be looking under the wrong rock. It's not MCI initialization per se that's failing, but the file system finit. I started with the assumption that finit was failing because of an MCI system problem, but that's only an assumption.
What's so strange is that it fails exactly every other reset. something like this
if (a) { ...... ...... ...... a=0; } else { fail }
a good look at variables before and after ONE reset could be very revealing.
Erik