Provides device startup, system configuration, and linker script files.
The system startup provides the followings features:
The flash and RAM allocation is defined by the linker scripts.
ARM GCC
The flash and RAM sections for the CPU are defined in the linker file: for example, 'cy8c4xx5.ld'.
Change the flash and RAM sizes by editing the macros value in the linker file:
ARM MDK
The flash and RAM sections for the CPU are defined in the linker file: for example, 'cy8c4xx5.sct'.
Change the flash and RAM sizes by editing the macros value in the linker file:
IAR
The flash and RAM sections for the CPU are defined in the linker files: for example, 'cy8c4xx5.icf'.
Change the flash and RAM sizes by editing the macros value in the linker file:
After a power-on-reset (POR), the boot process is handled by the boot code from the on-chip ROM that is always executed by the core. The boot code passes the control to the startup code located in flash.
The startup code performs the device initialization by a call to Reset_Handler(), which calls SystemInit(), and then calls the CMSIS-defined __PROGRAM_START().
The heap and stack configurations are defined by the linker scripts.
By default, the stack size is set to 0x0000400 and the heap size is allocated dynamically to the whole available free memory up to stack memory and it is set to the 0x00000080 (for ARM GCC and IAR compilers) as minimal value.
Change the heap and stack sizes by editing the macros value in the linker file: ARM GCC
ARM MDK
IAR
The default interrupt handler functions are defined as weak functions to a dummy handler in the startup file. The naming convention for the interrupt handler names is <interrupt_name>_IRQHandler. A default interrupt handler can be overwritten in user code by defining the handler function using the same name. For example:
This process uses memory sections defined in the linker script. The vector table address (and the vector table itself) is defined in the startup files (e.g. startup_psoc4100sp.c). The code in these files defines the Reset_Handler, represents __VECTOR_TABLE as vector table in Flash and __RAM_VECTOR_TABLE represents this table in RAM.
The vector table is copied from Flash to RAM in Reset_Handler using memcpy().
The startup driver has the following specific deviations:
MISRA Rule | Rule Class (Required/Advisory) | Rule Description | Description of Deviation(s) |
---|---|---|---|
20.1 | A | #include directives should only be preceded by preprocessor directives or comments. | The include directives are in generated files. These files should not be changed manually. |
Version | Changes | Reason for Change |
---|---|---|
1.0 | Initial version |
API Reference | |
Functions | |
Global Variables | |