This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA3XEVM: Negative timestamps in sysbios

Part Number: TDA3XEVM
Other Parts Discussed in Thread: SYSBIOS

Hi,

We are using the Fvid2 capture module and uses the built in timestamp function to get the correct time. As I understand it it uses the TimestampProvider as default. You can also register your own timestamp function in the capture module as well.

The Timestamp function uses a 64 bit timer where the counter register from the TDA3 timer is used for the lower 32-bits and when a rollover occurs an interrupt is generated which counts the upper 32 bits.

The capture module is interrupt driven and it reads the timestamp from the interrupt service routine. If a timestamp rollover occurs while in this routine you will get a negative timestamp by a U32 period. The timestamp function needs to check if there have been an overflow while reading the counters to get the correct timestamp.

We've seen that this has been addressed in other processors for getting the 64 bits but not for the dmtimer.
(see Timer_getExpiredCounts64 in sysbios/family/arm/lm4/Timer.c and both the sysbios/timers/dmtimer/Timer.c and TimestampProvider.c)

We have problems with intermittent negative timestamps. Maybe we've misinterpret something but if we hack the solution to take into consideration of the four cases described in the lm4 timer we do not get any negative timestamps.

Have you ever seen this occurring for the dmtimer and if so, would you agree that this is an issue/error that needs to be fixed?

Thanks

Jean

  • Hi Jean,

    This is design by contract according to TI SYSBIOS APIs. It does mention the timestamp would wrap around if reaching max 32-bit value. User has to take care of this in application.

    We don't plan to make any change.

    Regards,
    Stanley

  • Hi Stanley,

    Thanks for your reply.

    OK. So if I understand you correctly: the Timestamp_get64() API is not supported on TDA3 SYSBIOS and also that the default timestamp64 get function in the fvid2 driver needs to be replaced by a user implementation?

    Regards

    Jean