CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Weird problem on creating a file on SD card

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
match0927



Joined: 26 May 2009
Posts: 3
Location: Halifax, Nova Scotia, Canada

View user's profile Send private message Visit poster's website

Weird problem on creating a file on SD card
PostPosted: Tue Jan 12, 2010 8:21 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Dec 14, 2011 10:29 am     Reply with quote

The same problem! Any solutions??
jeremiah



Joined: 20 Jul 2010
Posts: 1321

View user's profile Send private message

PostPosted: Wed Dec 14, 2011 10:44 am     Reply with quote

I just did a quick search for FAT using the forum's search feature and come up with this as the 3rd thread in the list:
http://www.ccsinfo.com/forum/viewtopic.php?t=42484&highlight=fat

It sounds related, but you don't give a lot of info, so it is just a guess.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Dec 14, 2011 7:34 pm     Reply with quote

jeremiah wrote:
I just did a quick search for FAT using the forum's search feature and come up with this as the 3rd thread in the list:
http://www.ccsinfo.com/forum/viewtopic.php?t=42484&highlight=fat

It sounds related, but you don't give a lot of info, so it is just a guess.


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!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group