Discussion in "Project Help" started by    labarbacue    Apr 24, 2009.
Sat May 09 2009, 03:22 pm
#21
I will talk to dave not a prob..
Sun May 10 2009, 07:14 am
#22
labarbacue,

you asked about these errors:

compiling tff.c...
TFF.C(176): warning C206: 'LD_WORD': missing function-prototype
TFF.C(176): error C267: 'LD_WORD': requires ANSI-style prototype



These are macros from Chan's library, and they are located in the header files. If you are using TFF.C, have a look in TFF.H... if you are using FF.C, have a look in FF.H...

They are used to load a word in small endian format from your sector buffer when you read it...

Hope this helps,
Sun May 10 2009, 11:58 am
#23
Hi Dave ,

Thank you for your anwer , i have already taken a look , but it seems impossible to find the solution , because as you have said , these files are in tff.c and tff.h , and the header seems to be correct , but it doesn't work , and i don't know what can i change to make them work .... could you send your program , or at least the tff files that you use ? , and the other problem that i have is to name the variable Stat in diskio.c . Thanks!!
Sun May 10 2009, 12:06 pm
#24
I will try and replicate what you have done, and see if I am successful. First things first, I will download the files from chan's website and start a project in a new subdirectory.

We can use chat forum for this...
Sun May 10 2009, 12:12 pm
#25
Okay, my new subdirectory looks like this now:



Sun May 10 2009, 12:29 pm
#26
Okay, now after making the project in Keil, my project looks like this:


Sun May 10 2009, 12:33 pm
#27
i have redone the project and my errors are as following..:
Build target 'Target 1'
assembling STARTUP.A51...
compiling diskio.c...
DISKIO.C(34): error C202: 'Stat': undefined identifier
DISKIO.C(38): error C202: 'Stat': undefined identifier
DISKIO.C(53): error C202: 'Stat': undefined identifier
DISKIO.C(68): error C202: 'Stat': undefined identifier
DISKIO.C(91): error C202: 'Stat': undefined identifier
DISKIO.C(118): error C202: 'Stat': undefined identifier
compiling tff.c...
TFF.C(176): warning C206: 'LD_WORD': missing function-prototype
TFF.C(176): error C267: 'LD_WORD': requires ANSI-style prototype
compiling SPI.c...
Target not created
Sun May 10 2009, 12:39 pm
#28
Next step is to remove all the unnecessary stuff within the diskio.c module.

If you erase the content of all of the functions, you will get this:

/*-----------------------------------------------------------------------*/
/* Low level disk I/O module skeleton for FatFs     (C)ChaN, 2007        */
/*-----------------------------------------------------------------------*/
/* This is a stub disk I/O module that acts as front end of the existing */
/* disk I/O modules and attach it to FatFs module with common interface. */
/*-----------------------------------------------------------------------*/

#include "diskio.h"

/*-----------------------------------------------------------------------*/
/* Inidialize a Drive                                                    */

DSTATUS disk_initialize (
	BYTE drv				/* Physical drive nmuber (0..) */
)
{
}

/*-----------------------------------------------------------------------*/
/* Return Disk Status                                                    */

DSTATUS disk_status (
	BYTE drv		/* Physical drive nmuber (0..) */
)
{
}

/*-----------------------------------------------------------------------*/
/* Read Sector(s)                                                        */

DRESULT disk_read (
	BYTE drv,		/* Physical drive nmuber (0..) */
	BYTE *buff,		/* Data buffer to store read data */
	DWORD sector,	/* Sector address (LBA) */
	BYTE count		/* Number of sectors to read (1..255) */
)
{
}

/*-----------------------------------------------------------------------*/
/* Write Sector(s)                                                       */

#if _READONLY == 0
DRESULT disk_write (
	BYTE drv,			/* Physical drive nmuber (0..) */
	const BYTE *buff,	/* Data to be written */
	DWORD sector,		/* Sector address (LBA) */
	BYTE count			/* Number of sectors to write (1..255) */
)
{
}
#endif /* _READONLY */

/*-----------------------------------------------------------------------*/
/* Miscellaneous Functions                                               */

DRESULT disk_ioctl (
	BYTE drv,		/* Physical drive nmuber (0..) */
	BYTE ctrl,		/* Control code */
	void *buff		/* Buffer to send/receive control data */
)
{
}



Now when you compile the project (remember to set the NOOVERLAY option within the linker setup), you will get the following compiler summary:

Build target 'Target 1'
assembling STARTUP.A51...
compiling MAIN.C...
compiling tff.c...
compiling diskio.c...
DISKIO.C(17): warning C173: missing return-expression
DISKIO.C(14): warning C280: 'drv': unreferenced local variable
DISKIO.C(26): warning C173: missing return-expression
DISKIO.C(23): warning C280: 'drv': unreferenced local variable
DISKIO.C(38): warning C173: missing return-expression
DISKIO.C(32): warning C280: 'drv': unreferenced local variable
DISKIO.C(33): warning C280: 'buff': unreferenced local variable
DISKIO.C(34): warning C280: 'sector': unreferenced local variable
DISKIO.C(35): warning C280: 'count': unreferenced local variable
DISKIO.C(51): warning C173: missing return-expression
DISKIO.C(45): warning C280: 'drv': unreferenced local variable
DISKIO.C(46): warning C280: 'buff': unreferenced local variable
DISKIO.C(47): warning C280: 'sector': unreferenced local variable
DISKIO.C(48): warning C280: 'count': unreferenced local variable
DISKIO.C(63): warning C173: missing return-expression
DISKIO.C(58): warning C280: 'drv': unreferenced local variable
DISKIO.C(59): warning C280: 'ctrl': unreferenced local variable
DISKIO.C(60): warning C280: 'buff': unreferenced local variable
DISKIO.C(17): warning C290: missing return value
DISKIO.C(26): warning C290: missing return value
DISKIO.C(38): warning C290: missing return value
DISKIO.C(51): warning C290: missing return value
DISKIO.C(63): warning C290: missing return value
linking...
*** ERROR L127: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: get_fattime
MODULE: tff.obj (TFF)
*** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: get_fattime
MODULE: tff.obj (TFF)
ADDRESS: 1001D7DH
*** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: get_fattime
MODULE: tff.obj (TFF)
ADDRESS: 1002E24H
*** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: get_fattime
MODULE: tff.obj (TFF)
ADDRESS: 10025FAH
Program Size: data=9.0 xdata=642 const=0 code=18442
Target not created

Sun May 10 2009, 12:49 pm
#29
To set the NOOVERLAY feature, do the following:

Select Project, then select Options, then select LX51 Misc, then in the box titled "Misc controls", enter the word NOOVERLAY

Sun May 10 2009, 12:59 pm
#30
i have already done the same as you , but the errors seem to be different :

Build target 'Target 1'
assembling STARTUP.A51...
compiling diskio.c...
DISKIO.C(17): warning C173: missing return-expression
DISKIO.C(14): warning C280: 'drv': unreferenced local variable
DISKIO.C(26): warning C173: missing return-expression
DISKIO.C(23): warning C280: 'drv': unreferenced local variable
DISKIO.C(38): warning C173: missing return-expression
DISKIO.C(32): warning C280: 'drv': unreferenced local variable
DISKIO.C(33): warning C280: 'buff': unreferenced local variable
DISKIO.C(34): warning C280: 'sector': unreferenced local variable
DISKIO.C(35): warning C280: 'count': unreferenced local variable
DISKIO.C(51): warning C173: missing return-expression
DISKIO.C(45): warning C280: 'drv': unreferenced local variable
DISKIO.C(46): warning C280: 'buff': unreferenced local variable
DISKIO.C(47): warning C280: 'sector': unreferenced local variable
DISKIO.C(48): warning C280: 'count': unreferenced local variable
DISKIO.C(63): warning C173: missing return-expression
DISKIO.C(58): warning C280: 'drv': unreferenced local variable
DISKIO.C(59): warning C280: 'ctrl': unreferenced local variable
DISKIO.C(60): warning C280: 'buff': unreferenced local variable
compiling tff.c...
tff.h(300): error C320: Do not forget to set _MCU_ENDIAN properly!
compiling MAIN.c...
tff.h(300): error C320: Do not forget to set _MCU_ENDIAN properly!
Target not created

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ArktiTic
Sun May 05 2024, 07:06 pm
CesslasyNear
Sun May 05 2024, 02:58 pm
chimichmedic1204
Sun May 05 2024, 11:06 am
Jamiegob
Sun May 05 2024, 10:11 am
Gregoryjed
Sun May 05 2024, 10:02 am
Mariocax
Sun May 05 2024, 08:51 am
WilliamErync
Sun May 05 2024, 02:35 am
Danielnof
Sat May 04 2024, 11:12 pm