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
RP2040-E5 fix needs tinyusb_additions added to CMakeLists.txt #759
The RP2040-E5 fix needs TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX to be set for tinyusb to call rp2040_usb_device_enumeration_fix() during the IRQ handler. TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX is defined by PICO_RP2040_USB_DEVICE_ENUMERATION_FIX and that is set in the RP2040 family cmake file as part of the tinyusb_additions library. The docs/examples don't have tinyusb_additions in the target_link_libraries list or use family_configure_* which adds tinyusb_additions so pico_fix/rp2040_usb_device_enumeration is compiled as part of the SDK but never used by tinyusb.
There is a thread on the Pi forum where the RP2040-E5 issue has was causing problems. Explicitly setting TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX was found to workaround the issue so pointed at the fix not being used.
Proposed fix would be to add tinyusb_additions to target_link_libraries as family_configure_* does other things. If there is a cleaner way of setting that flag then that would also work.
What is the approved method for enabling the E5 workaround? Do you add the tinyusb_additions library or manually set the define? If you set a define, which one do you set?
I'm using GPIO 15 for PWM input and GPIO 16 for PWM output, so presumably I might see short interruption on PWM output, etc? But presumably this would happen only when USB cable is plugged in (or could this happen if there is USB "bus reset" etc?)
I'm using GPIO 15 for PWM input and GPIO 16 for PWM output, so presumably I might see short interruption on PWM output, etc? But presumably this would happen only when USB cable is plugged in (or could this happen if there is USB "bus reset" etc?)
Correct; just adding PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1 is all you need to do; I have added info to the errate for the imminent SDK1.3.1. release
Activity
JamesH65 commentedon Mar 18, 2022
@kilograham @liamfraser FYI in case you hadn't already seen it.
kilograham commentedon May 4, 2022
I'm not 100% sure where you are asking for this to be added? What "docs/examples" are you referring to.
Note that the fix is not the default, as it takes control of GPIO 15, and 16 briefly, so you have to know you are allowed to do that.
trejan commentedon May 4, 2022
The datasheet shows the E5 errata and points to https://github.com/raspberrypi/pico-sdk/tree/master/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c as the workaround. It doesn't say that you need to specifically enable it or how to enable it. Nothing in https://github.com/raspberrypi/pico-examples mentions it either.
What is the approved method for enabling the E5 workaround? Do you add the tinyusb_additions library or manually set the define? If you set a define, which one do you set?
tjko commentedon May 5, 2022
I had missed the part that this uses GPIO 15/16. Brief explanation what happens and when would be helpful.
I ran into this "enumeration" issue recently and adding following into CMakeLists.txt seemed to work fine (on a RP2040-B1):
I'm using GPIO 15 for PWM input and GPIO 16 for PWM output, so presumably I might see short interruption on PWM output, etc? But presumably this would happen only when USB cable is plugged in (or could this happen if there is USB "bus reset" etc?)
kilograham commentedon May 12, 2022
Correct; just adding
PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1is all you need to do; I have added info to the errate for the imminent SDK1.3.1. releaseactually only GPIO 15 is affected.
it happens on any bus reset.
lurch commentedon May 18, 2022
See also raspberrypi/pico-examples#210
trejan commentedon May 18, 2022
Thanks!