S12XEP100, cannot erase flash block 0 at 7C_0000

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S12XEP100, cannot erase flash block 0 at 7C_0000

跳至解决方案
892 次查看
AndersJ
Contributor IV

Is there anything in particular to consider when erasing flash at 7C_0000?

I erase sector by sector from 78_0000 and upwards, and crash when I reach 7C_0000.

My program runs in block 3 , 70_0000 to 73_FFFF.

 

Anders J

标签 (1)
0 项奖励
回复
1 解答
710 次查看
kef
Specialist I

Do you disable interrupts when erasing block0, which contains interrupt vectors?

 

Are you operating from block3 to avoid copying flash routines to RAM? Then try disabling interrupts. If you can't disable interrupts, then you may use IVBR to switch to alternative interrupt vectors table. But, either you need to move your ISRs to RAM, which is more work than moving only flash routine. Or, you may try allocating vectors table and all ISR's in the same PPAGE of block3, and then enable interrupts and don't leave this PPAGE while interrupts are enabled IVBR'ed to this PPAGE.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
710 次查看
AndersJ
Contributor IV

Block erasing has similar issues.

It crashes when erasing block 0, and also secures the device.

 

Can someone explain what I am doing wrong?

Anders J

 

0 项奖励
回复
711 次查看
kef
Specialist I

Do you disable interrupts when erasing block0, which contains interrupt vectors?

 

Are you operating from block3 to avoid copying flash routines to RAM? Then try disabling interrupts. If you can't disable interrupts, then you may use IVBR to switch to alternative interrupt vectors table. But, either you need to move your ISRs to RAM, which is more work than moving only flash routine. Or, you may try allocating vectors table and all ISR's in the same PPAGE of block3, and then enable interrupts and don't leave this PPAGE while interrupts are enabled IVBR'ed to this PPAGE.

0 项奖励
回复