The error of GetCounterValue during initialization in case using AUTOSAR OS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The error of GetCounterValue during initialization in case using AUTOSAR OS

1,251 Views
MickMick
Contributor II

Hi

I embedded RTD "S32K3_M27X Real-Time Drivers Version 3.0.0 P07" as MCAL in the AUTOSAR system and the error occurs and the Mcu initialization process fails.

Mcu_Init() is called in the startup process and AUTOASAR OS API GetCounterValue() is called from there.
However, GetCounterValue() can only be called in Task or ISR2, therefore it causes the error to call GetCounterValue() in the startup routine which is called before the OS starts.
I think, however, that Mcu_Init() is called in the startup routine is correct because it is written so in the RTD MCU instruction manual and the specification of AUTOSAR ECU state manager.

In addition, OSIF_COUNTER_SYSTEM has been chosen as the Mcu Timeout Method.

Could you let me know how we can avoid the error?

Tags (1)
0 Kudos
Reply
2 Replies

1,005 Views
CongDang
NXP Employee
NXP Employee

Unfortunately, I lack knowledge on AUTOSAR OS, so I'm not sure if there is a way that AUTOSAR OS is initialized before calling Mcu_Init() (if still keeping Mcu_Init() being called in the startup process as you requested). But I think not.
So I guess the way you can do it is configure OsIfOperatingSystemType with OsIfBaremetalType

0 Kudos
Reply

954 Views
MickMick
Contributor II

Thank you for your suggestion.

We also lacked knowledge of the AUTOSAR OS and could not get it to work properly using OSIF_COUNTER_SYSTEM.
Therefore, we decided to use OSIF_COUNTER_DUMMY.

Thank you again.

0 Kudos
Reply