Skip to content

Make sure CFG_TUSB_OS is defined - #3157

Open
peterharperuk wants to merge 1 commit into
raspberrypi:developfrom
peterharperuk:tusb_os_fix
Open

peterharperuk wants to merge 1 commit into
raspberrypi:developfrom
peterharperuk:tusb_os_fix

Conversation

@peterharperuk

Copy link
Copy Markdown
Contributor

When building the USB examples with a newer version of tinyusb it's possible for CFG_TUSB_OS to be set wrongly.

When building the USB examples with a newer version of tinyusb it's
possible for CFG_TUSB_OS to be set wrongly.
@peterharperuk peterharperuk added this to the 2.3.1 milestone Aug 24, 2026
@lurch lurch added the tinyusb label Aug 24, 2026
@kilograham

kilograham commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

i somewhat dislike this as it works around a slightly dubious change in TinyUSB (which makes a global change in an example scoped configuration).

That said, in my testing i haven't needed this at least with #3163 (can you try again with that and my latest PR from pico-examples - raspberrypi/pico-examples#787)

@kilograham
kilograham marked this pull request as draft September 1, 2026 21:49
@kilograham
kilograham marked this pull request as ready for review September 1, 2026 22:26
@kilograham

Copy link
Copy Markdown
Contributor

That said, it seems like it ought to be necessary, given that the configuration of a freertos example should then remove this flag, so it may just be luck (or rather that the order of pico-example building has no stdio_usb examples after the tinyusb freertos examples)... so i'm leaning back towards merging this (without the hand-wavey speculation in the comments)

Note i did say dubious above, but it has always been slightly dubious that SDK tinyusb_base or whatever sets this unequivocally. I'm still a bit in the dark as to what it means to use TinyUSB w/FreeRTOS on Pico (I assume setting the RTOS away from OS_PICO is fine and likely required in this case, in which case we should keep this change, but also look for a better, more configurable way to apply the default of OS_PICO for the common SDK tinyusb case - doing it via CMake might be vestigial, and could be potentially fixed by an upstream TinyUSB change. failing that we should do it in such away that it can be overriden per TARGET at least)

Side note, it'd be helpful to have a version number define coming from TinyUSB in CMake

cc @hathach for my musings

@kilograham kilograham modified the milestones: 2.3.1, 2.3.2 Sep 2, 2026
@kilograham

Copy link
Copy Markdown
Contributor

moved this back into 2.3.2 since

  1. it seems like the change ought to be within the existing guard for whether TinyUSB is being used directly
  2. i'm a bit surprised that we always add our own tusb_config.h to the include path here. this likely predates pico_stdio_usb being used in conjunction with user use of TinyUSB. I guess we just happen to be fiurther down the include path!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants