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:

  • 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_.

    This function is assigned to the table of functions executed before PxInit() is called. To execute these functions each main routine should call PxInitializeBeforePxInit() before PxInit() is called.

  • PxuSetCoreMode()

    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 to cpuIndex 5.

  • PxuStartMasterCore()

    Activates the _MASTER_CORE_. If _MASTER_CORE_ and UC_RESET_CORE are different the _MASTER_CORE_ is started. The UC_RESET_CORE enters IDLE state in order to be reactivated by the _MASTER_CORE_ after initialization. PxuStartMasterCore() shall only be executed on the UC_RESET_CORE.

    This must be called in main on the UC_RESET_CORE before calling PxInit().

  • _PxInit_InitMpu() *

    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 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 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.

  • _PxInit_Start_Cores() *

    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 function cpuIndex ranges from 0 to max core, i.e. CORE5 with core ID 6 is mapped by cpuIndex 5.

    This function is called from PxInit() on the startup core to activate all other cores.

* The underscore functions in the Init utility library override the default PXROS-HR kernel implementation to extend their default capability. The Init utility library must precede the PXROS_HR kernel library in the library link to make it work. _PxInit_Start_Cores() is only called in PxInit() function and should not be called outside of this function. _PxInit_InitMpu() is a subroutine of _PxInit_Start_Cores() and should not be called anywhere else.