AnsweredAssumed Answered

Implementing Freescale FAT Lite on ColdFire

Question asked by Pablo Suarez on Oct 10, 2012
Latest reply on Feb 3, 2015 by Leonardo Montero Flores

Hi there, I need some help about this issue:

 

I'm working in a data logger project like DEMOFLEXISJMSD_DataLogger_V2

http://www.freescale.com/webapp/sps/site/training_information.jsp?code=WBNR_SDCARDREADER_S08JM&fsrch=1#

This example use a SD card and Freescale FAT Lite to storage data.

 

I implemented the same FAT functions in the MCF51CN128RM ColdFire with the following results:

 

1. SD_Init() function returns:

     Ok (0).

 

2. FAT_FileOpen (FILE_NAME, MODIFY) function returns:

    FILE_NOT_FOUND (1) ->     If the file was not created with the same function with CREATE (1) as parameter.

                                              If I create a file using Windows XP, this function doesn't found it.

 

     FILE_FOUND (0) ->             Just if the file was created using FAT_FileOpen function.

 

3. FAT_FileOpen (FILE_NAME, CREATE) function returns:

     FILE_CREATE_OK (2) ->  But when I read the SD Card using Windows XP nothing appears.

 

I'm using FAT functions like this:

 

 

SD_Card_Status = SD_Init();

 

if (SD_Card_Status != OK)

{

     return;

}

 

FAT_Read_Master_Block();

 

SD_Card_Status = FAT_FileOpen (FILE_NAME, MODIFY);

 

if (SD_Card_Status = FILE_NOT_FOUND)

{

     SD_Card_Status = FAT_FileOpen (FILE_NAME, CREATE);

}

FAT_FileClose();

 

 

SD_Card_Status = FAT_FileOpen (FILE_NAME, MODIFY);

FAT_FileWrite (SD_String_Array, 20);

FAT_FileClose();

 

In this forum I found a discussion about Freescale FAT (https://community.freescale.com/message/86766#86766) but i can't solve the problem.

Even I  tried changing some part of the code suggested in the forum, but it doesn't work.

 

Cuestions:

 

Why FAT_FileOpen function returns FILE_CREATE_OK and Windows can't read it?

Why FAT FileOpen function can't recognize a file created with Windows?

Is this FAT library able to manage up to 2Gbs?

 

If some body test Freescale FAT Lite at ColdFire, please give me some tips.

 

Best regards!

 

Pablo Suárez

Outcomes