FlexNVM used as Data flash memory

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

FlexNVM used as Data flash memory

602 Views
rahulg
Contributor I

Hi All,

I am using K21 series controller, where I do have 512 KB of Data flash and another 128K FlexNVM which I'm using as data Flash.

Here is my "test.ld" file looks like.@

/* 512 KB data flash, start with addrss 0x000000000 */

    __INTERNAL_FLASH_BASE = 0x00000000;

    __INTERNAL_FLASH_SIZE = 0x00080000;

/* 128 KB FlexNVM, start at addrss 0x100000000 */

    __INTERNAL_FLEXNVM_BASE = 0x10000000;

    __INTERNAL_FLEXNVM_SIZE = 0x00020000;

    I have 64KB of bootloader, which I can place either in First 512K of Flash or in FLEX NVM.

  In Flash :

  bootloader  (RX):  ORIGIN = 0x00000000, LENGTH = 0x00010000  /* Bootloader, 64K */

  Or in FlexNVM :

  bootloader  (RX):  ORIGIN = 0x10000000, LENGTH = 0x00010000  /* Bootloader, 64K */

  Do we have any provision that, we can place this 64K of bootloader,some part of it in first 512K of DataFlash and another part in FlexNVM.

  I'm in a situation, where some section of my .exe ,  I have to place in DataFlash and some part in FlexNVM, which is unavoidable.

  Please let me know whether its possible. in that case how would the *.ld file will look like.

Labels (1)
0 Kudos
1 Reply

387 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello rahul Ghosh:

It might be possible to place some part of the bootloader in PFlash and the rest in DFlash (FlexNVM), but the linker cannot do this automatically.

You need to manually place some functions of the bootloader in the PFlash and the rest in DFlash. The next documents in community explain the procedure:

For CodeWarrior (CW): Relocating Code and Data Using the CW GCC Linker File for Kinetis

For Kinetis Design Studio (KDS): Relocating Code and Data Using the KDS GCC Linker File for Kinetis

The next approach described by colleague Erich Styger can also work in a file basis:

Putting Code of Files into Special Section with the GNU Linker | MCU on Eclipse


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos