Author Topic: #define SPI_FILE_SYSTEM compile ERROR!  (Read 11855 times)

Offline tr111

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
#define SPI_FILE_SYSTEM compile ERROR!
« on: September 21, 2007, 02:45:18 AM »
Hello:
       I have  defined SPI_FILE_SYSTEM and undefined FLASH_FILE_SYSTEM!
       I want to use the fnEraseFlashSector();   fnWriteBytesFlash(); fnGetParsFile() at the ATMEL AT45DBXXX ,
       I don't want to use the SPI_SW_UPLOAD,it is too complex.No like the vxworks's bootrom,that is easy to use.
       Can that the ATMEL AT45DBXXX   only use to SPI_SW_UPLOAD no the fnEraseFlashSector();   fnWriteBytesFlash(); fnGetParsFile() ??
      Otherwise if I have the M95XXX EEPROM  ,but defined SPI_FILE_SYSTEM  it will be ERROR!
      why!

       but compil ERROR! look this:
       Error   : unexpected end of line
M5223X.c line 2112                      // uses external file system in M95XXX EEPROM 

Error   : illegal token for integral constant expression
M5223X.c line 2114       extern QUEUE_HANDLE SPI_handle; 

Error   : undefined identifier 'M95XXX_WRITE_ENABLE'
M5223X.c line 2176       static const unsigned char ucWriteEnable[] = {M95XXX_WRITE_ENABLE, TERMINATE_WRITE}; // enable write 

Error   : function has no prototype
M5223X.c line 2184           fnWaitWriteComplete();                                           // wait until free to write 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2186           fnWrite(SPI_handle, (unsigned char *)ucWriteEnable, sizeof(ucWriteEnable)); // prepare write 

Error   : function has no prototype
M5223X.c line 2187           fnWriteBytesEEPROM(ptrEEPROM, ucDel, EEPROM_PAGE_SIZE);          // delete a page 

Error   : undefined identifier 'M95XXX_WRITE_ENABLE'
M5223X.c line 2253       static const unsigned char ucWriteEnable[] = {M95XXX_WRITE_ENABLE, TERMINATE_WRITE}; // enable write 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2263           fnWrite(SPI_handle, (unsigned char *)ucWriteEnable, sizeof(ucWriteEnable)); // prepare write 

Error   : ';' expected
M5223X.c line 2464   extern SPIQue *spi_rx_control; 

Error   : undefined identifier 'M95XXX_READ_MEMORY'
M5223X.c line 2669       usRead[0] = M95XXX_READ_MEMORY; 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2675       fnWrite(SPI_handle, usRead, sizeof(usRead));                         // set the read address 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2676       fnRead(SPI_handle, ptrValue, usSize);                                // read from the device to the return buffer 

« Last Edit: September 21, 2007, 03:33:11 AM by tr111 »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: #define SPI_FILE_SYSTEM compile ERROR!
« Reply #1 on: September 21, 2007, 06:33:25 AM »
Hi

I am sorry, but in the set up for SPI_FILE_SYSTEM there is an error in SP5 as explained in the SP5 thread:
http://www.utasker.com/forum/index.php?topic=40.msg175#msg175

See point 6:
In M5223X.c:
1. Correct the line #elif SPI_FILE_SYSTEM (invalid syntax) to #elif defined SPI_FILE_SYSTEM (about line number 2110)
2. Declare the function int fnWriteBytesEEPROM() (about line 2125) as a static function static int fnWriteBytesEEPROM()

Please use that thread as monitor for bug fixes in the SP5.

Regards

Mark

Offline tr111

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: #define SPI_FILE_SYSTEM compile ERROR!
« Reply #2 on: September 21, 2007, 08:14:02 AM »
thank you! Every one do is for the uTasker to be perfection!
That is ok!
Can that the ATMEL AT45DBXXX   use the fnEraseFlashSector();   fnWriteBytesFlash(); fnGetParsFile() to save or read data after defined SPI_FILE_SYSTEM !
« Last Edit: September 21, 2007, 08:28:28 AM by tr111 »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: #define SPI_FILE_SYSTEM compile ERROR!
« Reply #3 on: September 21, 2007, 11:40:03 AM »
Hi

In order to use the AT45DBXXXX it is necessary to user SPI_SW_UPLOAD.

"The SPI_SW_UPLOAD doesn't replace the file system and must be used together with FLASH_FILE_SYSTEM."

Then you can use the commands fnEraseFlashSector(); fnWriteBytesFlash(); fnGetParsFile().

If you use SPI_FILE_SYSTEM you can use the file system and also these lower level commands but they will all interface with M95XXX type EEPROMs, which is not what you want.

Don't worry if you don't want to use the SW upload feature - it will be available but doesn't need to be used.

Regards

Mark

Offline tr111

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: #define SPI_FILE_SYSTEM compile ERROR!
« Reply #4 on: September 21, 2007, 02:58:53 PM »
thank you!

Offline ReySinTrono

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: #define SPI_FILE_SYSTEM compile ERROR!
« Reply #5 on: November 19, 2008, 03:24:19 PM »
Hi,

I need to use SPI Interface for to control LCD, but when I add #define SPI_INTERFACE in config.h and Compile with Eclipse, appears the follow errors:

..\..\..\Hardware\M5223X\M5223X.c: In function 'fnWriteBytesEEPROM':
..\..\..\Hardware\M5223X\M5223X.c:2291: warning: cast from pointer to integer of different size
..\..\..\Hardware\M5223X\M5223X.c:2292: warning: cast from pointer to integer of different size
..\..\..\Hardware\M5223X\M5223X.c: In function 'fnEraseFlashSector':
..\..\..\Hardware\M5223X\M5223X.c:2403: warning: cast to pointer from integer of different size
..\..\..\Hardware\M5223X\M5223X.c:2408: error: 'ucDel' undeclared (first use in this function)
..\..\..\Hardware\M5223X\M5223X.c:2408: error: (Each undeclared identifier is reported only once
..\..\..\Hardware\M5223X\M5223X.c:2408: error: for each function it appears in.)
..\..\..\Hardware\M5223X\M5223X.c: In function 'fnWriteBytesFlash':
..\..\..\Hardware\M5223X\M5223X.c:2555: warning: cast from pointer to integer of different size
..\..\..\Hardware\M5223X\M5223X.c: At top level:
..\..\..\Hardware\M5223X\M5223X.c:2809: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
..\..\..\Hardware\M5223X\M5223X.c: In function 'fnGetParsFile':
..\..\..\Hardware\M5223X\M5223X.c:3216: warning: cast from pointer to integer of different size
..\..\..\Hardware\M5223X\M5223X.c:3217: warning: cast from pointer to integer of different size
..\..\..\Hardware\M5223X\M5223X.c:3222: error: 'usSize' undeclared (first use in this function).

I am using SP8 with ColdFIre M52233.  Which is my problem?

Thank you in advanced.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: #define SPI_FILE_SYSTEM compile ERROR!
« Reply #6 on: November 19, 2008, 05:56:52 PM »
Hi

The define SPI_INTERFACE was used in earlier versions of the project but has been phased out in newer ones.
Presently the most popular use of the SPI is for controlling SPI FLASH (FLASH_FILE_SYSTEM + SPI_FILE_SYSTEM).
There is no generic SPI interface due to the fact that its use is quite device dependent.

In your case you will need to use the routines like fnConfigSPIFileSystem() [for configuration] and fnSPI_command() as reference as to how to write and read using the SPI. Then you can adapt the commands to suit the device that you need to talk to.

It is possible to use SPI for the file system and also for other purposes (make sure that a different CS is used to select only the required device), but you will need to add the low level interface yourself.

Regards

Mark