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

Determing Image Size Post Compilation

Hello All,

I am working on STM32F4 series & using Keiluvision4 as my IDE.
In the startup file of my project i am reserving 4bytes space just after the vector table in the flash that would hold the Image size of that project.

I am reserving 4byte space at 0x08000200 using SPACE directive

Now I want that when I compile this project then the Image size of the project will be written to the reserved space(0x08000200) in flash.

I don't want to use the .map file for determining the Image size.

Thanks,
Amit

Parents
  • Seems like an odd approach, there are unused vector entries that would suffice without carving out space in the middle of a code region.

    Well you could post-process the AXF/ELF file, or use some AWK script against the .MAP file, it's not like you have to do such things manually.

    On an ARM9 platform I used something like this to force the Linker to fix up it's own internal sizes into a know location.

      IMPORT  ||Image$$ER_IROM1$$RO$$Length||
      IMPORT  ||Image$$RW_IRAM1$$RW$$Length||
    ...
      DCD ||Image$$ER_IROM1$$RO$$Length||+\ 
          ||Image$$RW_IRAM1$$RW$$Length||
    

Reply
  • Seems like an odd approach, there are unused vector entries that would suffice without carving out space in the middle of a code region.

    Well you could post-process the AXF/ELF file, or use some AWK script against the .MAP file, it's not like you have to do such things manually.

    On an ARM9 platform I used something like this to force the Linker to fix up it's own internal sizes into a know location.

      IMPORT  ||Image$$ER_IROM1$$RO$$Length||
      IMPORT  ||Image$$RW_IRAM1$$RW$$Length||
    ...
      DCD ||Image$$ER_IROM1$$RO$$Length||+\ 
          ||Image$$RW_IRAM1$$RW$$Length||
    

Children