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

Scatter files and initialization of RAM data

Dear all,

I am using the scatter file below in my uVision project (microcontroller: STM32F105). The purpose of this scatter file is to reserve the section ER_ROM1 for the application and sections ER_ROM2...ER_ROM10 for storage of data. The application can erase/rewrite the data in these sections and thus no code or initialization data may be placed in these sections.
However, using this scatter file results in the fact that the initialization data for the RW-data in the RW_RAM1 section is placed inside the ER_ROM9 section (of which I cannot find any references to in the .map file. Does anyone know how to force the initialization data of the RAM section to be placed in ER_ROM1? I found that one way to achive this, is to place the RW_RAM1 section definition directly after ER_ROM1 and before ER_ROM2 in the scatter file. But what if the application or initialization data gets so big, that it will not completely fit inside section ER_ROM1 anymore? I fear that I will not get a error/warning, as I would like, but that the initialization data is placed in one of the ER_ROM2...ER_ROM9 sections.

Thanks for any help given!

Kind regards,

Alex

; Load region for internal ROM
LR_IROM1 0x08008000 0x00038000
{    ; load region size_region
  ER_IROM1 0x08008000 FIXED 0x00034000
  {  ; load address = execution address
     ; This section is used for the application
     ; section
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }

  ; The following sections are used to store data.
  ER_IROM2 0x0803C000 FIXED 0x00000800
  {  ; Space used for the storage of the application type
    flashdata.o(SYSTEM_SETTINGS)
  }
  ER_IROM3 0x0803C800 FIXED 0x00000800
  {  ; Space used for the storage of the customer default settings
    flashdata.o(CUSTOMER_DEFAULT_SETTINGS)
  }
  ER_IROM4 0x0803D000 FIXED 0x00000800
  {     ; Space used for the factory default for the ignition application
    flashdata.o(FACTORY_DEFAULT_SETTINGS_APP_IGNITION)
  }
  ER_IROM5 0x0803D800 FIXED 0x00000800
  {     ; Space used for the factory default for the neutral application
    flashdata.o(FACTORY_DEFAULT_SETTINGS_APP_NEUTRAL)
  }
  ER_IROM6 0x0803E000 FIXED 0x00000800
  {     ; Space used for the factory default for the stationary application
    flashdata.o(FACTORY_DEFAULT_SETTINGS_APP_STATIONARY)
  }
  ER_IROM7 0x0803E800 FIXED 0x00000800
  {     ; Space used for the factory default the standard OEM application
    flashdata.o(FACTORY_DEFAULT_SETTINGS_APP_OEM_STANDARD)
  }
  ER_IROM8 0x0803F000 FIXED 0x00000800
  {     ; Space used for the factory data, such as serial number and production date
    flashdata.o(FACTORY_DATA)
  }
  ER_IROM9 0x0803F800 FIXED 0x00000800
  {     ; Space used for the storage of the user strings en other user data
    flashdata.o(USER_DATA)
  }

  RW_IRAM1 0x20000000 0x00010000
  {  ; RW data
    .ANY (+RW +ZI)
  }
}