Flash swap problem on MK22FN1M0VLH12

cancel
Showing results for 
Search instead for 
Did you mean: 

Flash swap problem on MK22FN1M0VLH12

447 Views
handychandra
Contributor III

Could someone help me with flash swap problem ?

 

I'm using C90TFS Flash driver from freescale to perform flash swap.  But when flash swap completed and i restart the MCU, the MCU doesn't run. Here are my code for your reference.

I called SwapInit(), program the upper block, and then call SwapEnd(). By the way, when the MCU doesn't run, i read the flash memory using SWD. And the content of the flash match exactly with my firmware image (.bin).

Original Attachment has been moved to: swap.h.txt.zip

Original Attachment has been moved to: swap.c.txt.zip

Labels (1)
Tags (2)
0 Kudos
3 Replies

111 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

I checked your attached swap.c file, there without routine to copy the contents of the lower p-flash block to the upper p-flash block.

I would recommend customer to check Kinetis Flash swamp application note AN4533 related software, customer can download it from here.

Wish it helps.


Have a great day,
best regards,

Ma Hui

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

0 Kudos

111 Views
handychandra
Contributor III

Hi Ma Hui,

Yes i have checked AN4533. But isn't the demo is about simulating firmware update by updating the firmware with the same firmware ? In my program, I called Swap_Init(), program the upper block flash in some other routine, and called Swap_End(). Is this correct ? Or should i copy the lower block to upper block first ?

Regards,

Handy

0 Kudos

111 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Handy,

The AN4533 is update using the same firmware.

Your precessing should be correct. There is no need to copy the lower block code to upper block at first.

Could you check if the loaded firmware could work at the MK22FN1M0VLH12 chip?

And please check the SCB_VTOR (vector table address), in general the start_up routine will copy vector table content to SRAM and redirect SCB_VTOR to RAM. If your updated firmware also with that code? Or, the SCB_VTOR could be redirect to 0x0 address (using Flash vector table).

Wish it helps.


Have a great day,
best regards,

Ma Hui

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

0 Kudos