PXROS-HR Utilities
The PXROS-HR installation package provides the user with a set of supporting functions for kernel initialization. The user can see the full source code in folder utilities\src\init-utility and project can include the binary library directly utilities\lib\tc16x\libinittcx.a.
PxuSetCompareMode()
The HXROS-HR kernel configures the MPU protection during each context switch, and it gives the particular access rights to each task. The SYSCON register controls the functionality of the MPU unit, and it can enable/disable the MPU functionality. By default, the microcontroller keeps the compatibility mode enabled where the Safety ENDINIT protection does not cover the SYSCON register in this mode. The after reset state brings the risk that a task with without rights or non-master core can disable the MPU protected ranges. Therefore the compatibility must be disabled explicitly in user safety application.
The function 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.
The MASTER_CORE can only execute the PxuSetCompatMode.
...
PxuSetCompatMode();
...
PxuStartMasterCore()
In the safety environment, the master core needs the lockstep safety mechanism. For TC29x, the CPU1 supports the lockstep, therefore it must start the initialization of the kernel.
The function PxuStartMasterCore activates the master core. If the master and reset core are not the same, the function starts the master CPU. The startup core enters the idle state to be reactivated by the master core after initialization.
PxuStartMasterCore shall be executed on the reset core CPU0 only.
...
case UC_CORE_MAIN_0:
/* Checks the master core configuration, run the PxInit from
* master core first*/
error = PxuStartMasterCore(InitSpecsArray, UC_NB_CORES);
...