Flash command problems

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

Flash command problems

跳至解决方案
997 次查看
rothkarl
Contributor III

Dear Forumers!

MCU:MKL25Z128VFM4

We're trying to create a bootloader app which is capable of self programming the flash.

We've tried executing the following command:

-erase flash sector

-program longword

-program check

The problem is regarding to all of the command:

In some cases the mcu resets, and RCM state of LOCKUP is detected after reset. If the above mentioned routines are placed somewhere else in the code, this reset may not occurs.

We cannot understand the reason of this, and at this point we've stuck continuing the firmware development.

Can you help us, how should we modify our code, if it is possible?

The above mentioned subroutines are running from program flash.

标签 (1)
1 解答
751 次查看
mjbcswitzerland
Specialist V

Hi

You can get boot loaders for the KL25 here: https://community.freescale.com/thread/317301

Otherwise you ned to execute all Flash operatiosn form SRAm with interrupt disabled.

Regards

Mark

在原帖中查看解决方案

3 回复数
752 次查看
mjbcswitzerland
Specialist V

Hi

You can get boot loaders for the KL25 here: https://community.freescale.com/thread/317301

Otherwise you ned to execute all Flash operatiosn form SRAm with interrupt disabled.

Regards

Mark

751 次查看
rothkarl
Contributor III

Thank you for the reply, I've mapped my flash command functions into SRAM, and it works fine, after I've disabled the interrupt!

0 项奖励
751 次查看
perlam_i_au
Senior Contributor I

I think the problem here is MKL25Z128VFM4 only have one flash block (review 3.6.1.1 Flash Memory Sizes in the Reference manual for this part number KL25P80M48SF0RM) you can only write flash from flash, if you write a block from different block.

In this case I suggest you to try Execute flash commands from SRAM, please review AN4695 Avoiding Read While Write Errors When Developing In-Software Flash Programming Applications f..., check 2.1.2 Method 2: Execute flash commands from SRAM I hope you may find this useful


Have a nice day :P,
Perla

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