RA4M1 CAN timestamp register overflow management

Hello all,

I would like to ask if there is a way to tell when the timestamp register of the CAN0 overflows.

I couldn't find any bit that would tell me that there was an overflow and so if the CAN timestamp timer overflows it can cause problems.

Here is my example for my case:

I open the CAN for communication (if I understand correctly the timer starts at this time). This is ok as the absolute value since the start would be perfect for timestamping the data.

Then there are CAN msg-es incoming which all receive their timestamps when they are arriveing. This is good as it is hardware close so it is as accurate as it can get.

When the overflow happens to my knowledge there is nothing that would indicate that, so I can't make a correction when it happens. This is where my problems begin.

If I would try to compare the timestamps value (see if the next one is lower than the one before) I would be able to tell if the overflow happend (or not).

This would be a way to handle the problem however here is also a possibility that it does not get detected if the timestamp timer reaches a higher number than the previous frames timestamp.

(lets say there was a message received at 32000 and then the next message comes after 66000 cycles of the timer which means the timestamp of the 2nd message now shows 32 465. The overflow happened but it didn't get detected and so I cant handle it.)

Is there a way to handle the timestamp timer in a way so that I can tell if the overflow happened and I need to manage that?

Or is there a "suggested" way on how the CAN communication should be handled in cases like mine where the time frame of when messages need to be received is larger than the timers time frame?

Thanks for the help and best regards!