SDK 2.3.0 - Missing or changed defines #3060

Open
opened 2026-07-04 08:54:56 -05:00 by Memotech-Bill · 5 comments
Memotech-Bill commented 2026-07-04 08:54:56 -05:00 (Migrated from github.com)
/home/pi/pico/PicoBB/src/pico/pico_boot.c:13:36: error: 'PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE' undeclared (first use in this function); did you mean 'PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE'?
   13 |     if (p_line_coding->bit_rate == PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE)
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                    PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE
/home/pi/pico/PicoBB/src/pico/pico_boot.c:13:36: note: each undeclared identifier is reported only once for each function it appears in
/home/pi/pico/PicoBB/src/pico/pico_boot.c:20:35: error: 'PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK' undeclared (first use in this function)
   20 |         reset_usb_boot(gpio_mask, PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/pico/PicoBB/src/pico/pico_boot.c:24:31: error: 'PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS' undeclared (first use in this function); did you mean 'PICO_STDIO_USB_POST_CONNECT_WAIT_DELAY_MS'?
   24 |         watchdog_reboot(0, 0, PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                               PICO_STDIO_USB_POST_CONNECT_WAIT_DELAY_MS

The above used to compile OK with v2.20 of the SDK. I cannot remember which version of the SDK I first introduced this code.

The 2.3.0 release documentation references pico-usb-reset, but the link does not take me to any such documentation.

```` /home/pi/pico/PicoBB/src/pico/pico_boot.c:13:36: error: 'PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE' undeclared (first use in this function); did you mean 'PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE'? 13 | if (p_line_coding->bit_rate == PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE /home/pi/pico/PicoBB/src/pico/pico_boot.c:13:36: note: each undeclared identifier is reported only once for each function it appears in /home/pi/pico/PicoBB/src/pico/pico_boot.c:20:35: error: 'PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK' undeclared (first use in this function) 20 | reset_usb_boot(gpio_mask, PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pi/pico/PicoBB/src/pico/pico_boot.c:24:31: error: 'PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS' undeclared (first use in this function); did you mean 'PICO_STDIO_USB_POST_CONNECT_WAIT_DELAY_MS'? 24 | watchdog_reboot(0, 0, PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | PICO_STDIO_USB_POST_CONNECT_WAIT_DELAY_MS ```` The above used to compile OK with v2.20 of the SDK. I cannot remember which version of the SDK I first introduced this code. The 2.3.0 release documentation references `pico-usb-reset`, but the link does not take me to any such documentation.
Memotech-Bill commented 2026-07-04 09:20:10 -05:00 (Migrated from github.com)

It appears that at least some of the definitions have moved into "pico/pico-usb-reset.h".

// PICO_CONFIG: PICO_USB_RESET_MAGIC_BAUD_RATE, Baud rate that if selected causes a reset into BOOTSEL mode (if PICO_ENABLE_USB_RESET_VIA_BAUD_RATE is set), default=1200, group=pico_usb_reset
#ifndef PICO_USB_RESET_MAGIC_BAUD_RATE
#ifdef PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE // backwards compatibility with SDK <= 2.2.0
#define PICO_USB_RESET_MAGIC_BAUD_RATE PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE
#else
#define PICO_USB_RESET_MAGIC_BAUD_RATE 1200
#endif
#endif

The above sets PICO_USB_RESET_MAGIC_BAUD_RATE to the value of PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE. However it does not initialise the old definition PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE to its previous value. For v2.2.0 this was initialised in "pico/stdio_usb.h".

It appears that at least some of the definitions have moved into "pico/pico-usb-reset.h". ```` // PICO_CONFIG: PICO_USB_RESET_MAGIC_BAUD_RATE, Baud rate that if selected causes a reset into BOOTSEL mode (if PICO_ENABLE_USB_RESET_VIA_BAUD_RATE is set), default=1200, group=pico_usb_reset #ifndef PICO_USB_RESET_MAGIC_BAUD_RATE #ifdef PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE // backwards compatibility with SDK <= 2.2.0 #define PICO_USB_RESET_MAGIC_BAUD_RATE PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE #else #define PICO_USB_RESET_MAGIC_BAUD_RATE 1200 #endif #endif ```` The above sets `PICO_USB_RESET_MAGIC_BAUD_RATE` to the value of `PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE`. However it does not initialise the old definition `PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE` to its previous value. For v2.2.0 this was initialised in "pico/stdio_usb.h".
kilograham commented 2026-07-04 09:23:01 -05:00 (Migrated from github.com)

The 2.3.0 release documentation references pico-usb-reset, but the link does not take me to any such documentation.

Yes, the documentation didn't quite make it out the door on Friday (hence the lack of announcement about SDK version)! Monday likely

> The 2.3.0 release documentation references pico-usb-reset, but the link does not take me to any such documentation. Yes, the documentation didn't quite make it out the door on Friday (hence the lack of announcement about SDK version)! Monday likely
will-v-pi commented 2026-07-06 04:53:17 -05:00 (Migrated from github.com)

This was changed in https://github.com/raspberrypi/pico-sdk/pull/2629 - the defines have been moved from pico/stdio_usb.h to pico/usb_reset_config.h (which is included by pico/usb_reset.h), and renamed to remove STDIO.

These defines weren't expected to be used outside of the SDK, hence only adding backwards compatibility in one direction. I think a fix (assuming you want to maintain backwards compatibility with older SDKs for your code) is to add this to that C file, after #include "pico/stdio_usb.h" (or #include "pico/stdlib.h"):

#ifndef PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE
#include "pico/usb_reset.h"
#define PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE PICO_USB_RESET_MAGIC_BAUD_RATE
#define PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK PICO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK
#define PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS PICO_USB_RESET_RESET_TO_FLASH_DELAY_MS
#endif

I can raise a PR to add backwards compatibility in this direction too

This was changed in https://github.com/raspberrypi/pico-sdk/pull/2629 - the defines have been moved from `pico/stdio_usb.h` to `pico/usb_reset_config.h` (which is included by `pico/usb_reset.h`), and renamed to remove `STDIO`. These defines weren't expected to be used outside of the SDK, hence only adding backwards compatibility in one direction. I think a fix (assuming you want to maintain backwards compatibility with older SDKs for your code) is to add this to that C file, after `#include "pico/stdio_usb.h"` (or `#include "pico/stdlib.h"`): ```c #ifndef PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE #include "pico/usb_reset.h" #define PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE PICO_USB_RESET_MAGIC_BAUD_RATE #define PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK PICO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK #define PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS PICO_USB_RESET_RESET_TO_FLASH_DELAY_MS #endif ``` I can raise a PR to add backwards compatibility in this direction too
Memotech-Bill commented 2026-07-06 06:56:14 -05:00 (Migrated from github.com)

My solution was somewhat similar:

#ifndef PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE
#define PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE 1200
#endif
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK
#define PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK 0u
#endif
#ifndef PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS
#define PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS 100
#endif

However, since this is now broken, I am not sure it is worth fixing since anybody using these defines will have to apply their own fix before the next release of the SDK.

[My solution](https://github.com/Memotech-Bill/PicoBB/blob/6d0620b1570557688d0cf5e840ab2a477358fd00/src/pico/pico_boot.c#L10) was somewhat similar: ```` #ifndef PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE #define PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE 1200 #endif #ifndef PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK #define PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK 0u #endif #ifndef PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS #define PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS 100 #endif ```` However, since this is now broken, I am not sure it is worth fixing since anybody using these defines will have to apply their own fix before the next release of the SDK.
will-v-pi commented 2026-08-04 04:17:07 -05:00 (Migrated from github.com)

I think I agree with you - I'll pop this in the none milestone instead of closing it, in case anyone else runs into this issue

I think I agree with you - I'll pop this in the `none` milestone instead of closing it, in case anyone else runs into this issue
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#3060
No description provided.