NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Functions

STM_API stmErrorCode_t stmScheduleManagerInit ()
 Initialize STM schedule manager context. More...
 
STM_API stmErrorCode_t stmScheduleManagerInitWithDiscriminator (int32_t discriminator)
 Initialize STM schedule manager context with a discriminator. More...
 
STM_API stmErrorCode_t stmScheduleManagerExitScheduler (void)
 Set STM to the EXIT state. More...
 
STM_API stmErrorCode_t stmScheduleManagerExit (void)
 Cleans up STM schedule Manager context. More...
 
STM_API stmErrorCode_t stmStartSchedule (uint16_t scheduleId)
 Schedule Management API for starting Schedule Execution. More...
 
STM_API stmErrorCode_t stmStopSchedule (uint16_t scheduleId)
 Schedule Management API for stopping Schedule Execution. More...
 
STM_API stmErrorCode_t stmRollOverSchedule (uint16_t startScheduleId, uint16_t stopScheduleId)
 Schedule Management API for stopping current Schedule Execution and starting a new one in a per-hyperepoch fashion to minimize deadtime. More...
 
STM_API stmErrorCode_t stmCheckSchedulerRunning (bool *isRunning, uint16_t *scheduleId)
 Get the current state of the scheduler and the schedule ID. More...
 

Function Documentation

◆ stmCheckSchedulerRunning()

STM_API stmErrorCode_t stmCheckSchedulerRunning ( bool *  isRunning,
uint16_t *  scheduleId 
)

Get the current state of the scheduler and the schedule ID.

Remarks
This API must be called between stmScheduleManagerInit()/stmScheduleManagerInitWithDiscriminator() and stmScheduleManagerExit(). This API is thread-safe.
Parameters
[out]isRunningPointer to a boolean to store the running state.
[out]scheduleIdPointer to a uint16_t to store the schedule ID. Note this has no meaning if isRunning is false.
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
  • STM_ERROR_BAD_PARAMETER if isRunning or scheduleId is NULL.

◆ stmRollOverSchedule()

STM_API stmErrorCode_t stmRollOverSchedule ( uint16_t  startScheduleId,
uint16_t  stopScheduleId 
)

Schedule Management API for stopping current Schedule Execution and starting a new one in a per-hyperepoch fashion to minimize deadtime.

Remarks
This API must be called between stmScheduleManagerInit()/stmScheduleManagerInitWithDiscriminator() and stmScheduleManagerExit() The schedules corresponding to startScheduleId and stopScheduleId must have the same number of hyperepochs and the same resource partitioning across hyperepochs. This API is thread-safe.
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
  • STM_ERROR_BAD_STATE_TRANSITION : If current state is not READY
  • STM_ERROR_BAD_VALUE : if format of state messages are incorrect.
  • STM_ERROR_INSUFFICIENT_MEMORY : if malloc failure happened.
  • STM_ERROR_GENERIC : if message send/receive fails.

◆ stmScheduleManagerExit()

STM_API stmErrorCode_t stmScheduleManagerExit ( void  )

Cleans up STM schedule Manager context.

No STM APIs can be called after this unless init apis are called again

See also
stmScheduleManagerExitScheduler for exit sequence discussion.
Remarks
This API can only be called once per call to stmScheduleManagerInit(); doing so multiple times will cause undefined behavior. This API is thread-safe.
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
  • STM_ERROR_GENERIC if fail to release some OS resources. check debug logs for further information

◆ stmScheduleManagerExitScheduler()

STM_API stmErrorCode_t stmScheduleManagerExitScheduler ( void  )

Set STM to the EXIT state.

This API may be used before stmScheduleManagerExit to allow the clients to exit without yet destroying the STM Schedule Manager context. After this API, only stmScheduleManagerExit may be called.

Remarks
This API is optional; If it is not called by the user before stmScheduleManagerExit, it will effectively be called by stmScheduleManagerExit. This API is thread-safe.
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
    • STM_ERROR_GENERIC if the scheduler failed to exit. Check debug logs for further information.

◆ stmScheduleManagerInit()

STM_API stmErrorCode_t stmScheduleManagerInit ( )

Initialize STM schedule manager context.

Remarks
This API must be called before any other STM Schedule Management APIs. This API will block until the STM master process is started. Manager's context should be cleaned up with stmScheduleManagerExit() after STM has completed its execution. There is only one schedule manager in the system. This API is thread-safe.
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_INSUFFICIENT_MEMORY : failure of memory allocation of STM.
  • STM_ERROR_BAD_VALUE : unsupported value for discriminator.
  • STM_ERROR_NOT_SUPPORTED : connection to master not enabled. ignore this error for dual SOC case and soc is secondary
  • STM_ERROR_GENERIC : Failed to receive messages from master.

◆ stmScheduleManagerInitWithDiscriminator()

STM_API stmErrorCode_t stmScheduleManagerInitWithDiscriminator ( int32_t  discriminator)

Initialize STM schedule manager context with a discriminator.

Remarks
This API must be called before any other STM Schedule Management APIs. This API will block until the STM master process with this discriminator is started. Manager's context should be cleaned up with stmScheduleManagerExit() after STM has completed its execution. This API is thread-safe. Manager must call at most one of the two: stmScheduleManagerInit() or stmScheduleManagerInitWithDiscriminator(), if both are called single or multiple times, it will cause undefined behavior. There is only one schedule manager in the system. All negative values of discriminator are equivalent and the same as calling stmScheduleManagerInit()
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_INSUFFICIENT_MEMORY : failure of memory allocation of STM.
  • STM_ERROR_BAD_VALUE : unsupported value for discriminator.
  • STM_ERROR_NOT_SUPPORTED : connection to master not enabled. ignore this error for dual SOC case and soc is secondary
  • STM_ERROR_GENERIC : Failed to receive messages from master.

◆ stmStartSchedule()

STM_API stmErrorCode_t stmStartSchedule ( uint16_t  scheduleId)

Schedule Management API for starting Schedule Execution.

Remarks
This API must be called between stmScheduleManagerInit()/stmScheduleManagerInitWithDiscriminator() and stmScheduleManagerExit(). This API is thread-safe.
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
  • STM_ERROR_BAD_STATE_TRANSITION : If current state is not READY.
  • STM_ERROR_BAD_VALUE : if format of state messages are incorrect.
  • STM_ERROR_GENERIC : if message send/receive fails.

◆ stmStopSchedule()

STM_API stmErrorCode_t stmStopSchedule ( uint16_t  scheduleId)

Schedule Management API for stopping Schedule Execution.

Remarks
This API must be called between stmScheduleManagerInit()/stmScheduleManagerInitWithDiscriminator() and stmScheduleManagerExit(). This API is thread-safe.
Returns
stmErrorCode_t, the completion code of the operation:
  • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
  • STM_ERROR_BAD_STATE_TRANSITION : If current state is not RUNNING.
  • STM_ERROR_BAD_VALUE : if format of state messages are incorrect.
  • STM_ERROR_INSUFFICIENT_MEMORY : if malloc failure happened.
  • STM_ERROR_GENERIC : if message send/receive fails.