-
-
Notifications
You must be signed in to change notification settings - Fork 35
Is it possible to put the Arduino 33 BLE into bootloader mode from code? #64
Comments
Hi Giorgio, sure you can 🙂 |
Hi Martino. |
Ah, it's what surely happens... How often is your watchdog configured to fire? From what I read on Nordic forum, there's no way to deactivate it using a soft reset, only the reset button works, so the code I gave you is unlikely to fix the problem. |
In fact, your code works only with WDT disable and my uploading problem is the same of your link indicates. I use that WDT code (5 sec) and once it started there is not way to stop it. I also tried to modify the WDT time with NRF_WDT->CRV = 3932159; (120s) before ontouch1200bps(); but, unfortunately, it seams irrelevat |
I use this code and it works (reset to bootloader):
|
@morettigiorgio in order to actually change the timeout value you also need to feed the WDT. Please, refer to Reload Criteria for more information. The complete sequence should be: constexpr uint32_t WDT_MAX_VALUE = 0x07CFFFFF;
NRF_WDT->CRV = WDT_MAX_VALUE;
for (auto rr = 0; r < 8; r++)
NRF_WDT->RR[rr] = NRF_WDT_RR_VALUE; This feature is also available via the NRF5 SDK that you can use directly from the Arduino sketch. constexpr uint32_t WDT_MAX_VALUE = 0x07CFFFFF;
nrf_wdt_reload_value_set(WDT_MAX_VALUE);
nrfx_wdt_feed(); FYI, NRF52840's watchdog is fully supported via the MbedOS Watchdog API even on Arduino Nano 33. Still, the MbedOS Watchdog API is pretty simple/naive and Nordic's Watchdog can't be stopped. |
Closing as answered 😉 |
I would like to be sure that my Arduino is in upload mode before pressing the upload button from IDE. This is because my Arduino is not easy to reach and I often have to press the reset button to load the sketch.
I could put Arduino in upload mode, from bluetooth, with a code if this were possible.
Thanks
The text was updated successfully, but these errors were encountered: