watchdog_reboot delay in flashFirmware #11
Replies: 2 comments 11 replies
-
|
Hi, Thanks for that. Yes, if you have a large area to erase, it can take longer than 500ms. I hadn't encountered that in the scenarios I've used it. The cleanest solution is probably to erase smaller blocks in a loop and reset the watchdog on each pass. Then it doesn't make any difference how big the application is. I'll look at making that change as soon as I have time. The issue you saw after the watchdog expired is very strange. I'll see if I can reproduce it. |
Beta Was this translation helpful? Give feedback.
-
|
I can't see how having the USB connection should impact anything. Possibly due to my application including pico_stdlib that includes stdio.h, but I have pico_enable_stdio_usb(${PROJECTNAME} 0) in my cmakelist file. After increasing the watchdog timeout, I did not see the issue again. Since the USB connection won't be accessible in the final product, this would only show up for me in development. Thanks again for sharing your code. It has saved me a significant amount of time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I found that with larger programs, the delay in watchdog_reboot (500ms) isn't long enough for the initial flash_range_erase call that erases the target memory area to complete. I measured 730ms for a size of 0x35000. I increased the delay to 2 seconds for my application.
For some reason that I don't understand, when I had a usb connection to the pc (used for loading .uf2 files) and the watchdog expired due to insufficient time, things behaved differently and I couldn't get the board to recover. I noticed this during panicked troubleshooting so I'm not certain if the usb connection really had an impact.
The 500ms in the original code is correct for the sample applications, but I wanted to leave a note that might be helpful to someone in the future.
Beta Was this translation helpful? Give feedback.
All reactions