You copied the Doc URL to your clipboard.

Scatter-loading images with a simple memory map

For images with a simple memory map, you can specify the memory map using only linker command-line options, or with a scatter file.

If an image has a simple memory map, you can either:

  • Use a scatter file.

  • Specify the memory map using basic linker command-line options.

The following figure shows a simple memory map:

Figure 6. Simple scatter-loaded memory map

Figure 6. Simple scatter-loaded memory map

The following example shows the corresponding scatter-loading description that loads the segments from the object file into memory:

LOAD_ROM 0x0000 0x8000       ; Name of load region (LOAD_ROM),
                             ; Start address for load region (0x0000),
                             ; Maximum size of load region (0x8000)
    EXEC_ROM 0x0000 0x8000   ; Name of first exec region (EXEC_ROM),
                             ; Start address for exec region (0x0000),
                             ; Maximum size of first exec region (0x8000)
        * (+RO)              ; Place all code and RO data into
                             ; this exec region

    SRAM 0x10000 0x6000      ; Name of second exec region (RAM),
                             ; Start address of second exec region (0x10000),
                             ; Maximum size of second exec region (0x6000)
        * (+RW, +ZI)         ; Place all RW and ZI data into
                             ; this exec region

The maximum size specifications for the regions are optional. However, if you include them, they enable the linker to check that a region does not overflow its boundary.

In this example, you can achieve the same result, apart from the limit checking with the following linker command-line:

armlink --ro_base 0x0 --rw_base 0x10000

Was this page helpful? Yes No