SAF85XX Realtime Driver(CAN Driver) edge case

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

SAF85XX Realtime Driver(CAN Driver) edge case

Jump to solution
714 Views
eddy_bts
Contributor III

Below is the code snippet of Can_Ipw_GetTimestamp(Can_TimeStampType * TimestampPtr, uint32 Value)

eddy_bts_1-1730440854515.png

Then condition in the red rectangular is occured not only in yellow rectangular situation but also in timbase overflow. TimestampPtr->seconds shall not be incremented and TimestampPtr->nanoseconds shall not be zero in the latter case.

Labels (1)
0 Kudos
Reply
1 Solution
204 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have got information from RTD SW team: They will fix this potential issue in the next release.

Best regards,

Peter

View solution in original post

7 Replies
205 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have got information from RTD SW team: They will fix this potential issue in the next release.

Best regards,

Peter

665 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Could you let me know what is this RTD version?

Best regards,

Peter

0 Kudos
Reply
653 Views
eddy_bts
Contributor III

Hi,

We are usinng SAF85_S32R41_RTD_0_9_0_D2207.

There is no change of the Can_Ipw_GetTimestamp in the SAF85xx_SAF86xx_S32R41_RTD_2_0_0_P03_D2404.

Please refer to the following CAN global timstamp configuration we are using.

eddy_bts_1-1730989480776.png

 

Tags (1)
0 Kudos
Reply
544 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

The STM counter rolls over at FFFF_FFFFh to 0000_0000h.
The driver includes the case when counter overflows. See Can_Ipw_GetTimeElapsed function for more details.

petervlna_0-1731569327790.png

Best regards,

Peter

0 Kudos
Reply
536 Views
eddy_bts
Contributor III

Hi,

You are right. 'Can_Ipw_GetTimeElapsed' already considers the rollover of the time base so that return value of the 'Can_Ipw_GetTimeElapsed' is correct.

It means that 'TimestampPtr->nanoseonds is correct even though the rollover happens between 'Value' and 'CurrCompareValTemp' in the red rectangular of the below capture.

eddy_bts_3-1731573498769.png

Let's suppose as below:
CAN_43_FLEXCAN_TS_STM_TARGETTIME = 0x2625A00 = 4000000
Value = 0xFFFFFFFA
CurrCompareValTemp = 0x2625A00

'TimestampPtr->nanoseconds' would be calculated as 0x2625A01 so that 'TimestampPtr->nanoseconds' is greater than 'CAN_43_FLEXCAN_TS_STM_TARGETTIME

In yellow rectangular, Value(0xFFFFFFFA) is greater than CurrCompareValTemp(0x2625A00). However, that's not the situation which the programmer wants. In the perspective of physical timeline which doesn't have the roll-over concept, the 'Value' does not exceed 'CurrCompareValTemp'.

Therefore, codes in white rectangular shall not be executed.

0 Kudos
Reply
409 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

We have created internal ticket and ask software team solution.

I will inform you ASAP.

Best regards,

Peter

0 Kudos
Reply
673 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have asked RADAR team for help here.

But you should have also dedicated NXP FAE, please get in touch with him also.

Best regards,

Peter

0 Kudos
Reply