AnsweredAssumed Answered

Keil + STM32 + ST-Link: Not loading a second memory section defined in scatter (linker) file

Question asked by EpicAdv on Apr 29, 2014
Latest reply on Jul 31, 2015 by Clive One

I'm using a STM32F103C8 + ST-LINK.

I have created a second memory section in the scatter file:

LR_IROM1 0x08000000 0x00010000  {    ; load region size_region   
  ER_IROM1 0x08000000 0x00005000   {  ; load address = execution address     
    *.o  (RESET, +First)    
    .ANY (+RO)  
  }   
  MY_SECT 0x08005000  0x00000400 {     
    main.o   
  }  
  RW_IRAM1 0x20000000 0x00005000  {  ; RW data      
    .ANY (+RW +ZI) 
  }
}

Everything compiles. It looks like the programmer loads to flash. However, when I execute code in the debugger, all memory in that new section is 0xFF -- I can see this in the memory viewer. The program starts executing code in the root section and then eventually jumps to code in the new section. When I start trying to execute code in that new region (MY_SECT), the program jumps to an exception handler.

Any suggestions? What else could I do to debug?

Thank you!

Outcomes