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

Hello,everyone:

   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) {
nofralloc
   .align SIXTEEN_BYTES
IVOR0trap: b IVOR0trap /* Critical Input interrupt handler */

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

   .align SIXTEEN_BYTES
IVOR2trap: b IVOR2trap /* Data Storage interrupt handler */

   .align SIXTEEN_BYTES
IVOR3trap: b IVOR3trap /* Instruction Storage interrupt handler */

   .align SIXTEEN_BYTES
IVOR4trap: b INTC_INTCInterruptHandler /* External Interrupt interrupt handler */

   .align SIXTEEN_BYTES
IVOR5trap: b IVOR5trap /* Alignment interrupt handler */

   .align SIXTEEN_BYTES
IVOR6trap: b IVOR6trap /* Program interrupt handler */

//and so on

}

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

 

Appendix:

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 .

 

Chinese:

大家好:

  是这么个情况,公司打算用FLASH存储一些参数,大约每一小时一次,先读参数,然后上传,再擦扇区,最后再存进去。但是呢,在测试的时候,发现这么个情况,擦扇区的时间太长了,无法保证擦扇区的时候不掉电。这是模拟极端情况。掉电之后,程序没啥别的问题,就是那个扇区任意地址不能读了。如果读的话,直接跳入内核中断,或者是硬中断,这个我也不清楚应该叫啥,就是上边程序那个位置,IVOR2。而且,提前读EDC和ERR位没用,只有读的时候,它检测到ECC故障才会出现,但是这个时候已经没啥用了,我不知道应该怎么往这个中断处添加用户中断处理函数。能否指点一下?

Outcomes