I got a partial answer from the picotool team:
You can set PICO_ENTER_USB_BOOT_ON_EXIT to do this (eg with target_compile_definitions(my_target PRIVATE PICO_ENTER_USB_BOOT_ON_EXIT=1 in your CMakeLists.txt)
This will reboot the Pico into disk mode when returning from main().
This leaves the question how to catch CPU exceptions etc, and force a reboot into that mode from code.
You can set PICO_ENTER_USB_BOOT_ON_EXIT to do this (eg with target_compile_definitions(my_target PRIVATE PICO_ENTER_USB_BOOT_ON_EXIT=1 in your CMakeLists.txt)
This will reboot the Pico into disk mode when returning from main().
This leaves the question how to catch CPU exceptions etc, and force a reboot into that mode from code.
Statistics: Posted by tem_pi — Fri Jul 26, 2024 4:03 pm