You copied the Doc URL to your clipboard.

Images with a simple memory map

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:

To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.

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