Flash swap problem on MK22FN1M0VLH12

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

Flash swap problem on MK22FN1M0VLH12

1,455件の閲覧回数
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

ラベル(1)
タグ(2)
0 件の賞賛
返信
3 返答(返信)

1,119件の閲覧回数
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 件の賞賛
返信

1,120件の閲覧回数
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 件の賞賛
返信

1,120件の閲覧回数
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 件の賞賛
返信