API overview
The Init utility 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 Init utility library routines:
-
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_
.This function is assigned to the table of functions executed before
PxInit()
is called. To execute these functions each main routine should callPxInitializeBeforePxInit()
beforePxInit()
is called. -
Sets the mode of the requested core to IDLE or RUN. If the requested core is in HALT state, the Program Counter of the core is initialized to the requested start address and the core is activated. In this function
cpuIndex
ranges from 0 to max core, i.e. CORE5 with core ID 6 is mapped tocpuIndex
5. -
Activates the
_MASTER_CORE_
. If_MASTER_CORE_
andUC_RESET_CORE
are different the_MASTER_CORE_
is started. TheUC_RESET_CORE
enters IDLE state in order to be reactivated by the_MASTER_CORE_
after initialization.PxuStartMasterCore()
shall only be executed on theUC_RESET_CORE
.This must be called in main on the
UC_RESET_CORE
before callingPxInit()
. -
If the SP-bit in the COMPAT-Register is cleared (Safety EndInit protection enabled),
_PxInit_InitMpu()
initializes the MPU of the requested core from the specification inPxInitSpec
. The SYSCON register of the core is set to:-
PROTEN - Memory Protection enabled
-
U1_IED - User-1 instruction execution disable. The User-1 task’s ability to disable and enable interrupts is disabled.
This function is used by
_PxInit_Start_Cores()
to initialize the memory protection of the core to start.
-
-
If the SYSCON register is Safety Endinit protected, all other CPUs are started with protection enabled. Therefore, the function
_PxInit_InitMpu()
is called to initialize the MPU of the core to start. In this functioncpuIndex
ranges from 0 to max core, i.e. CORE5 with core ID 6 is mapped bycpuIndex
5.This function is called from
PxInit()
on the startup core to activate all other cores.