View previous topic :: View next topic |
Author |
Message |
match0927
Joined: 26 May 2009 Posts: 3 Location: Halifax, Nova Scotia, Canada
|
Weird problem on creating a file on SD card |
Posted: Tue Jan 12, 2010 8:21 am |
|
|
I have a 18F67J60 3.3V demo board with CCS. I used its fat and mmcsd lib to work with the board. The initialization (to CCS FAT32) and format are OK, but I am not able to create a file on SD card. I have tried to create a folder and it works. The mk_file(*fileName) fileName="/test.txt" return good means the file was successfully created, however, I could not find the file through a card reader connecteted to my PC.
Anyone met the problem before? |
|
|
tesla80
Joined: 23 May 2007 Posts: 81
|
|
Posted: Wed Dec 14, 2011 10:29 am |
|
|
The same problem! Any solutions?? |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1354
|
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Wed Dec 14, 2011 7:34 pm |
|
|
The PIC and PC are looking at different places on the media for the directory. The library implementation is basic, it assumes a specific format of the media rather that interpret the data structures on the actual media.
Newbies often inadvertently corrupt the master boot record (MBR) and discover that the card no longer works under windows and that reformatting under windows does not help. They then incorrectly conclude the card is damaged.
What is often happening is Windows preserves the MBR during a format so a corrupted MBR will still be corrupted after a format under Windows. This problem can be resolved by formatting the card in a device that does perform a low level format, such as a Camera. Once formatted with a camera, the card is readable again by windows and then, if desired, can be formatted under windows. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|