Bug in RTD S32K3xx: Stm_Ip_StartCounting is not thread safe

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

Bug in RTD S32K3xx: Stm_Ip_StartCounting is not thread safe

414 Views
joohau
Contributor II

The STM module of the RTD 2.0.0 (S32K3_RTD_2_0_0_D2203_ASR_REL_4_4_REV_0000_20220331) for S32K3xx does not contain any requirements regarding thread safety.
However, the implemention of the Stm_Ip_StartCounting is not thread safe! Next to that, it fails for small wait times for the same reason:


When the 
currentCntValue is obtained and an interrupt occurs the counter continuous on the background. The compare value is then set to the "old" currentCntValue + the request wait time. When the counter has already advanced past this compare value we'll have to wait a complete counter wrap before the compare value is reached. This causes the function to faile for small wait times and in case of interrupts happening during the function execution.

A new implementation and/or interrupt disabling is required in my opinion.

0 Kudos
1 Reply

304 Views
namnguyenviet
NXP Employee
NXP Employee

Hello @joohau 

Thank you for your report. I agree that the process should be improved. I created a ticket for the team to investigate: ARTD-55075.

Best Regards,

Nam

0 Kudos