|Home > Scatter-loading Features > The scatter-loading mechanism > When to use scatter-loading|
Scatter-loading is usually required for implementing embedded systems because these use ROM, RAM, and memory-mapped peripherals.
Situations where scatter-loading is either required or very useful:
Code and data that must be placed into many distinct areas of memory require detailed instructions on where to place the sections in the memory space.
Many systems contain a variety of physical memory devices such as flash, ROM, SDRAM, and fast SRAM. A scatter-loading description can match the code and data with the most appropriate type of memory. For example, interrupt code might be placed into fast SRAM to improve interrupt response time but infrequently-used configuration information might be placed into slower flash memory.
The scatter-loading description can place a data section at a precise address in the memory map so that memory mapped peripherals can be accessed.
A function can be placed at the same location in memory even though the surrounding application has been modified and recompiled. This is useful for jump table implementation.
Symbols can be defined for the heap and stack location when the application is linked.