This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Hardcode MBR_BOOTLOADER_ADDR

Hello,

I need to temporarily hardcode MBR_BOOTLOADER_ADDR address in the code so flash area is calculated correctly in fds.c.  I have the following code in my ld file:

MEMORY
{
...

/* MBR: 0x00000000 - 0x00000FFF (4KB) */
MBR_BOOTLOADER_ADDR (r) : ORIGIN = 0xFF8, LENGTH = 0x4

/* SoftDevice s132: 0x00001000 - 0x00025FFF, LENGTH = 0x26000 (136KB) */

/* Application Code: 0x00026000 - 0x00054FFF, LENGTH = 0x32000 (200KB) */
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x32000

...

}

...

SECTIONS
{
. = ALIGN(4);
.mbr_bootloader_addr :
{
KEEP(*(.mbr_bootloader_addr))
} > MBR_BOOTLOADER_ADDR
}

And this in my main.c

const uint32_t mbr_bootloader_addr __attribute__((section(".mbr_bootloader_addr"), used)) = 0x6E000;

I get a build error:

region `MBR_BOOTLOADER_ADDR' overflowed by 180 bytes

Can you tell me what I am doing wrong?  Thank you.

Parents Reply Children
No Data
Related