cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103RB:Error message from debugger back end: Error finishing flash operation allocating const in Flash at fixed address using __attribute__((section (".UserDataSector")))

Diego Colombo
Associate III

Hello.please may i have your help?

I have the error on the final part of debug launching only when i declare

const uint16_t __attribute__((section (".UserDataSector"))) out_val_register[64];//= {0x1234,0x1235,0x1238,0x3333};

in .ld file

/* Specify the memory areas */

MEMORY

{

RAM (xrw)    : ORIGIN = 0x20000000, LENGTH = 20K

FLASH (rx)    : ORIGIN = 0x8000000, LENGTH = 124K

USER_DATA_FLASH (rx)  : ORIGIN = 0x801F000, LENGTH = 4K

}

/* Define output sections */

SECTIONS

{

  

 . = ALIGN(64);

 /* placing my named section at given address: */

 .my_block 0x801F000 :

 {

KEEP(*(.UserDataSector)) /* keep my variable even if not referenced */

 } > USER_DATA_FLASH

}

On other projects with smaller ST processor and same compiler i never had the same error doing the same things.

Any help will be appreciated.

Thanks,

Diego,

Milan,Italy,

0 REPLIES 0