|Non-Confidential||PDF version||ARM 100400_0001_03_en|
|Home > Functional Description > Clocking, resets, and initialization > Initialization|
Most of the architectural registers in the Cortex®‑R8 processor, such as r0-r14, and s0-s31 and d0-d15 when floating-point is included, have an unknown value after reset. Therefore, you must initialize these registers for all modes before they are used, using an immediate-MOV instruction, or a PC-relative load instruction.
The Current Program Status Register (CPSR) is given a known value on reset. This is described in the ARM® Architecture Reference Manual ARMv7‑A and ARMv7‑R edition.
In addition, before you run an application, you might want to:
Before you can use the MPU you must program and enable at least one of the regions, and enable the MPU in the SCTLR.
Do not enable the MPU unless at least one MPU region is programmed and active. If the MPU is enabled, before using the TCM interfaces you must program MPU regions to cover the TCM regions to give access permissions to them.
If the Cortex®‑R8 processor has been built with an FPU, you must enable it before Vector Floating Point (VFP) instructions can be executed.
Enable the FPU as follows:
If the Cortex®‑R8 processor has been built with instruction or data caches, they must be invalidated before they are enabled, otherwise unpredictable behavior can occur.
An invalidate all operation never reports any ECC errors.
The Cortex®‑R8 processor does not initialize the TCM RAMs, so you must initialize all the TCMs. In addition, you might want to preload instructions or data into the TCM for the main application to use. This section describes various ways that you can perform data preloading. You can also configure the Cortex‑R8 processor to use the TCMs from reset.
You can write data to the TCMs using either store instructions or the AXI3 TCM slave interface.
Depending on the method you choose, you might require:
Methods to preload TCMs include:
The error code bits in the TCM RAM, if configured with an error scheme, are not initialized by the Cortex®‑R8 processor. Before a RAM location is read with ECC enabled, the error code bits must be initialized. To calculate the error code bits correctly, the logic must have all the data in the data chunk that those bits protect. Therefore, when the TCM is being initialized, the writes must be of the same width and aligned to the data chunk that the error scheme protects.
You can initialize the TCM RAM with error checking turned on or off, according to the following rules. You can use the ITCMECCEN signal to enable the ITCM when leaving reset.
If the slave port is used, for TCM memory accesses, the transactions must start at a 32-bit aligned address for data or 64-bit aligned address for instructions, and read or write a continuous block of memory, containing a multiple of 4 bytes for data or 8 bytes for instruction. All bytes in the block must be written, that is, have their byte lane strobe asserted.
If initialization is done by running code on the Cortex‑R8 processor, this is best done by a loop of stores that write to the whole of the TCM memory as follows:
STRinstructions, enable strict-alignment-checking by setting the A-bit in the System Control Register.
You can pin-configure the Cortex®‑R8 processor to enable the TCM interfaces from reset and to select the address at which each TCM appears from reset. This enables you to configure the processor to boot from TCM but, to do this, the TCM must first be preloaded with the boot code.
The nCPUHALT input can be asserted while the processor is in reset to prevent the processor from fetching and executing instructions after coming out of reset. While the processor is halted in this way, the TCMs can be preloaded with the appropriate data. When the nCPUHALT input is deasserted, the processor starts fetching instructions from the reset vector address in the normal way.
When nCPUHALT has been deasserted to start the processor fetching, it must not be asserted again except when the processor is under processor or power up reset.