Skip to content

RP2040 and RP2350 have different maximum watchdog delays #2500

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

Merged
merged 1 commit into from
Jun 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/rp2_common/hardware_watchdog/include/hardware/watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,21 @@ void watchdog_update(void);
* \note If \ref watchdog_start_tick value does not give a 1MHz clock to the watchdog system, then the \p delay_ms
* parameter will not be in milliseconds. See the datasheet for more details.
*
* \if rp2040_specific
* On RP2040 the maximum delay is 8388 milliseconds, which is approximately 8.3 seconds (this is due to RP2040-E1).
* \endif
* \if rp2350_specific
* On RP2350 the maximum delay is 16777 milliseconds, which is approximately 16.7 seconds.
* \endif
*
* By default the SDK assumes a 12MHz XOSC and sets the \ref watchdog_start_tick appropriately.
*
* This method sets a marker in the watchdog scratch register 4 that is checked by \ref watchdog_enable_caused_reboot.
* If the device is subsequently reset via a call to watchdog_reboot (including for example by dragging a UF2
* onto the RPI-RP2), then this value will be cleared, and so \ref watchdog_enable_caused_reboot will
* return false.
*
* \param delay_ms Number of milliseconds before watchdog will reboot without watchdog_update being called. Maximum of 8388, which is approximately 8.3 seconds
* \param delay_ms Number of milliseconds before watchdog will reboot without watchdog_update being called
* \param pause_on_debug If the watchdog should be paused when the debugger is stepping through code
*/
void watchdog_enable(uint32_t delay_ms, bool pause_on_debug);
Expand Down Expand Up @@ -124,7 +131,7 @@ bool watchdog_enable_caused_reboot(void);
* \brief Returns the number of microseconds before the watchdog will reboot the chip.
* \ingroup hardware_watchdog
*
* \if rp2040_specicifc
* \if rp2040_specific
* On RP2040 this method returns the last value set instead of the remaining time due to a h/w bug.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kilograham Do you know which hardware bug this is referring to? The RP2040 datasheet lists RP2040-E1 (which doesn't cover this) as the only watchdog-related errata.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like I'd forgotten about #1492 🤦

* \endif
*
Expand Down
Loading