free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Rickey's World :: Discussion Forums :: Discuss and Learn :: 8051 Discussion Forum
 
<< Previous thread | Next thread >>
MMC/SD Card interfacing and FAT16 File system - auto_mount problem
Go to page   <<      
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
DavesGarage
Thu May 21 2009, 09:59PM

 User Offline
Registered Member #14254
Joined: Tue Jan 20 2009, 08:14AM

Posts: 622
Thanked 116 times in 112 posts
Hi,

The disk_initialize() is the same as the example that is given here, and the SD_Init returns 0 as it should. Later I tried to send the command CLR_WRITE_PROT before the f_open, this as solved the problem... Now i have another one, again in auto_mount(). When it search for the FAT partition on the drive:
fmt = check_fs(bootsect = 0); the check_fs returns 2 (fm=2) in the second condition:

if (LD_WORD(&fs->win[BS_55AA]) != 0xAA55) /* Check record signature */
return 2;

With fm=2 the auto_mout returns :

if (fmt || LD_WORD(&fs->win[BPB_BytsPerSec]) != 512U) /* No valid FAT patition is found */
return FR_NO_FILESYSTEM;

Do you think that there is a problem with the SD card? I have formatted the card in FAT and later i tried with FAT32. the same error happens.

Thanks for the help.


I took some time to look over the functions, and the disk_initialize() function is written by you, right?

Within this function, there is a variable names Stat, which is not the same as the variable within the automount function.

When you initialized this variable, how did you do it?

In my diskio.c module, my declaration looks like this:

CODE:
static volatile DSTATUS Stat = STA_NOINIT;               /* Disk status */


Not only does this declare the variable, but it initializes it to STA_NOINIT as well...

This is a global declaration, within the DISKIO.C module...

Make sure you do this...




-Dave
"Basic research is what I am doing when I don't know what I am doing"
Back to top

Go to page   <<       

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems