This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32 CONSTANT IN FIXED ADDRESS FLASH

Hello
I am using STM32F030K6 microcontroller and I want to put a constant in a fixed address of flash memory.
I arrive to do it using following attribute

 unsigned int const Type_Value __attribute__((at(0X08007FF0))) = K_MODELLO  ;

I modified the ROM1 page so that the scattered file became as follow:

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x08000000 0x00007FF0  {    ; load region size_region
  ER_IROM1 0x08000000 0x00007FF0  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  RW_IRAM1 0x20000000 0x00001000  {  ; RW data
   .ANY (+RW +ZI)
  }
}

It works, but if I try to move the constant in the address 0X08000000 , starting ROM1 from 0X08000008, it doesn't work, I mean that probably the linker overwrite with my constant, some part of the code.
Does anyone can help me to understand why I cannot place my constant at 0X08000000 address?
Thnaks in advance