KL25Z bootloader, and Flash problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

KL25Z bootloader, and Flash problem

787 次查看
Embionics
Contributor III

Hello,

I m working with  freedom board KL25Z board.

I want to add boot loader and also I want a flash area to store configuration parameters specific to application.

I added "FLASH_LDD" component (from hardware component) of 1k size From the memory location 1FC00.

1. is it possible to protect this area from compiler to write unless otherwise I specify?

2. Also If I would like to define some parameters in this flash area at time of compilation, is it possible? how do I do that?

3. Also when I added "IntFLASH" component (from component library) for the boot loader,  I get the error for "FTFA" saying its already in use.

So is ii possible to use functions of "IntFLASH" component for the 1K flash where I an manually set the address of the memory location (instead in processor expert).

Regards,

Amreen

标签 (1)
0 项奖励
回复
1 回复

474 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Amreen:

About your questions:

1) Reserved memory areas are specified by the linker file. But this only reserves those areas during compile time, not from the running code itself (e.g. a call to a Flash writting API). To physically protect those areas, you need to set "Protection". In the CPU component there is a section in Properties -> Internal Peripherals -> Flash Configuration Field -> Protection regions -> P-Flash protection settings -> Protection regions. There you can specify what regions of your device's flash you want to protect.

2) For this purpose, you need to define the parameters in source code and allocate them using the linker file. Check the next thread for an example:

https://community.freescale.com/message/391758#

For this to work, the best option is to go to the CPU component settings and in the "Build options" tab set the option "Generate linker file" to NO. Then you can modify the linker file as needed.

Also in the same linker file you need to reserve some space for the bootloader, and move your application and interrupt vectors accordingly.

3) The problem is that the IntFLASH component comes with an extra FLASH_LDD component, which conflicts with the FLASH_LDD you previously added. However, I wonder why you need the IntFLASH component; only by adding FLASH_LDD should be enough, as you have the methods to read, write and erase memory. Seems that you are trying to have bootloader + application in the same project, but the normal approach is for the bootloader to be in an independent project.

I hope this helps. Let me know about your doubts.


Regards!,
Jorge Gonzalez

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

0 项奖励
回复