rp2040: ep 0 out was already available #1764
Replies: 7 comments 4 replies
-
On further investigation, this seems to happen with some MIDI devices and unrelated to my USB MUX. For example, I cannot get a Novation Remote Zero SL to enumerate. |
Beta Was this translation helpful? Give feedback.
-
move to discussion since it is not clear too me if the bug is caused by tinyusb stack or user error |
Beta Was this translation helpful? Give feedback.
-
Not sure if my issue is related, the title of this discussion fits well, but I have a different setup. I'm using two Pi Picos and I cloned the SDK and the pico-examples repositories, then compiled the examples with CMake on an Ubuntu 22.04LTS VM. The pico-examples contain the examples from tinyusb, so I programmed the example with
and connected to the Pico with minicom. I'm seeing this when connecting a keyboard to the Pico:
I tried using the "develop" branch of the pico-sdk/-examples, but that doesn't really help. Things get weirder: Sometimes I see
I don't even understand how it prints the format string without replacing any values. I could give the exact sequence of commands I used to clone and build the examples, if that helps... |
Beta Was this translation helpful? Give feedback.
-
I've got the same problem, using TinyUSB on a custom rp2040 board and I don't even understand what the error message "ep 0 out was already available" means. If the endpoint is available, doesn't that mean that everything is good? Or should it be in use and not available. It's also not clear to me how to reproduce the bug consistently, sometimes my program works fine for a while, then suddenly panics with this message. I thought it was solved by upgrading the PicoSDK to version 1.5.0, after which the error disappeared for a while, but now its back and I have to clue how to approach it |
Beta Was this translation helpful? Give feedback.
-
The same on my side. Bellow logs from the same program with incorrect and correct USB startup:
|
Beta Was this translation helpful? Give feedback.
-
Small updated. I cloned tinyusb from repository instead version from rp2040 and this error is gone. |
Beta Was this translation helpful? Give feedback.
-
I'm seeing this happen on a personal project with latest master as of 2024-02-14, but only while disconnecting and reconnecting USB using Usually this process works fine. But sometimes I get a panic on core 2. Here's the backtrace:
Some additional debugging information:
Huh, that's... interesting. Looks like buffer_control is null. I just noticed that. Just happens to be that there's the rp2040 ROM at 0x0, so there's some arbitrary data there. On my pico, that first byte of memory looks like a stack pointer for ROM, specifically At a higher level, what should happen if buffer_control is null? Is it just a bug? Or should So somehow, at least for my case, something must be zero-ing out the buffer_control pointer. Now it's just a matter of figuring out what. Since it looks like a race, it might be difficult to trigger with the slowdown incurred by gdb conditional breaks... |
Beta Was this translation helpful? Give feedback.
-
Operating System
Linux
Board
Custom RP2040 board
Firmware
https://github.com/rppicomidi/midi2usbhost custom version
What happened ?
I've built a custom board which has USB Type-C for Firmware Uploads (and during boot) and a USB Type-A which is switched to the D+/D- Pins with a FSUSB42 (and which power is controlled via MOSFET).
The select pin of the FSUSB42 is pulled low, so the device starts up with the USB-C being active for firmware upload.
Then the firmware puts SEL high, calls board_init() / tusb_init() as usual and enables VBUS. The USB-C is then only used for supplying the board with power.
Unfortunately and unexpectedly, the Type-A won't work because TinyUSB says the EP 0 out was already claimed.
I've tried a workaround with calling a usb reset before calling tusb, but that won't help.
How to reproduce ?
Debug Log as txt file
Screenshots
No response
I have checked existing issues, dicussion and documentation
Beta Was this translation helpful? Give feedback.
All reactions