Skip to content

rp2040: watchdog #2596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

rp2040: watchdog #2596

wants to merge 1 commit into from

Conversation

ysoldak
Copy link
Contributor

@ysoldak ysoldak commented Jan 30, 2022

Implements hardware watchdog timer for RP2040.

Implementation inspired by Pico SDK
It ended up quite different though.

I could not use time.Duration to have nice "period" configuration parameter instead of "ticks" due to an import loop.

Examples demonstrate basic usage, watchdog triggering on runtime panic and while spinning.
Basic example added to the list of smoke tests.

@ysoldak
Copy link
Contributor Author

ysoldak commented Jan 31, 2022

This is printout from the basic example:

Hardware reset
10
9
8
7
6
5
4
3
2
1
0

Timer reset
10
9
8
7
6

Force reset
10
9
8
7
6
5
4
3
2
1
0

Timer reset
10
9
8

@ysoldak ysoldak force-pushed the rp2040-watchdog branch 2 times, most recently from f19c5f4 to 1d325df Compare January 31, 2022 22:16
@ysoldak ysoldak marked this pull request as ready for review January 31, 2022 22:52
@ysoldak
Copy link
Contributor Author

ysoldak commented Feb 2, 2022

@ofauchon What do you think?

@ysoldak ysoldak marked this pull request as draft February 8, 2022 00:08
@ysoldak
Copy link
Contributor Author

ysoldak commented Feb 8, 2022

I've observed a strange behaviour when building with this change.
Time seem to flow much slower with these changes. I've probably messed up with some timer.

This behaviour manifests itself quite remarkably: while the board is plugged in and flashed (tinygo flash) it works just fine as usual. But once you unplug the board and plug it in again (hard power cycle) you can directly tell your code runs much slower, very easy to see with blinky1 example.

@deadprogram
Copy link
Member

Now that #3855 was merged, this PR seems obsolete, so should probably close it.

@ysoldak
Copy link
Contributor Author

ysoldak commented Sep 12, 2023

Now that #3855 was merged, this PR seems obsolete, so should probably close it.

That PR does not cover all functionality though. I'll try and rebase and sync with dev branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants