Creating and compiling library project (FFS) in MQX 4.0.1 and CW10.4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating and compiling library project (FFS) in MQX 4.0.1 and CW10.4

Jump to solution
1,737 Views
friederschrempf
Contributor IV

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?

0 Kudos
1 Solution
970 Views
Martin_
NXP Employee
NXP Employee

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.

View solution in original post

0 Kudos
9 Replies
971 Views
Martin_
NXP Employee
NXP Employee

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.

0 Kudos
970 Views
adt
Contributor III

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.

0 Kudos
970 Views
friederschrempf
Contributor IV

I've got one question left. Maybe you can help.

How can I specify the size of the FFS partition? After running the format command from the shell I always get 10 723 328 bytes size.

0 Kudos
970 Views
Martin_
NXP Employee
NXP Employee

The drive is defined in g_nandZipConfigBlockInfo in ddi_nand_media_definition.cpp

The #define NANDFLASH_1ST_DATA_DRIVE_SIZE_IN_BLOCK comes from nandflash_wl_ffs.h

970 Views
adt
Contributor III

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.

0 Kudos
970 Views
friederschrempf
Contributor IV

Thanks! I tried modifiying NANDFLASH_1ST_DATA_DRIVE_SIZE_IN_BLOCK but without effect: after "format a:" command I still get 10 723 328 bytes size

0 Kudos
970 Views
friederschrempf
Contributor IV

Thank you for your support. It seems to work now as intended!

0 Kudos
970 Views
c0170
Senior Contributor III

Hello Frieder Schrempf,

we could possibly help you in case you share the library you created and the example project with errors.

Regards,

c0170

970 Views
friederschrempf
Contributor IV

Thank you for your reply!

In the attachment you find the compiled ffs.a library and the example project.

Thanks for any help in advance!

0 Kudos