Problem with SD card init after unexpected CPU reset
Posted: Sat Nov 14, 2009 7:17 am
Hello,
I have a problem with SD card after CPU reseting. I'm using an example "nburn\examples\EFFS\EFFS-BASIC" for to find out how to work with SD card.
The program works great if I wait until program starts and only then I insert SD card and press <enter> button. You can see a log below:
********************************************************************
===== Starting EFFS BASIC MMC/SD Program =====
No MMC/SD card detected. Insert a card and then press <Enter>
FAT mount to SD/MMC successful
SD/MMC drive change successful
Retrieving external flash usage...
Flash card memory usage (bytes):
32014336 total, 32012288 free, 2048 used, 0 bad
Found File [TESTFILE.TXT] : 75 Bytes
Creating test file: TestFile.txt
Wrote 15 bytes: Hello World 0
Wrote 15 bytes: Hello World 1
Wrote 15 bytes: Hello World 2
Wrote 15 bytes: Hello World 3
Wrote 15 bytes: Hello World 4
Rewinding file
Read 75 bytes:
Hello World 0
Hello World 1
Hello World 2
Hello World 3
Hello World 4
Closing file TestFile.txt
Unmounting SD/MMC card
Program complete. Reset to repeat
**********************************************************************
After this test I press reset button with inserted SD card and this time the program does not work correctly. You can see the log below:
**********************************************************************
===== Starting EFFS BASIC MMC/SD Program =====
FAT mount to SD/MMC failed: F_ERR_NOTFORMATTED
Retrieving external flash usage...
*** Error in f_getfreepace(): F_ERR_NOTFORMATTED
Creating test file: TestFile.txt
*** Error opening file "TestFile.txt", fp = 0
Unmounting SD/MMC card
Program complete. Reset to repeat
***********************************************************************
Why does not the program work correctly after reset with iserted SD card second time?
I would like write a program which will initialize a SD (with FAT) card properly after unexpected CPU reseting. Now I need remove SD card after first unexpected CPU reseting then insert and initialize.
Best regards
I have a problem with SD card after CPU reseting. I'm using an example "nburn\examples\EFFS\EFFS-BASIC" for to find out how to work with SD card.
The program works great if I wait until program starts and only then I insert SD card and press <enter> button. You can see a log below:
********************************************************************
===== Starting EFFS BASIC MMC/SD Program =====
No MMC/SD card detected. Insert a card and then press <Enter>
FAT mount to SD/MMC successful
SD/MMC drive change successful
Retrieving external flash usage...
Flash card memory usage (bytes):
32014336 total, 32012288 free, 2048 used, 0 bad
Found File [TESTFILE.TXT] : 75 Bytes
Creating test file: TestFile.txt
Wrote 15 bytes: Hello World 0
Wrote 15 bytes: Hello World 1
Wrote 15 bytes: Hello World 2
Wrote 15 bytes: Hello World 3
Wrote 15 bytes: Hello World 4
Rewinding file
Read 75 bytes:
Hello World 0
Hello World 1
Hello World 2
Hello World 3
Hello World 4
Closing file TestFile.txt
Unmounting SD/MMC card
Program complete. Reset to repeat
**********************************************************************
After this test I press reset button with inserted SD card and this time the program does not work correctly. You can see the log below:
**********************************************************************
===== Starting EFFS BASIC MMC/SD Program =====
FAT mount to SD/MMC failed: F_ERR_NOTFORMATTED
Retrieving external flash usage...
*** Error in f_getfreepace(): F_ERR_NOTFORMATTED
Creating test file: TestFile.txt
*** Error opening file "TestFile.txt", fp = 0
Unmounting SD/MMC card
Program complete. Reset to repeat
***********************************************************************
Why does not the program work correctly after reset with iserted SD card second time?
I would like write a program which will initialize a SD (with FAT) card properly after unexpected CPU reseting. Now I need remove SD card after first unexpected CPU reseting then insert and initialize.
Best regards