Page 1 of 1

Problem with FC5_PIC_FAT16.c

Posted: Thu Feb 02, 2012 3:11 pm
by JCMB
Compil to C OK but error while compiling to HEX.
-1 In MX_UINT8 Scan_Current_Folder:
if (Read_Byte_From_Buffer((Idx) + 2) == 0x00)
return MX_ACK_FILEEMPTY; //Address is empty
in MX_SINT16 FCD_FAT160_Scan_Current_Folder:
if (Read_Byte_From_Buffer((Idx) + 2) == 0x00)
return MX_ACK_FILEEMPTY; //Address is empty
instead of:
if (FCD_FAT160_Read_Byte_From_Buffer((Idx) + 2) == 0x00)
return MX_ACK_FILEEMPTY; //Address is empty
J replace it with:
i = Read_Byte_From_Buffer((Idx) + 2);
if (i == 0x00)
return MX_ACK_FILEEMPTY;

-2 in MX_UINT8 MX_Send_Cmd
RetVal = MX_SPI_BYTE(0xFF); //Wait for response of 1
MX_SPI_BYTE unknown !
J replace it with:
RetVal = %a_SPI_Master_Byte(0xFF);

Re: Problem with FC5_PIC_FAT16.c

Posted: Thu Feb 02, 2012 3:24 pm
by Steve
Hi,

We know about this issue and the attached C code file should provide a fix for it. This file allows compilation, but the fix has not been confirmed on hardware yet.

If this fix solves the problem for you, please let me know.

Re: Problem with FC5_PIC_FAT16.c

Posted: Thu Feb 02, 2012 3:30 pm
by JCMB
Compiling OK.
Merci.

Re: Problem with FC5_PIC_FAT16.c

Posted: Tue Feb 28, 2012 8:08 am
by JCMB
EB006-00-7 + EB037-00-1 + PIC18F4525 + FC 5.1 + SD Card Fat 16 (4 pieces):
Init_Fat() always return 255 !
Thank's for a quick help.

Re: Problem with FC5_PIC_FAT16.c

Posted: Tue Feb 28, 2012 1:40 pm
by Benj
Hello,

This fixes the problem with the initialise routine.
FC5_PIC_FAT16.c
(52.04 KiB) Downloaded 403 times
I am now getting a problem where the file cannot be found on the card. Is it working ok for you.

I will see if I can get this problem resolved too.

Re: Problem with FC5_PIC_FAT16.c

Posted: Tue Feb 28, 2012 1:47 pm
by JohnCrow
Hi Benj

I've also been having trouble with the FAT component in FC5
See my recent post in the e-blocks section

http://www.matrixmultimedia.com/mmforum ... =2&t=10301

Thanks

Re: Problem with FC5_PIC_FAT16.c

Posted: Tue Feb 28, 2012 4:40 pm
by Benj
Hello,

Right I think I have found and fixed the problem.

1) There was a second bug in the FAT init routine though this was minor
2) There was a bug in the ToUpper function used in the format file string function.

Both of these problems have now been resolved. :D

The String file goes into the "Flowcode v5/CAL/PIC/" folder
PIC_CAL_String.c
(17.92 KiB) Downloaded 405 times
The FAT file goes into the "Flowcode v5/Components/" folder
FC5_PIC_FAT16.c
(52.05 KiB) Downloaded 411 times
Fingers crossed your programs should work correctly now.
Let me know how you get on.

Re: Problem with FC5_PIC_FAT16.c

Posted: Wed Feb 29, 2012 10:10 am
by JCMB
J did a few tests, it seem to be OK.
Thank's.