Key Elements
Several elements play a vital role in the multicore startup process of the PXROS-HR operating system. Their combination determines the startup flow together with a selection of optional libraries providing the corresponding implementation.
AURIX MPU compatibility mode (MPU-COMPAT)
AURIX architecture introduces additional protection against an unintended modification of selected critical registers through a so-called Safety Watchdog EndInit protection where the write access to these registers requires a particular Unlock-Modify-Lock sequence in the hardware Safety Watchdog module. This sequence represents a potential issue in a multicore environment.
The AURIX architecture contains the COMPAT register, allowing to disable the Safety Watchdog EndInit Protection of critical registers to keep backward compatibility with older TriCore architectures.
The compatibility mode has an impact on multicore PXROS-HR operating system because it controls the protection level for the core’s MPU enable-disable bit in SYSCON register that belongs among such critical registers.
MPU Compatibility ON (MPU-COMPAT=ON)
-
The MPU enable/disable operation in SYSCON register is not under Safety Watchdog EndInit Protection
-
The PXROS-HR startup does not need to access Safety Watchdog module
-
Each PXROS-HR kernel instance enables its core MPU system independently
MPU Compatibility OFF (MPU-COMPAT=OFF)
-
Core’s MPU enable/disable in SYSCON register needs Safety Watchdog EndInit Protection handling
-
Only one core shall control the Safety Watchdog module
-
Only one core shall enable MPU system on all other cores
AURIX Core Execution state
The core in AURIX architecture can be in different states during the microcontroller runtime.
-
By default, there is one active core after the hardware reset, the other inactive cores are in the HALT mode. Once the core leaves HALT mode, it cannot enter it again until the next reset.
-
Active cores are in the RUN state where they execute the code.
-
Due to various reasons, the active state can be switched to the IDLE state in which the core does not execute any code and waits for its activation.
PXROS-HR Master Core
The PXROS-HR configuration requires a definition of MASTER_CORE symbol controlling:
-
which core starts other inactive cores
-
which core handles Safety Watchdog module
-
which core configures and enables MPU protection of inactive cores before starting them in case of disabled MPU compatibility (MPU-COMPAT = OFF).
PXROS-HR kernel startup routines
The PXROS-HR kernel supports only a limited startup variant:
-
The kernel supports only MASTER_CORE=0, which is the reset core in AURIX architecture.
-
The kernel can activate another core only from the HALT state.
-
The kernel supports both MPU Compatibility modes
Other startup scenarios, like to start the PXROS-HR initialization from a different MASTER_CORE or to activate inactive cores being in IDLE mode, require user-specific implementation.
PXROS-HR Init Utility Library
The inittcx library is part of the utility package distributed within the PXROS-HR install package and contains supportive hardware related routines to help the user with other startup variants than the one implemented in the PXROS-HR kernel.
The inittcx library routines:
PxuSetCompatMode-
PxuSetCompatMode clears the bits RM and SP in the COMPAT register to disable the TC-V1.3 compatible behavior. In this mode, the fields PSW.RM of the PSW register are not restored on RET and the SYSCON registers of all cores are safety EndInit protected. PxuSetCompatMode is only executed on the MASTER_CORE.
PxuSetCoreMode-
PxuSetCoreMode sets the mode of the requested core to IDLE or RUN. If the requested core is in HALT state, the PC of the core is initialized to the requested start address and the core is activated.
PxuStartMasterCore-
PxuStartMasterCore activates the MASTER core. If the MASTER and STARTUP core is different, the master core is started. The startup core enters the IDLE state to be reactivated by the MASTER core after initialization. PxuStartMasterCore shall only be executed on the STARTUP core 0.
_PxInit_Start_Cores-
If the SYSCON register is safety EndInit protected, all other CPUs are started with protection enabled. Therefore the function
_PxInit_InitMpuis called to initialize the MPU of the core to start. _PxInit_InitMpu-
If the SP-bit in the COMPAT-Register is cleared, _PxInit_InitMpu initializes the MPU of the requested core from the specification in PxInitSpec. The SYSCON register of the core is set to:
-
PROTEN - Memory Protection enabled
-
U1_IED - User-1 instruction execution disable. The User-1 tasks ability to disable and enable interrupts is disabled.
-
NOTE: The underscore functions in the inittcx library override the default PXROS-HR kernel implementation to extend their default capability. The inittcx library must precede the PXROS_HR kernel library in the library link to make it work.