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

R/O Base address

Hello,
I am developing an application with a bootloader area between 0x0-0x2fff and the application starts at 0x3000. When I check the option "Use Memory Layout from Target Dialog" on "Options for Target/Linker" the linker creates a correct applicatin image starting at 0x3000. As I have a third RAM area I had to use a scatter file. With this option the linker does not consider the bootloader area and place the code starting at 0x0. I have also used the Misc Controls as "--ro-base=0x00003000" and R/O Base: as 0x3000 but it did not work.

Which setting is missing?
Thanks,

Andre

Parents
  • Hello, I have noticed a strange behavior concerning the R/O base address. I have a big RAM vector called safe_buffer.

    When I declare safe_buffer to char safe_buffer[0x68B4] the Dissassembly Window in Debug mode is:

    --->0x00000000  E59F4018  LDR       R4,[PC,#0x0018]
    0x00000004  E59F5010  LDR       R5,[PC,#0x0010]
    0x00000008  E5946000  LDR       R6,[R4]
    0x0000000C  E0056006  AND       R6,R5,R6
    0x00000010  E5846000  STR       R6,[R4]
    0x00000014  E51FF004  LDR       PC,[PC,#-0x0004]
    0x00000018  7FFFE040  SWIVC     0x00FFE040
    0x0000001C  FFFFBFFF  (???)
    0x00000020  3FFF8000  SWICC     0x00FF8000
    0x00000024  00000000  ANDEQ     R0,R0,R0
    0x00000028  00000000  ANDEQ     R0,R0,R0
    0x0000002C  00000000  ANDEQ     R0,R0,R0
    0x00000030  00000000  ANDEQ     R0,R0,R0
    0x00000034  00000000  ANDEQ     R0,R0,R0
    0x00000038  00000000  ANDEQ     R0,R0,R0
    0x0000003C  00000000  ANDEQ     R0,R0,R0
    

    When I declare safe_buffer as char safe_buffer[0x5900], the Dissassembly window is OK:

    --->0x00000000  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000004  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000008  E59FF018  LDR       PC,[PC,#0x0018]
    0x0000000C  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000010  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000014  B9206E50  STMLTDB   R0!,{R4,R6,R9-R11,R13-R14}
    0x00000018  E51FF120  LDR       PC,[PC,#-0x0120]
    0x0000001C  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000020  00000054  ANDEQ     R0,R0,R4,ASR R0
    0x00000024  00000040  ANDEQ     R0,R0,R0,ASR #32
    0x00000028  40000018  ANDMI     R0,R0,R8,LSL R0
    0x0000002C  00000044  ANDEQ     R0,R0,R4,ASR #32
    0x00000030  00000048  ANDEQ     R0,R0,R8,ASR #32
    0x00000034  00000000  ANDEQ     R0,R0,R0
    0x00000038  0000004C  ANDEQ     R0,R0,R12,ASR #32
    0x0000003C  00000050  ANDEQ     R0,R0,R0,ASR R0
    0x00000040  EAFFFFFE  B         0x00000040
    0x00000044  EAFFFFFE  B         0x00000044
    0x00000048  EAFFFFFE  B         0x00000048
    0x0000004C  EAFFFFFE  B         0x0000004C
    0x00000050  EAFFFFFE  B         0x00000050
    

    Does anyone know what is going on???

    The scatter file is defined as:

    LR_IROM1 0x00003000 0x00080000  {    ; load region size_region
      ER_IROM1 0x00003000 0x00080000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_IRAM1 0x40000040 0x00010000  {  ; RW data
       .ANY (+RW +ZI)
      }
      RW_IRAM2 0x7FE00000 0x00004000  {
       .ANY (+RW +ZI)
      }
      RW_IRAM3 0x7FD00000 0x00004000  {
       .ANY (+RW +ZI)
      }
    }
    

    Regards
    André

Reply
  • Hello, I have noticed a strange behavior concerning the R/O base address. I have a big RAM vector called safe_buffer.

    When I declare safe_buffer to char safe_buffer[0x68B4] the Dissassembly Window in Debug mode is:

    --->0x00000000  E59F4018  LDR       R4,[PC,#0x0018]
    0x00000004  E59F5010  LDR       R5,[PC,#0x0010]
    0x00000008  E5946000  LDR       R6,[R4]
    0x0000000C  E0056006  AND       R6,R5,R6
    0x00000010  E5846000  STR       R6,[R4]
    0x00000014  E51FF004  LDR       PC,[PC,#-0x0004]
    0x00000018  7FFFE040  SWIVC     0x00FFE040
    0x0000001C  FFFFBFFF  (???)
    0x00000020  3FFF8000  SWICC     0x00FF8000
    0x00000024  00000000  ANDEQ     R0,R0,R0
    0x00000028  00000000  ANDEQ     R0,R0,R0
    0x0000002C  00000000  ANDEQ     R0,R0,R0
    0x00000030  00000000  ANDEQ     R0,R0,R0
    0x00000034  00000000  ANDEQ     R0,R0,R0
    0x00000038  00000000  ANDEQ     R0,R0,R0
    0x0000003C  00000000  ANDEQ     R0,R0,R0
    

    When I declare safe_buffer as char safe_buffer[0x5900], the Dissassembly window is OK:

    --->0x00000000  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000004  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000008  E59FF018  LDR       PC,[PC,#0x0018]
    0x0000000C  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000010  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000014  B9206E50  STMLTDB   R0!,{R4,R6,R9-R11,R13-R14}
    0x00000018  E51FF120  LDR       PC,[PC,#-0x0120]
    0x0000001C  E59FF018  LDR       PC,[PC,#0x0018]
    0x00000020  00000054  ANDEQ     R0,R0,R4,ASR R0
    0x00000024  00000040  ANDEQ     R0,R0,R0,ASR #32
    0x00000028  40000018  ANDMI     R0,R0,R8,LSL R0
    0x0000002C  00000044  ANDEQ     R0,R0,R4,ASR #32
    0x00000030  00000048  ANDEQ     R0,R0,R8,ASR #32
    0x00000034  00000000  ANDEQ     R0,R0,R0
    0x00000038  0000004C  ANDEQ     R0,R0,R12,ASR #32
    0x0000003C  00000050  ANDEQ     R0,R0,R0,ASR R0
    0x00000040  EAFFFFFE  B         0x00000040
    0x00000044  EAFFFFFE  B         0x00000044
    0x00000048  EAFFFFFE  B         0x00000048
    0x0000004C  EAFFFFFE  B         0x0000004C
    0x00000050  EAFFFFFE  B         0x00000050
    

    Does anyone know what is going on???

    The scatter file is defined as:

    LR_IROM1 0x00003000 0x00080000  {    ; load region size_region
      ER_IROM1 0x00003000 0x00080000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_IRAM1 0x40000040 0x00010000  {  ; RW data
       .ANY (+RW +ZI)
      }
      RW_IRAM2 0x7FE00000 0x00004000  {
       .ANY (+RW +ZI)
      }
      RW_IRAM3 0x7FD00000 0x00004000  {
       .ANY (+RW +ZI)
      }
    }
    

    Regards
    André

Children