View previous topic :: View next topic |
Author |
Message |
yoonees
Joined: 29 Jun 2009 Posts: 12
|
Weird MMC FAT16 Behaviour |
Posted: Wed Jul 15, 2009 8:59 am |
|
|
Hello all,
I managed to get ex_fat.c from the PICC library working. Currently, I'm experiencing the same problem as matt1971 (http://www.ccsinfo.com/forum/viewtopic.php?t=36580). I'm able to write files to a MMC card but I'm not able to see those files using the PC and vice versa. According to asmallri, this is due to the PIC not correctly interpreting the MBR. Any idea how to solve this problem? Here are the details:
Compiler version: PCWHD 4.057
PIC processor: PIC18LF4550
Clock frequency: 20MHz external oscillator
PIC running at 3.3V
Thanks! |
|
|
robomaniac
Joined: 16 Jul 2009 Posts: 19 Location: Sherbrooke, Québec, Canada
|
|
Posted: Thu Jul 16, 2009 6:23 pm |
|
|
Master Boot Record
I google that MBR
So the MBR contain all the info on the structure of the card, size, how many sector, etc. )
so if we screw up the MBR, the SD card is a BIG eeprom! When we plug it into a computer, the MBR is screwed and the computer can not recognize the info.
My friend has the SD card running with C18, I might have a look how he formats the card.
In the ex_fat.c line 314 there is that function call format() and can not find it. I guest we could start by looking how it does the magic.
ps- I am the guy who tested the ex_fat.c on your other post.
http://www.ccsinfo.com/forum/viewtopic.php?p=118356#118356
Here is where I got some info. ( French )
http://forums.futura-sciences.com/electronique/147597-pic-spi-memoire-mmc.html _________________ Jérôme Demers
www.jeromedemers.com |
|
|
robomaniac
Joined: 16 Jul 2009 Posts: 19 Location: Sherbrooke, Québec, Canada
|
|
Posted: Thu Jul 16, 2009 6:53 pm |
|
|
Here is some other info on the MBR
http://ww1.microchip.com/downloads/en/AppNotes/01045b.pdf
Here is the contents of the MBR.
Offset____Description ___________________Size
000h____Boot Code (machine code and data)._____446 bytes
1BEh____Partition Entry 1. ____________________16 bytes
1CEh____Partition Entry 2._____________________16 bytes
1DEh____Partition Entry 3. ____________________16 bytes
1EEh____ Partition Entry 4.____________________16 bytes
1FEh____Boot Signature Code (55h AAh)._________2 bytes
I think with WinHEX we can see the MBR...
http://www.x-ways.net/winhex/index-m.html
and yes you can, In sector 0 I can read FAT 12 and the rest is all weird ascii text.
I got other things to do, I might check later.
Ps - My friend just gave me his code for the SD card using C18, and he use the 18F4680 and I use the 18LF4685. The code takes a lot of space so you need a big pic. _________________ Jérôme Demers
www.jeromedemers.com |
|
|
yoonees
Joined: 29 Jun 2009 Posts: 12
|
|
Posted: Thu Jul 16, 2009 9:00 pm |
|
|
robomaniac wrote: | Master Boot Record
I google that MBR
So the MBR contain all the info on the structure of the card, size, how many sector, etc. )
so if we screw up the MBR, the SD card is a BIG eeprom! When we plug it into a computer, the MBR is screwed and the computer can not recognize the info.
My friend has the SD card running with C18, I might have a look how he formats the card.
In the ex_fat.c line 314 there is that function call format() and can not find it. I guest we could start by looking how it does the magic.
ps- I am the guy who tested the ex_fat.c on your other post.
http://www.ccsinfo.com/forum/viewtopic.php?p=118356#118356
Here is where I got some info. ( French )
http://forums.futura-sciences.com/electronique/147597-pic-spi-memoire-mmc.html |
Hi Jérôme,
Thanks for all the info
The format() function can be found in line 2868 in the fat.c driver.
That's all I can say at the moment. I'll try to give an update later |
|
|
yoonees
Joined: 29 Jun 2009 Posts: 12
|
|
Posted: Sat Jul 18, 2009 1:29 am |
|
|
While looking through the format() function in the fat.c driver, I noticed something. In line 2919,
Code: | char BS_FilSysType[] = "FAT12 "; |
Isn't it supposed to be:
Code: | char BS_FilSysType[] = "FAT16 "; |
Anyhow, I did try changing it and running the codes. However, the results are still the same. Both the PIC and the PC are still unable to see files created by each other. |
|
|
|