Flash command problems

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Flash command problems

ソリューションへジャンプ
927件の閲覧回数
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 解決策
681件の閲覧回数
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 返答(返信)
682件の閲覧回数
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

681件の閲覧回数
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 件の賞賛
681件の閲覧回数
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!
-----------------------------------------------------------------------------------------------------------------------