Flash command problems

cancel
Showing results for 
Search instead for 
Did you mean: 

Flash command problems

Jump to solution
488 Views
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.

Labels (1)
1 Solution
242 Views
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

View solution in original post

3 Replies
243 Views
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

242 Views
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 Kudos
242 Views
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!
-----------------------------------------------------------------------------------------------------------------------