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

ID string in a flash

Hello,

I need to put an ID string (file name and version) at a particular address in a flash, so the programming application can read it from a hex / binary file.
I can probably use a scatter file, but is there any simpler solution ?

Cortex-M3 STM32F107
MDK-ARM 4.12

thank you,
Gennady

Parents
  • I tried to follow the procedure suggested by Pontus Thuvesson in
    http://www.keil.com/forum/docs/thread16466.asp

    That is what I did:
    in a main:

    #pragma arm section rodata = "codeEnd"
    const uint8_t metadata[19] = {'J','0','0','_','1,'1',1, 3,57,0x08,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x55};

    ===================
    then I edited the scatter file to this:

    ; *************************************************************
    ; *** Scatter-Loading Description File generated by uVision ***
    ; *************************************************************
    
    LR_IROM1 0x08000000 0x00020000  {    ; load region size_region
      ER_IROM1 0x08000000 0x00020000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
       *.o(codeEnd, +Last)
      }
      RW_IRAM1 0x20000000 0x0000C000  {  ; RW data
       .ANY (+RW +ZI)
      }
    }
    

    and unchecked 'used memory layout from a target dialog'.

    Nevertheless the metadata[] array does not appear at the end of a program. Is there anything i did wrong ? or haven't done ?

Reply
  • I tried to follow the procedure suggested by Pontus Thuvesson in
    http://www.keil.com/forum/docs/thread16466.asp

    That is what I did:
    in a main:

    #pragma arm section rodata = "codeEnd"
    const uint8_t metadata[19] = {'J','0','0','_','1,'1',1, 3,57,0x08,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x55};

    ===================
    then I edited the scatter file to this:

    ; *************************************************************
    ; *** Scatter-Loading Description File generated by uVision ***
    ; *************************************************************
    
    LR_IROM1 0x08000000 0x00020000  {    ; load region size_region
      ER_IROM1 0x08000000 0x00020000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
       *.o(codeEnd, +Last)
      }
      RW_IRAM1 0x20000000 0x0000C000  {  ; RW data
       .ANY (+RW +ZI)
      }
    }
    

    and unchecked 'used memory layout from a target dialog'.

    Nevertheless the metadata[] array does not appear at the end of a program. Is there anything i did wrong ? or haven't done ?

Children