I am making a USB Bootloader for PIC24FJ128GC006 and I am going to map part of the flash memory for the Bootloader and the Application code.
I added the linker script from Microchip MLA v2015_08 usb device bootloader to my PIC24FJ code file.
In the linker file, the __BOOTLOADER
must be defined in order to access the 0x400
address region.
#ifdef __BOOTLOADER
program (xr) : ORIGIN = 0x400, LENGTH = 0x35BE
#else
program (xr) : ORIGIN = 0x4002, LENGTH = 0x117F4
#endif
In the main.c of my bootloader code, I have already #define __BOOTLOADER
, but when I program the bootloader code to the PIC using ICD3 and check the program memory by using the PIC Memory Views of MPLAB Window Toolbar, the data is written to the 0x4002
address and not in the 0x400
.
What can be the problem?