Skip to content
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

resets every 5s (watchdog issue) #32

Open
doh38 opened this issue Nov 18, 2023 · 5 comments
Open

resets every 5s (watchdog issue) #32

doh38 opened this issue Nov 18, 2023 · 5 comments

Comments

@doh38
Copy link

doh38 commented Nov 18, 2023

I have a device with a nrf51802.
just calling anything under 10ms (even with the simplest form with delay(9) in the main loop) will make a few iteration and crash. funnily calling a delayMicrosecond(100000) will also crash it.
I don't intent to use "delays" actually, but even the freertos example crash or any millis() usage.
Is there anything I can do to debug this?
I don't have serial on this board and use RTT... unfortunately here on an higher level, so I'm not sure to be able to check anything there :)
*I succeeded to root it narrower. seems t be the watchdog triggering (error 2) ... tried to disable it, but it doesn't change anything unfortunately.

@doh38 doh38 changed the title Crash when loop is under 10ms on NRF51802 (xaa) resets every 5s (watchdog issue) Nov 19, 2023
@doh38
Copy link
Author

doh38 commented Nov 19, 2023

by default the watchdog is activated. first time ever used.
You need to disable it or add `NRF_WDT->RR[0] = WDT_RR_RR_Reload; at any place you want it to be reseted.
so solved :)

@jhmaloney
Copy link

jhmaloney commented Dec 3, 2023

I also ran into this issue.

You can also disable the watchdog timer by adding:
-DCONFIG_WDT_TIMEOUT_SECONDS=0
to your compiler flags.

It would be nicer for newcomers to n-able-Arduino if the CONFIG_WDT_TIMEOUT_SECONDS setting defaulted to 0 to disable the watchdog timer.

Alternatively, 'NRF_WDT->RR[0] = WDT_RR_RR_Reload' could be added to the top-level loop in main.c.

@h2zero
Copy link
Owner

h2zero commented Dec 4, 2023

I find it strange that this is happening, I've not seen it on my end but will definitely make that change.

@jhmaloney
Copy link

Thanks!

(You might not have noticed that the resets were happening. I didn't notice at first. What brought it to my attention was that variables were getting reset to their startup values.)

@jhmaloney
Copy link

I just submitted a tiny PR to make CONFIG_WDT_TIMEOUT_SECONDS default to zero (WDT disabled).

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

No branches or pull requests

3 participants