How to get system uptime?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
datn02
Level 1
Level 1
First question asked Welcome!

I want to get the system uptime since the chip is powered on and working, similar to the micros() and millis() macro in Arduino.

Is there any pre-built function available in PDL or I will have to create a custom function for that?

Thanks for any help!

Dan

0 Likes
1 Solution
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

There is no pre-built function in PDL to do this. You will need to create by yourself.

You will be probably better off using the SysTick to implement this. You can configure a systick callback to increment a counter on every second or to the maximum period of the systick. When you want to know the up time, call a function to read back this counter + the current counter in the system tick.

View solution in original post

0 Likes
2 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins
0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

There is no pre-built function in PDL to do this. You will need to create by yourself.

You will be probably better off using the SysTick to implement this. You can configure a systick callback to increment a counter on every second or to the maximum period of the systick. When you want to know the up time, call a function to read back this counter + the current counter in the system tick.

0 Likes