I want to explicitly place the non-volatile memory because the EEPROM library will have an error if it tries to initialize a memory block that already has other unerased data in it from a different program. However, when I do this, the linker starts putting code in the memory areas where the bootloader would go. I tried to work around this by reserving a block of memory, but when I load the code I get stuck in the AddressError trap.

I'm using a PIC24FJ64GB106 and the C30 compiler. If I understand this correctly, the bootloader would be placed at address 0xA400, this seems to be the case from looking at the memory map of the ds30 build.

I don't understand why I'm getting an addressing error after loading the program, any help is appreciated. Thanks!