Skip to content

Commit

Permalink
Core(M): Describe scatter file templates. (#1376)
Browse files Browse the repository at this point in the history
* Core(M): Describe scatter file templates.

* Core(M): Describe scatter file templates.
- review changes.
  • Loading branch information
Martin Günther authored Feb 8, 2022
1 parent 559d58c commit 11ff706
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions CMSIS/DoxyGen/Core/src/Template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ The template files contain place holders:
The device configuration of the template files is described in detail on the following pages:
- \subpage startup_c_pg
- \subpage startup_s_pg (deprecated)
- \subpage linker_sct_pg
- \subpage system_c_pg
- \subpage device_h_pg
\if ARMv8M
Expand Down Expand Up @@ -377,6 +378,71 @@ The files for other compiler vendors differ slightly in the syntax, but not in t
\verbinclude "Source/ARM/startup_Device_ac6.S"
*/

/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/**
\page linker_sct_pg Scatter-Loading description file <device>_ac<5|6>.sct

A scatter file for linking is required when using a \ref startup_c_pg "C startup file".

The \ref linker_sct_pg contains regions for:
- Code (read-only data, execute-only data)
- RAM (read/write data, zero-initialized data)
- Stack
- Heap
- Stack seal (Armv8-M/v8.1-M)
- CMSE veneer (Armv8-M/v8.1-M)

Within the scatter file, the user needs to specify a set of macros. The scatter file is passed through the
C preprocessor which uses these macros to calculate the start address and the size of the different regions.

\code
/*--------------------- Flash Configuration ----------------------------------
; <h> Flash Configuration
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
*----------------------------------------------------------------------------*/
#define __ROM_BASE 0x00000000
#define __ROM_SIZE 0x00080000

/*--------------------- Embedded RAM Configuration ---------------------------
; <h> RAM Configuration
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
*----------------------------------------------------------------------------*/
#define __RAM_BASE 0x20000000
#define __RAM_SIZE 0x00040000

/*--------------------- Stack / Heap Configuration ---------------------------
; <h> Stack / Heap Configuration
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
*----------------------------------------------------------------------------*/
#define __STACK_SIZE 0x00000200
#define __HEAP_SIZE 0x00000C00

/*--------------------- CMSE Venner Configuration ---------------------------
; <h> CMSE Venner Configuration
; <o0> CMSE Venner Size (in Bytes) <0x0-0xFFFFFFFF:32>
; </h>
*----------------------------------------------------------------------------*/
#define __CMSEVENEER_SIZE 0x200
\endcode

\note
The stack is placed at the end of the available RAM and is growing downwards
whereas the Heap is placed after the application data and growing upwards.

\section linker_sct_preproc_sec Preprocessor command
The scatter file uses different preprocessor commands for Arm Compiler V6 and Arm Compiler V5
- \b AC6: #! armclang -E --target=arm-arm-none-eabi -mcpu=&lt;mcpu&gt; -xc
- \b AC5: #! armcc -E

*/


/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/**
\page system_c_pg System Configuration Files system_<device>.c and system_<device>.h
Expand Down

0 comments on commit 11ff706

Please sign in to comment.