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
Solved! Go to Solution.
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.
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
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.