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
If you can not compile the SPI_File example for Atmel AT91SAM7X-EK evaluation board, then there is some inconsistency in the installations. Please download the latest MDK upgrade and RL-ARM upgrade.
If you still have problem please send an email to keil support.
yes I already tried to verify my problem through this example:
C:\Keil\ARM\Boards\Atmel\AT91SAM7X-EK\RL\FlashFS\SPI_File
When I try to compile this provided example project, the compilation fails. There is an inconsistency in the definition of some dummy functions for the MMC in File_Config.c.
I use currently MDK 3.20 and RL-ARM 3.20.
Here is the Compiler/Linker output:
Build target 'AT91SAM7X' compiling SPI_File.c... compiling Getline.c... assembling SAM7.s... compiling File_Config.c... File_Config.c(305): error: #147: declaration is incompatible with "BOOL fat_ffind(FINFO *, IOB *)" (declared at line 248 of "C:\Keil\ARM\RV31\INC\File_Config.h") compiling FS_SPI_FlashPrg.c... FS_SPI_FlashPrg.c(41): warning: #223-D: function "spi_init" declared implicitly FS_SPI_FlashPrg.c(106): warning: #223-D: function "spi_command" declared implicitly FS_SPI_FlashPrg.c(121): warning: #223-D: function "spi_command" declared implicitly compiling SPI_SAM7X.c... compiling Serial.c... compiling Retarget.c... Target not created
This finding gives me some confidence that the SPI-interface support in the my used version of RL-FS is not working.
My implementation fulfills otherwise all requirements for the SPI driver even considering that my driver approach is completely different to the provided example.
Updating the RL-ARM would be a problem since I had to re-test all of my project. This is really the last solution I would consider. Is there probably a workaround to this problem?
Hi,
I updated my RL-ARM to version V3.22d (V3.23b). In this version my custom SPI data-flash disc based FS is now working partly.
I still see a problem in the format routine.
I need some urgent feedback from Keil concerning how I can get my FS working properly.
If you expect urgent feedback from Keil, then you have to contact Keil techinical support instead of posting to this forum. See the Support link at the top of this page.
btw, what is a "usual response time" with Keil? Raised an error report on Tuesday (multiscreen in uVision does not work properly) I did not hear a single word yet, afair not even an automated receipt.
I got feedback from Keil regarding my problem. Because of the specific hardware dependence of my problem they ask me to give them a hint what the exact problem is.
I included the FS source code in my project and removed all source files that are not relevant to my needed configuration.
The result is that the SPI based flash-disc is working.
My conclusion is that the linking process of overloading as weak defined interface functions with specific implemented functions fails.