I want to port the FFS library and the corresponding example (NAND Flash File System patch for Freescale MQX™ RTOS 4.0.0) from Freescale compiler to GNU GCC compiler.
To do this I set up a new project for the library like it is explained here: A Library with ARM gcc and Eclipse | MCU on Eclipse.
This produces a valid library file (fss.a).
In the next step I tried to port the included msf_nandflash example by creating a new gcc project, including all the references and adding the previously created library to the linker. At this point I'm getting many "undefined reference" errors in the file "Freescale_MQX_4_0\ffs\source\nandflash_wl.c" for funtion names from the library like 'DriveErase' or 'DriveRepair'.
Can somebody please help me?
已解决! 转到解答。
It seems you have used GNU C compiler for the ffs.a. However, the ffs lib is written in c++ and therefore you need to use GNU C++ compiler. I was able to do what you are looking for (I attach my ffs folder with build projects for CW 10.4 with the gcc compiler). The demo project seems to work with this (tried: nanderasechip, fsopen, format a:, write test00.txt 512, fsclose, Power On Reset, fsopen, dir and read test00.txt). I did only Debug build configuration of MQX libraries and Int Flash Sram Data build configuration for the demo application.
It seems you have used GNU C compiler for the ffs.a. However, the ffs lib is written in c++ and therefore you need to use GNU C++ compiler. I was able to do what you are looking for (I attach my ffs folder with build projects for CW 10.4 with the gcc compiler). The demo project seems to work with this (tried: nanderasechip, fsopen, format a:, write test00.txt 512, fsclose, Power On Reset, fsopen, dir and read test00.txt). I did only Debug build configuration of MQX libraries and Int Flash Sram Data build configuration for the demo application.
Hello Martin,
I am facing the same problem as Frieder faced. I used the code given by you in ffs.zip for my TWRK60F120M board and got valid library ffs.a and then I created new project with demo.c(given in ffs.zip) then also I am getting undefined reference to _io_nandflash_wl_install(), though I am giving the path of lib in project (settings are same in preference as there in your project).To check for any setting missing I checked your code and build it for TWRK70 and got .elf file successfully then I created new project for demo.c using TWRK70 only but here also I got the same error.
Please help me to figure out this problem.
Thanks.
Hi Martin,
I used the FFS code given by you in above post for my TWRK60F120M and it worked fine in MQX4.0 CW10.5 due to some issues I faced in FFS now I am using MQX4.1 CW10.6 I checked the demo code and done all changes what you did in MQX4.0 and my demo.c code worked fine but in my project I am getting lots of undefined reference errors for FFS related functions though I have changed C/C++ build settings as there in your project.
Please help me to resolve this.
Thanks.