ST AN1777 Application note

AN1777
APPLICATION NOTE
STR71x MEMORY MAPPING
AND DEVELOPMENT TOOLSET

INTRODUCTION

A major consideration in the design of STR71 applications is the layout of the memory map.
Rev. 1.1
AN1777/0304 1/7
1
STR71x MEMORY MAPPING AND DEVELOPMENT TOOLSET

1 USING SCATTER FILES FOR IMAGE ORGANIZATION IN MEMORY

This paragraph describes how to place and organize the data and code in memory. It focuses on the use of the scatter-loading file for the RealView toolset.
An image is made up of regions and output sections. Every region in the image can have a dif­ferent load and execution address. The scatter-loading mechanism enables you to specify the memory map of an image to armlink. For more information on the scatter file, load and execu­tion regions, please refer to ’ARM Linker and Utilities Guide’.
Following reset, the processor starts to fetch instructions from the reset vector at the address 0x00000000. This instruction should transfer control to the initialization code. The entry point must lie within an execution region that must be a root region. For this reason, the vector and initialization routines must always be present at the address 0x00000000.
Different types of memory are present in our system so different mappings can be used de­pending on the boot mechanism. For further information on boot modes, refer to the STR71 datasheet.
The following table explains the use of the different scatter loading files.
Table 1. Scatter file use
Scatter File Boot mode
71x_armr Booting from RAM 71x_arme Booting from External Memory 71x_armf Booting from Embedded Flash

1.1 BOOTING FROM RAM

On power-up the RAM is located at address 0x00000000. The first section is a root region made up of the vector and initialization routines.
The contents and the organization of the scatter loading description file are shown below.
RAM_MODE 0x20000000 0x10000 ; Load region starts at the real RAM address {
RAM 0x20000000 ; Startup exec region address is the same as the { ; load address (root region)
71x_vect.o (Vect, +First); - Section containing the entry point 71x_init.o (Init) ; - Section containing the init routines * (+RO) ; - The code and the read only data are placed
* (+RW) ; - The read/write data (variables) * (+ZI) ; - The zero initialized region is placed after
} ; the read/write data
}
; after the init routine
2/7
2
STR71x MEMORY MAPPING AND DEVELOPMENT TOOLSET

1.2 BOOTING FROM EXTERNAL MEMORY

On power-up the external memory bank 0 is aliased at address 0x00000000. The contents and organization of the scatter loading description file are shown below.
EXTMEM 0x60000000 0x400000; Load region starts at the real EMI address {
EXTMEM 0x60000000 ; Startup exec region address is the same as the { ; load address (root region)
71x_vect.o (Vect, +First); - Section containing the entry point 71x_init.o (Init) ; - Section containing the init routines
* (+RO) ; - The code and the read only data are placed } ; after the init routine RAM 0x20000000 ; A second exec region placed in the internal RAM that { ; contains the Read/Write data and the zero
* (+RW) ; initialized region.
* (+ZI) }
}
or
EXTMEM 0x60000000 0x400000 ; Load region starts at the real EMI address {
EXTMEM 0x60000000 ; Startup exec region address is the same as the { ; load address (root region)
71x_vect.o (Vect, +First); - Section containing the entry point
71x_init.o (Init) ; - Section containing the init routines
* (+RO) ; - The code and the read only data are placed } ; after the init routine RAM 0x62000000 ; A second exec region placed in the external { ; SRAM that contains the Read/Write data and
* (+RW) ; the zero initialized region.
* (+ZI) }
}

1.3 BOOTING FROM EMBEDDED FLASH

On power-up the flash is aliased at address 0x00000000. The contents and organization of the scatter loading description file are shown below.
FLASH 0x40000000 0x40000 ; Load region starts at the real FLASH address {
FLASH 0x40000000 ; Startup exec region address is the same as the { ; load address (root region)
71x_vect.o (Vect, +First); - Section containing the entry point
71x_init.o (Init) ; - Section containing the init routines
* (+RO) ; - The code and the read only data are placed } ; after the init routine RAM 0x20000000 ; A second exec region placed in the internal RAM that { ; contains the Read/Write data and the zero
* (+RW) ; initialized region.
* (+ZI) }
}
or
FLASH 0x40000000 0x40000 ; Load region starts at the real FLASH address {
EXTMEM 0x40000000 ; Startup exec region address is the same as the { ; load address (root region)
71x_vect.o (Vect, +First); - Section containing the entry point
3/7
Loading...
+ 4 hidden pages