diff --git a/docs/esp32/quickref.rst b/docs/esp32/quickref.rst index f74926c374602..5fb5b3c6a52a6 100644 --- a/docs/esp32/quickref.rst +++ b/docs/esp32/quickref.rst @@ -150,7 +150,7 @@ These are working configurations for LAN interfaces of popular boards:: # or with dynamic ref_clk pin configuration - lan = network.LAN(mdc=machine.Pin(23), mdio=machine.Pin(18), power=machine.Pin(5), + lan = network.LAN(mdc=machine.Pin(23), mdio=machine.Pin(18), power=machine.Pin(5), phy_type=network.PHY_LAN8720, phy_addr=0, ref_clk=machine.Pin(17), ref_clk_mode=machine.Pin.OUT) @@ -577,7 +577,7 @@ See :ref:`machine.WDT `. :: from machine import WDT # enable the WDT with a timeout of 5s (1s is the minimum) - wdt = WDT(timeout=5000) + wdt = WDT(timeout=5000) # timeout in milliseconds wdt.feed() .. _Deep_sleep_mode: diff --git a/docs/esp32/tutorial/wdt.rst b/docs/esp32/tutorial/wdt.rst new file mode 100644 index 0000000000000..25a70cb7144ff --- /dev/null +++ b/docs/esp32/tutorial/wdt.rst @@ -0,0 +1,39 @@ +.. _esp32_wdt: + +When the WDT timeout is short, there is a software update issue: +you don't have enough time to copy the updates to the device. +ESP32 alows reinitialise the watchdog with a longer timeout - like an hour. + +More comprehansive example usage:: + + # Save as 'main.py' and it will run automatically after 'boot.py' + + import sys + from time import sleep + from machine import WDT, reset + + try: + print('Press Ctrl-C to break the program.') + sleep(5) + print('Enable the WDT with a timeout of 5s.') + wdt = WDT(timeout=5000) + + seconds = 1 + while True: # infinite work loop + print('Do something useful in less than 5 seconds.') + print(f'Sleep {seconds} seconds.') + if seconds >= 5: + print(f'WDT will reboot the board.') + sleep(seconds) + seconds += 1 + wdt.feed() + + # 1/0 # uncoment this line to raise an runtime exception, then WDT reboot + + # sys.exit() # uncomment this line for planned program exit + + except SystemExit: + wdt = WDT(timeout=1000 * 60 * 60) # 1 hour before WDT reboot + print('Now you have 1 hour to update program on the board.') + print('When ready, type reset() on the REPL/WebREPL command line to reboot.') + diff --git a/docs/library/machine.WDT.rst b/docs/library/machine.WDT.rst index 95893cec36be7..1169febbe86aa 100644 --- a/docs/library/machine.WDT.rst +++ b/docs/library/machine.WDT.rst @@ -13,7 +13,8 @@ Example usage:: from machine import WDT wdt = WDT(timeout=2000) # enable it with a timeout of 2s - wdt.feed() + while True: + # do something useful in less than 2 seconds Availability of this class: pyboard, WiPy, esp8266, esp32, rp2040, mimxrt. diff --git a/lib/asf4 b/lib/asf4 index 84f56af13292d..d270f79aa16dd 160000 --- a/lib/asf4 +++ b/lib/asf4 @@ -1 +1 @@ -Subproject commit 84f56af13292d8f32c40acbd949bde698ddd4507 +Subproject commit d270f79aa16dd8fd4ae3b6c14544283dcb992e9c diff --git a/lib/axtls b/lib/axtls index 531cab9c278c9..43a6e6bd3bbc0 160000 --- a/lib/axtls +++ b/lib/axtls @@ -1 +1 @@ -Subproject commit 531cab9c278c947d268bd4c94ecab9153a961b43 +Subproject commit 43a6e6bd3bbc03dc501e16b89fba0ef042ed3ea0 diff --git a/lib/btstack b/lib/btstack index 1635e36d06821..c8b9823f68c6a 160000 --- a/lib/btstack +++ b/lib/btstack @@ -1 +1 @@ -Subproject commit 1635e36d06821af8b61302509e91bfcc1ade84c4 +Subproject commit c8b9823f68c6af0fa52e2c4e009aba4dbf257232 diff --git a/lib/lwip b/lib/lwip index 6ca936f6b588c..159e31b689577 160000 --- a/lib/lwip +++ b/lib/lwip @@ -1 +1 @@ -Subproject commit 6ca936f6b588cee702c638eee75c2436e6cf75de +Subproject commit 159e31b689577dbf69cf0683bbaffbd71fa5ee10 diff --git a/lib/mynewt-nimble b/lib/mynewt-nimble index 42849560ba790..97ce3eacaaa79 160000 --- a/lib/mynewt-nimble +++ b/lib/mynewt-nimble @@ -1 +1 @@ -Subproject commit 42849560ba7906f023f61e5f7ff3709ba2c1dfca +Subproject commit 97ce3eacaaa79e8ed6cf71717149ced4f5328ee7 diff --git a/lib/nxp_driver b/lib/nxp_driver index fa5a554c7944d..b618cb1d521cc 160000 --- a/lib/nxp_driver +++ b/lib/nxp_driver @@ -1 +1 @@ -Subproject commit fa5a554c7944d2a196626f8d3631e44943f9abcc +Subproject commit b618cb1d521cc9e133bdcd0fca154dee2d925dfe diff --git a/lib/pico-sdk b/lib/pico-sdk index f396d05f8252d..bfcbefafc5d2a 160000 --- a/lib/pico-sdk +++ b/lib/pico-sdk @@ -1 +1 @@ -Subproject commit f396d05f8252d4670d4ea05c8b7ac938ef0cd381 +Subproject commit bfcbefafc5d2a210551a4d9d80b4303d4ae0adf7 diff --git a/lib/stm32lib b/lib/stm32lib index a9f8fee7bb0cb..302c52794d2f5 160000 --- a/lib/stm32lib +++ b/lib/stm32lib @@ -1 +1 @@ -Subproject commit a9f8fee7bb0cb4ac1b4ff719b6b5b285f613f352 +Subproject commit 302c52794d2f579903f4e49cbad1f5d3a7f401ad diff --git a/lib/tinyusb b/lib/tinyusb index 868f2bcda092b..6d3fb7eb98b6c 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 868f2bcda092b0b8d5f7ac55ffaef2c81316d35e +Subproject commit 6d3fb7eb98b6c0960be152b66b653a3062c7db5e