Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reserving memory for bootloader
   I have a project where I'm using Microchip's Flash EEPROM emulation library to store non-volatile data, (similar situation as in this post: https://picbootloader.com/forum/showthre...ht=an+1095).

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.

unsigned char BL_placeholder[1024]
    __attribute__((space(prob), aligned(1024),address(0x00A400), noload));

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!
Try something like this
const unsigned int__attribute__((space(prog),address(0x...))) a = 0x1234;

Forum Jump:

Users browsing this thread: 1 Guest(s)