S12XEP100, cannot erase flash block 0 at 7C_0000

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12XEP100, cannot erase flash block 0 at 7C_0000

Jump to solution
470 Views
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

Labels (1)
0 Kudos
1 Solution
288 Views
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.

View solution in original post

0 Kudos
2 Replies
288 Views
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 Kudos
289 Views
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 Kudos