AnsweredAssumed Answered

K61 Flash Block 0 MGSTAT0 error

Question asked by AnEngineer on Jul 28, 2016
Latest reply on Jul 29, 2016 by AnEngineer

Dear all,

I have a Kinetis K61, and used the swap mechanism before successfully.

Because of the need of more than the 512K Flash avaliuable in swap mode, we decided to use a "normal" firmware update. So I get the image via Ethernet, and buffer it to DDRRAM. So fine. I erase Block0 and Block1 using the FlashEraseBlock(&ftfl_cfg_ram, PFLASH_HALF1_BASE, FlashCommandSequence);

Then I program the image to Block 0 using FlashProgramPhrase(&ftfl_cfg_ram, PFLASH_HALF0_BASE, 0x80000, 0x80400000, FlashCommandSequence);


Using this, I already get the MGSTAT0 error bit. If I flash the Image (which is actually smaller than 512K) in Block1, there is no error bit.


The whole mechanism works, if I flash the same image as if the one which already is running on the processor. After the reset everything is fine again. If I flash a modified image, I get the MGSTAT error, and before branching to main after the reset I get a hardfault.


Is there anythin special to do, that writing to Block0 gives no MGSTAT0 error, and so the processor will start after the reset?