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

Absolute positioning unexplain behavior

Hello,
I am working with the Realview linker. The source of the issue is likely to be documented but I cannot find it - maybe you can help me.
when I'm using the following scatter file:

  ER_IROM1 0x28000 0x56000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }

absolute positioning of a key in flash, at an offset of 0xFF0 from the beginning of the exection region works fine. But, if I change my scatter file to this:

LR_IROM1 0x28000 0x56000  {    ; load region size_region
  ER_IROM1 0x28000 0x56000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  SOFTWARE_EVENT 0x35000  {      ; this region is used to export the software event function for quick invocation
                                                          by the firmware in case of a failure
        SOFTWARE_EVENT.o (+RO)
  }
  ER_IROM2 0x35400 0x48C00  {  ; load address = execution address
   .ANY (+RO)
  }

hence I absolutely position a section at 0x35000, the flash key is placed at about 0xAD00 from the beginning instead!
the scatter file shows the right address for the key, but looking at the generated binary reveals the problem.
What is happening here?

Parents
  • Marcus,

    Sorry for the confusion.
    It should have been

    ER_IROM1 0x28000 0xD000  {  ; load address = execution address
    
    

    (I did not undo enough).
    I found that if I position my code at the end of the flash (maybe the fact that it is after the key matters?), it works:

    LR_IROM1 0x28000 0x56000  {    ; load region size_region
      ER_IROM1 0x28000 0x55C00  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      SOFTWARE_EVENT 0x6DC00 FIXED 0x140 {   ; this region is used to export the software event function for quick invocation
                                                             ; by the firmware in case of a failure
            SOFTWARE_EVENT.o (+RO)
      }
    

    but this increases my flash time...

Reply
  • Marcus,

    Sorry for the confusion.
    It should have been

    ER_IROM1 0x28000 0xD000  {  ; load address = execution address
    
    

    (I did not undo enough).
    I found that if I position my code at the end of the flash (maybe the fact that it is after the key matters?), it works:

    LR_IROM1 0x28000 0x56000  {    ; load region size_region
      ER_IROM1 0x28000 0x55C00  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      SOFTWARE_EVENT 0x6DC00 FIXED 0x140 {   ; this region is used to export the software event function for quick invocation
                                                             ; by the firmware in case of a failure
            SOFTWARE_EVENT.o (+RO)
      }
    

    but this increases my flash time...

Children
No data