-
Notifications
You must be signed in to change notification settings - Fork 215
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
Support resetting Picoprobe board using USB RESET interface (RP2040) #108
base: master
Are you sure you want to change the base?
Conversation
… USB_RESET interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR - I have left review comments below.
@@ -49,4 +49,7 @@ | |||
|
|||
#define PROBE_PRODUCT_STRING "Picoprobe (CMSIS-DAP)" | |||
|
|||
// Host Reset Config | |||
#define PICOPROBE_RESET_CAPABLE 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer disabled by default. I would guess that for other users the feature would aid remote development of the probe firmware itself, but the vast majority will be doing uf2 drag-and-drop with a Pico or a Debug Probe and a standard release.
So, please move this definition to include/board_example_config.h with a suitable description.
#if PICOPROBE_RESET_CAPABLE | ||
if (request->wIndex == 3) { | ||
if (request->bRequest == RESET_REQUEST_BOOTSEL) { | ||
reset_usb_boot(0, (request->wValue & 0x7f) | 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superfluous bitwise OR with zero
@@ -0,0 +1,28 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the reset interface definitions be included with a Cmake library linkage instead of a repeat inclusion of the sdk header?
We have a use-case involving reusing RP2040 supervisor as an SWD debug interface during initial testing. This implements standard Pico SDK C++ usb reset endpoints to interoperate with appropriately patched picotool. The patch enables this functionality by default, but it can be disabled with a config switch to avoid accidentally rebooting the incorrect RP2040 device.
raspberrypi/picotool@master...FarProbe:picotool:master