We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi everyone,
I implemented a SPI based flash-file system based on the RL-ARM (MDK and RL-ARM versions are 3.20) for the LPC2468 uC. Unfortunately, the implementation is not working. I was able to trace the problem down to the linking process. I implemented the required functions as described in the RL-ARM help system:
int fs_spi_Init (void); int fs_spi_EraseSector(U32 adr); int fs_spi_ProgramPage (U32 adr, U32 sz, U8 *buf); int fs_spi_ReadData (U32 adr, U32 sz, U8 *buf);
I also implemented the serial data flash device sector description:
// Define Data-Flash Sector Table: // Sector Size 64kB, 16 Sectors: #define SPI_FLASH_DEVICE \ DSB(0x10000, 0x000000), \ DSB(0x10000, 0x010000), \ DSB(0x10000, 0x020000), \ DSB(0x10000, 0x030000), \ DSB(0x10000, 0x040000), \ DSB(0x10000, 0x050000), \ DSB(0x10000, 0x060000), \ DSB(0x10000, 0x070000), \ DSB(0x10000, 0x080000), \ DSB(0x10000, 0x090000), \ DSB(0x10000, 0x0A0000), \ DSB(0x10000, 0x0B0000), \ DSB(0x10000, 0x0C0000), \ DSB(0x10000, 0x0D0000), \ DSB(0x10000, 0x0E0000), \ DSB(0x10000, 0x0F0000), \ // Number of sectors for RTFFS: #define SF_NSECT 16
When I debug my application I notice that the RL-ARM FS makes calls to fs_spi_EraseSector() but never to fs_spi_ProgramPage(). Instead the FS makes dummy calls to methods that are related to the MMC interface. I did setup the FS configuration correctly in the File_Config.c. I also noticed that there is only one example for using the SPI interface in conjunction with the file system. This example is for the AT91SAM7A3. When I try to compile this example, I get an compiler error. I noticed that some function signatures don't match the FS header file declarations.
Thank you for your help!
-Frank
What is your heap size? Too small heap will cause such symptoms. Therefore try with the heap size of 0x800 or larger.
Franc
Hi Franc,
I checked the heap size, it is set to 0x4000. I think it is a inconsistency of the FS library.
I am still having this problem. Is their some example project that implements a true SPI based file system that works? Interesting for me would be the version of the RL-ARM used in this project.
Thank you, Frank