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

FAT or not FAT: That's the question.

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



Joined: 30 Apr 2009
Posts: 5

View user's profile Send private message

FAT or not FAT: That's the question.
PostPosted: Wed Jun 03, 2009 5:04 am     Reply with quote

Hi everyone!

I'm working in a FAT using the example "EX_FAT.C" and I think the problem is in the file "mmcsd.c".

When I read the sector '0', the SD memory send me this:

F8 00 FF 00 FF 00 0F 00 FF 00 FF 00 FF 00 0F 00 FF 00 FF 00 FF 00 0F 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 F8 00 00 00 00 00
20 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 80 00 96 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
01 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00 00 00 00 00 00 4E 4F
20 4E 41 4D 45 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 19 ED 0D 00 00 00 00 01 01 00 0B FE 3F 77 3F 00 00 00 39 6A 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA

When I open the SD memory using a Hex editor, that isn't the first sector. I think I have to put an offset. Did anybody find that bug?

Thanks
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Jun 03, 2009 5:55 pm     Reply with quote

mmcsd.c is correct. The first sector (512 bytes) of a FAT file system is the boot sector, recognizable by the "55 AA" signature at the last two bytes.

Your Windows Hex Editor is trying to be 'smart' and does not give you the first physical sector of the card but most likely gives you the first partition sector, a completely different thing. Try using another Hex Editor like Hexplorer or WinHex.
CLK.Tech



Joined: 30 Apr 2009
Posts: 5

View user's profile Send private message

PostPosted: Thu Jun 04, 2009 1:16 am     Reply with quote

Hi!

Thanks for info. So, in this case, I have to find the first partition, put an offset, because when I get the #0, my program can't get all the FAT info in Init_FAT.

So I thought 'g_mmcsdBufferAddress+=0x7E00' but it reads the sector 0.

Any idea?
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