AnsweredAssumed Answered

Shut down power ,when doing erase flash.Reset,read flash make ECC,then turn the IVOR2:Storage interrupt handler

Question asked by 神 战 on Nov 15, 2018
Latest reply on Dec 16, 2018 by ufedor


   Shut down power ,when doing erase flash.

   Then Reset MCU ,read flash make ECC,then turn the IVOR2:Storage interrupt handler .

  But,it's make the MCU cycle in it.

I don't know ,how to insert a function to deal this interrupt!

could you please show me the way to insert a function to deal like this interrupt?

thanks very much!


asm void ivor_branch_table_p0(void) {
IVOR0trap: b IVOR0trap /* Critical Input interrupt handler */

IVOR1trap: b IVOR1trap /* Machine check / (NMI) interrupt handler */

IVOR2trap: b IVOR2trap /* Data Storage interrupt handler */

IVOR3trap: b IVOR3trap /* Instruction Storage interrupt handler */

IVOR4trap: b INTC_INTCInterruptHandler /* External Interrupt interrupt handler */

IVOR5trap: b IVOR5trap /* Alignment interrupt handler */

IVOR6trap: b IVOR6trap /* Program interrupt handler */

//and so on


my work turn on the third , it's IVOR2trap ,and cycling forever .



if you not comprehend yet ,I'll tell you a little bit more about that.

first, we made one section of flash for save the run time of machine . about onece time an huor.

so,we got read old data ,and then show it for our client ,then erase flash ,and finally save new data.

but ,we find it when got test ,if we shut down power  ,when the machine erase flash , it will make inflash ECC worng,but EDC and EER the bit of MCR can't aim the error before i read the flash.

when i read the flash ,that can show the flag , but it's too late.MCU run into interrupt ,and i don't know how to insert my own function in it and deal it.

we also try to read LVD of power for prohibit erase flash ,when the power low.

but it is too long ,that erase the whole flash .the power down mabey occur after check LVD flag .