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
COMPATregister to disable the TC-V1.3 compatible behavior. In this mode the fieldsPSW.RMof thePSWregister are not restored onRETand theSYSCONregisters of all cores areSafety Endinitprotected.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
cpuIndexranges from 0 to max core, i.e. CORE5 with core ID 6 is mapped tocpuIndex5. -
Activates the
_MASTER_CORE_. If_MASTER_CORE_andUC_RESET_COREare different the_MASTER_CORE_is started. TheUC_RESET_COREenters 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_COREbefore callingPxInit(). -
If the SP-bit in the
COMPAT-Registeris cleared (Safety EndInitprotection enabled),_PxInit_InitMpu()initializes the MPU of the requested core from the specification inPxInitSpec. TheSYSCONregister 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
SYSCONregister isSafety Endinitprotected, 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 functioncpuIndexranges from 0 to max core, i.e. CORE5 with core ID 6 is mapped bycpuIndex5.This function is called from
PxInit()on the startup core to activate all other cores.