You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RP2350 FreeRTOS - usb stdio printf() doesn't work (but usb works fine) if tinyusb is locked to core 1 #2803
tinyusb is set up to be device-only and present two CDC interfaces. The first one is the usual stdio related stuff, and the second one just prints out the messages received over the queue.
If I do not set the core affinity of tud_task it works as expected. However if I do set it, or set it and then set it back to the default (no affinity) then usb still works great, I still see the messages on the second CDC interface, but none of the printf() messages come out. I'm certain that FreeRTOS is working since if it wasn't, or if tud_task was hanging or otherwise misbehaving then I would not have either CDC interface (and the queue system wouldn't be working either.
I've played with configRUN_MULTIPLE_PRIORITIES without any change, and if I set configTASK_DEFAULT_CORE_AFFINITY so both tasks run on the same core, printf/stdio is still broken. In my actual codebase I have a few more tasks and they are all running fine, as are the FreeRTOS timers and so on... it feels like the stdio system or maybe something deeper in tinyusb is making an assumption about the system that it shouldn't be.
Another interesting datapoint -- it appears to be something going sideways during initialization. If I move tud_init(0) and stdio_init_all() to the code running on core 0, I can still pin tud_thread to core1 and printf() and friends work as expected.
moving to 2.3.1 as the initialize from core 0 is a reasonable workaround
note, i wonder if you are using a release build, as there is an assertion about stdio_usb init being done from core 0 which you're probably supposed to be hitting
Activity
akohlsmith commentedon Jan 22, 2026
Bit of an update.
vTaskCoreAffinitySet(), leaveconfigTASK_DEFAULT_CORE_AFFINITYto default (tskNO_AFFINITY) - works finevTaskCoreAffinitySet(), but setconfigTASK_DEFAULT_CORE_AFFINITYto (1 << 0) - works fine (everything runs on core 0)vTaskCoreAffinitySet(), but setconfigTASK_DEFAULT_CORE_AFFINITYto (1 << 1) - broken behaviour (everything runs on core 1)It looks like the stdio library (or something in tinyusb) does not like core 1.
akohlsmith commentedon Jan 23, 2026
Another interesting datapoint -- it appears to be something going sideways during initialization. If I move
tud_init(0)andstdio_init_all()to the code running on core 0, I can still pintud_threadto core1 andprintf()and friends work as expected.e.g.
works without issue even though
tud_task()is running on core1.kilograham commentedon Jun 30, 2026
could you maybe attach the rest of the files, so it's quicker for me to reproduce
kilograham commentedon Jul 1, 2026
moving to 2.3.1 as the initialize from core 0 is a reasonable workaround
note, i wonder if you are using a release build, as there is an assertion about stdio_usb init being done from core 0 which you're probably supposed to be hitting