Hi Team,
We are using the NXP S32K588 in an AUTOSAR-based program, with ETAS OS and EB MCAL.
Several MCAL components provide a timeout mechanism where the timeout method can be configured as either:
When the timeout method is configured as OSIF_COUNTER_SYSTEM, the affected drivers attempt to access OSIF counters through OsIf_GetCounter() during their initialization sequence.
Since these driver initialization functions are called from EcuM_Init(), the AUTOSAR OS reports an error via:
ErrorHook => E_OS_CALLEVEL
Our understanding is that this occurs because AUTOSAR OS counter APIs are only permitted to be accessed from valid OS contexts such as Tasks or ISRs, whereas EcuM_Init() executes before the OS scheduler is started.
Could you please advise on the recommended approach to handle this situation? Specifically:
Hi,
thanks, let me ask SW/RTD team if they can provide any additional feedback.
BR, Petr
Hi,
Your analysis seems correct. If a driver configured with OSIF_COUNTER_SYSTEM is initialized from EcuM_Init() before the OS is started, calls to OsIf_GetCounter() may result in E_OS_CALLEVEL, depending on the AUTOSAR OS implementation.
For modules initialized during the pre-OS phase, a common workaround is to avoid using OS-based timing services and use OSIF_COUNTER_DUMMY (or another non-OS timing source) instead.
The exact recommendation may also depend on the ETAS OS implementation and the MCAL/RTD version being used. Could you please share the S32DS and RTD (or MCAL) versions for further verification?
BR, Petr