Problem with FC5_PIC_FAT16.c

Moderator: Benj

Post Reply
JCMB
Posts: 22
Joined: Wed Feb 08, 2006 3:15 pm
Location: St Etienne, France
Been thanked: 1 time
Contact:

Problem with FC5_PIC_FAT16.c

Post 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);
Attachments
FC5_PIC_FAT16.c
FC5_PIC_FAT16.c modified
(52.26 KiB) Downloaded 371 times

User avatar
Steve
Matrix Staff
Posts: 3421
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Problem with FC5_PIC_FAT16.c

Post 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.
Attachments
FC5_PIC_FAT16.c
Fix for FAT component compilation error - copy into Flowcode 'Components' folder.
(52.03 KiB) Downloaded 375 times

JCMB
Posts: 22
Joined: Wed Feb 08, 2006 3:15 pm
Location: St Etienne, France
Been thanked: 1 time
Contact:

Re: Problem with FC5_PIC_FAT16.c

Post by JCMB »

Compiling OK.
Merci.

JCMB
Posts: 22
Joined: Wed Feb 08, 2006 3:15 pm
Location: St Etienne, France
Been thanked: 1 time
Contact:

Re: Problem with FC5_PIC_FAT16.c

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Problem with FC5_PIC_FAT16.c

Post by Benj »

Hello,

This fixes the problem with the initialise routine.
FC5_PIC_FAT16.c
(52.04 KiB) Downloaded 384 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.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: Problem with FC5_PIC_FAT16.c

Post 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
1 in 10 people understand binary, the other one doesn't !

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Problem with FC5_PIC_FAT16.c

Post 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 393 times
The FAT file goes into the "Flowcode v5/Components/" folder
FC5_PIC_FAT16.c
(52.05 KiB) Downloaded 393 times
Fingers crossed your programs should work correctly now.
Let me know how you get on.

JCMB
Posts: 22
Joined: Wed Feb 08, 2006 3:15 pm
Location: St Etienne, France
Been thanked: 1 time
Contact:

Re: Problem with FC5_PIC_FAT16.c

Post by JCMB »

J did a few tests, it seem to be OK.
Thank's.

Post Reply