Specifications

www.ti.com
Standard Initialization Sequence for Hercules Microcontrollers
2 Standard Initialization Sequence for Hercules Microcontrollers
A basic sequence for initialization and configuration of the key features on a Hercules MCU is summarized
below and many steps are detailed in the following sections. The source code example accompanying this
application report demonstrates many of the suggested steps. Some parts of the initialization sequence
are not mandatory. Applications that are non-safety-critical can choose to not use the error correction
coding (ECC) feature for Flash and RAM accesses, for example. Each application must also have its
specific exception handling scheme: reset handler, abort handler, etc. The code generated using
HALCoGen includes template handling routines for each exception. These routines need to be modified as
required by the application.
1. Enable the floating-point unit (FPU) inside the Cortex-R4F CPU (Section 2.1).
2. Initialize the CPU registers and FPU registers, including stack pointers (Section 2.2).
3. Enable the flash interface module's response to an ECC error indicated by the CPU on accesses to
flash (Section 2.3).
4. Enable the CPU's Event Bus export mechanism (Section 2.4).
5. Enable the CPU's Single-Error-Correction Double-Error-Detection (SECDED) logic for accesses to
Flash memory (CPU's ATCM interface) (Section 2.5).
6. Handle the cause of reset to determine whether or not to continue with the start-up sequence
(Section 2.6)
7. Check if any ESM group3 error was indicated during power-up. If any ESM group3 error occurred
during the power-up, it is not safe to continue code execution and the microcontroller initialization
process can be stopped at this point. The subsequent steps in this sequence assume that there was
no ESM group3 error during power-up.
8. Configure PLL control registers with the largest value for the last-stage of the dividers (R-dividers)
(Section 2.7).
9. Enable the Phased-Locked Loops (PLLs) (Section 2.8).
10. Run the eFuse controller start-up checks and start the self-test on the eFuse controller SECDED logic
(Section 2.9).
11. Release the peripherals from reset and enable clocks to all peripherals (Section 2.10).
12. Set up the device-level multiplexing options as well as the input/output (I/O) multiplexing.
13. Wait for the eFuse controller ECC logic self-test to complete and check the results.
14. Set up Flash module for the required wait states and pipelined mode (Section 2.11).
15. Set up Flash bank and pump power modes (Section 2.12).
16. Trim the LPO (Section 2.13).
17. Run the self-test on the SECDED logic embedded inside the Flash module (Section 2.14).
18. Wait for main PLL output to become valid.
19. Map the device clock domains to the desired clock sources (Section 2.15).
20. Reduce the values of the R-dividers in steps to attain the target PLL output frequency for both PLL1
and PLL2.
21. Run a diagnostic check on the CPU self-test controller (Section 2.16). A CPU reset is asserted upon
completion of the CPU self-test. Therefore, the initialization steps leading up to the reset handler will
be repeated.
22. Run the built-in self-test for the CPU (LBIST) (Section 2.17). A CPU reset is asserted upon completion
of the CPU self-test. Therefore, the initialization steps leading up to the reset handler will be repeated.
23. Run a diagnostic check on the CPU compare module (CCM-R4F) (Section 2.18).
24. Run a diagnostic check on the memory self-test controller (Section 2.19).
25. Start a self-test on the CPU RAM using the programmable built-in self-test (PBIST) controller and wait
for this self-test to complete and pass (Section 2.20).
26. Initialize the CPU RAM using the system module hardware initialization mechanism so that the ECC
region for the CPU RAM is also initialized (Section 2.21).
27. Enable the CPU's Single-Error-Correction Double-Error-Detection (SECDED) logic for accesses to
CPU RAM memory (CPU's B0TCM and B1TCM interfaces) (Section 2.22).
3
SPNA106DMay 2013 Initialization of Hercules™ ARM
®
Cortex™-R4F Microcontrollers
Submit Documentation Feedback
Copyright © 2013, Texas Instruments Incorporated