Re: PIC24 Flash addressing: How do I calculate the correct block address?
The block erase function should check that it does not overwrite itself or any memory that should be protected.
I set two markers: protect_start address and protect_end address.
xxx xxx xxx
xxx xxx xxx [CFG]
0 1 2 3 4 5 6 7 end block
3 and 4 contain the flash code, protect that.
8 contains config, protect that or modify.