There is a second level of Processor Expert initialization PE_low_level_init() called at the beginning of the main() function. PE_low_level_init() function provides initialization of all components in project and it is necessary for proper functionality of the Processor Expert project.
The second level of PE initialization contains:
- Initialization of internal peripherals in the following order; based on settings of the Internal peripherals items in Cpu component
- Initialization of SIM module - except pin muxing. GPIOn clock gate is enabled if it's needed for pin muxing initialization. It is enabled even if it is disabled in Internal peripherals/System Integration Module/Clock gating control in processor component (it will be disabled later).
- Initialization of MCM module.
- Initialization of PMC module if enabled.
- Initialization of FMC module if enabled.
- Initialization of GPIOn modules (pin functional properties drive strength, slew rate except pull resistor and open drain).
- Initialization of the two's complement rounding and enabling saturation according to value of the Common settings/Saturation mode property in the processor component
- Initialization of the shadow registers based on Initialize shadow registers settings in the processor component.
- Common initialization
- Initialization of the pin/signal muxing collected from all components in the project - enabling/disabling of the GPIOn clock gate is ensured automatically.
- Initialization of the interrupt priorities collected from all components except some system interrupts like MCM Core fault PLL Error or PMC Low voltage.
- Initialization of the unused I/O pins based on Initialize unused I/O pins properties in processor component.
- Other initialization originated from some components (for example, Init_GPIO, BitIO,...)
- Disabling of the GPIOn clock gates if it is disabled in Internal peripherals/System Integration Module/Clock gating control in processor component in case it was temporarily enabled (see the first step).
- Initialization of components in a project (typically calling their Init method (for example, Init_ADC, ADC, Init_SPI, SynchroMaster,...).
- Required priority level setup based on Common settings/Initialization priority item in the processor component.
Now, you can do a second level of Processor Expert initialization.