K70 flexnvm used for program flash

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

K70 flexnvm used for program flash

1,070 Views
skteh
Contributor III

Currently I'm using MK70FX512, my program is finished all the 512kB in internal flash.

My program still growing, so I need more flash.

I wanna know if the flexnvm is able used for program flash, and extending my program to here.

Labels (1)
3 Replies

666 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi SK Teh,

      Yes, you may use the other flexNVM as PFlash, but please note in the linker file you have to define two seperate sections for them instead of one section, becase their address are not continuous.

      We have an application note about how to relocate code in ROM, please find it from the attachment.!

      I wish it helps you!

     If you still have question, please let me know!

Best regards!

Jingjing

0 Kudos

666 Views
arnogir
Senior Contributor II

Hello

I have the exactly same need.

I'm using the Tower K70f120m 1M under MQX 4.0.

My software is to manage an LCD panel (800x480) by using PEG library. Then I have some big picture to store in memory flash.

Then I followed the AN4498. But when I start the debug by downloading the software into the target, the loading never ends. It remains long loading.


You will find bellow the steps that I followed:


1- Configuration of MQX : set BSPCFG_ENABLE_NADFLASH to true.

2- Modify linker file (.lcf file):

a - add in "MEMORY" section this line :


  extrom (RW): ORIGIN = 0x60000000, LENGTH = 0x08000000 # ExternFLash - RW data 

b- add in "SECTIONS" part:

.my_section: 
{
. = ALIGN (0x10);
*(.relocate_const)

} > extrom 

3 - In the code (PEG  ressources.cpp file) add following line:

#pragma define_section relocate_const ".relocate_const" ".relocate_const" ".relocate_const" far_abs R
#define __relocate_const__  __declspec(relocate_const)


and then relocate my big constant:

__relocate_const__ const PEGUSHORT bitmaps_TOUCH_CAL_TARGET_BitmapData[400] = {....

That all modification that I made.

Then the .xmap generated contains this add:

....

# .my_section

  60000000 00000000 .relocate_const .relocate_const (resources_cpp.obj)

  60000000 00000320 .relocate_const bitmaps_TOUCH_CAL_TARGET_BitmapData (resources_cpp.obj)

{...}

  60000000 60000000 00000320 .my_section extrom

I don't know if my modifications are all correct or if I have forgot something?

Please help me.

Thanks:smileyhappy:

0 Kudos

666 Views
arnogir
Senior Contributor II

Hi

I will copy here the response of Mr made on another post (TWR-K70F120M Tower Module: "not able to run on the target or the flash is not configured properly" |...)

Hi,

First of all you need to configure in the tcl file the NandFlashController to be able to communicate with the memory you are using.

If you decide to use a Flash device that is not supported by CodeWarrior you must make two things to have it usable.

1.Create a Flash Algorithm: CodeWarrior uses .elf files which describe Flash algorithms. Although some flash memories have the same physical characteristics, the program and erase time cycles may change from one memory to other (even if they are from the same manufacturer). This is why you must create a flash algorithm for the device you have selected. In your CodeWarrior installation path you can find a document which explains how to create an algorithm for a flash device.

2.Create the flash device description and add it to CodeWarrior: Once you have the appropriate algorithm for your flash memory you must create a device description. The device description is a bunch of parameters that you must add to a .xml file with the appropriate Syntax. This file contains all supported flash devices. You can generate this information by yourself or you can use a script to generate the info and just paste it in the .xml file.

You can find this process in the Application Note AN3859.

I hope this information can help you.

Regards,

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------