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

ARM: using linker region-related symbols in runtime code

Hello,

I am having some trouble working with the Keil ARM RealView linker region related symbols, for example Load$$<region>$$Base.

What I am attempting to do is create a build tool and an embedded runtime process to verify the “rom”’s crc. I had planned to use the generated .hex file, compute crc over its contents, and insert an additional record that contains the computed crc. Once .hex file is programmed on the target, then target will compute crc and compare with the programmed crc.

My code uses the standard Keil scatter loading mechanism, with regions LR_IROM1, ER_IROM1 and RW_IRAM1.

My problem is that embedded runtime process needs to compute the addresses to iterate when computing the crc on the target.

The Image$$ER_IROM1$$Length is shorter than what is actually in the .hex file.

When I look closely at the .map file I see that a subset of the RW DATA data appears to be in the .hex file following the end of the ER_IROM1 region, but cannot seem to identify the proper combinations of the linker region related symbols that will give me the exact number of bytes for the subset of that RW DATA data, I can get the whole RW DATA data but not the subset. For example looking at the .map the whole amount is 776 but the subset of it in ROM is only 136. I want to compute the 136 at runtime using the linker region related symbols.

Any suggestions?

Thanks,
Mlk

  • Sorry the HTML got me, lets try again:

    Image$$ER_IROM1$$Base
    

    Is what the linker region related symbols look like.

  • To make the above clearer, I looked at the map again, see portion here:

    Memory Map of the image
    
      Image Entry point : 0x08000131
    
      Load Region LR_IROM1 (Base: 0x08000000, Size: 0x00020f2c, Max: 0x00040000, ABSOLUTE, COMPRESSED[0x00020cac])
    
        Execution Region ER_IROM1 (Base: 0x08000000, Size: 0x00020c24, Max: 0x00040000, ABSOLUTE)
    
        Execution Region RW_IRAM1 (Base: 0x20000000, Size: 0x0000cb18, Max: 0x00010000, ABSOLUTE, COMPRESSED[0x00000088])
    

    Notice the "COMPRESSED" values.

    0x00020c24 + 0x00000088 = the number of bytes written by the .hex file.

    I was looking for a way to use the linker region related symbols to help me compute the lenght of memory for my target to compute the crc over.

    Assuming that no one comes up with a way to do this, I have thought that I could simply compute BOTH the crc and the length on the development system and insert them both into the hex file, then the target does not have to compute the length, just to use the length that was previously computed on the development system.