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

Placing code well after startup code

Hello,

I am using MDK ARM for a project that is originally designed for Infineon XMC4300 with the DAVE IDE. I have integrated this project successfully into MDK ARM (µVision) All runs great.
The problem I have is memory placement. The original GNU project placed the startup code and the vector table at 0xC000000 and the rest of the code at 0xC020000 because it needs some space for an emulated EEPROM. Now the MDK project places everything at 0xC000000 consecutively. How can I tell the linker to use the placement described above? Scatter-file? But how? This all seems quite complicated to me.

Please help.

Parents
  • In the meantime I changed my scatter file to this:

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


    Now the memory map looks good, but it doesnt work. If I debug into it, it runs to main() and I can step through a bit, but the first call to a function leads into nirvana.

Reply
  • In the meantime I changed my scatter file to this:

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


    Now the memory map looks good, but it doesnt work. If I debug into it, it runs to main() and I can step through a bit, but the first call to a function leads into nirvana.

Children