View previous topic :: View next topic |
Author |
Message |
CLK.Tech
Joined: 30 Apr 2009 Posts: 5
|
FAT or not FAT: That's the question. |
Posted: Wed Jun 03, 2009 5:04 am |
|
|
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
|
|
Posted: Wed Jun 03, 2009 5:55 pm |
|
|
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
|
|
Posted: Thu Jun 04, 2009 1:16 am |
|
|
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? |
|
|
|