ds30 Loader free edition forums
Reserving memory for bootloader - Printable Version

+- ds30 Loader free edition forums (https://picbootloader.com/forum)
+-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3)
+--- Forum: 16-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=6)
+--- Thread: Reserving memory for bootloader (/showthread.php?tid=22011)



Reserving memory for bootloader - mah115 - 2018-06-11

Hi,
   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/showthread.php?tid=187&highlight=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.


Code:
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!


RE: Reserving memory for bootloader - Mikael Gustavsson - 2018-10-28

Hi,
Try something like this
Code:
const unsigned int__attribute__((space(prog),address(0x...))) a = 0x1234;