How to actually set PICO_RP2040_USB_DEVICE_UFRAME_FIX=0? #1260

Open
opened 2023-02-15 14:38:54 -06:00 by czietz · 7 comments
czietz commented 2023-02-15 14:38:54 -06:00 (Migrated from github.com)

The SDK 1.5.0 release notes mention the following new variable:

Defaulted new PICO_RP2040_USB_DEVICE_UFRAME_FIX variable to 1 as a workaround for errata RP2040-E15. This sets the default value for TinyUSB's dcd_rp2040 driver's TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX flag. This fix is required for correctness, but comes at the cost of some performance, so applications that won't ever be plugged into a Pi 4 or Pi 400 can optionally disable this by setting the value to 0.

However: How do I actually set PICO_RP2040_USB_DEVICE_UFRAME_FIX to 0? I would have expected to be able to add it to my CMakeLists.txt like other configuration parameters:

target_compile_definitions(my_project_name PRIVATE
PICO_RP2040_USB_DEVICE_UFRAME_FIX=0
)

However that results in a warning during the build process:

<command-line>: warning: "PICO_RP2040_USB_DEVICE_UFRAME_FIX" redefined
<command-line>: note: this is the location of the previous definition

... and checking the command-line shows that my project is still built with PICO_RP2040_USB_DEVICE_UFRAME_FIX=1.

Sadly, the SDK 1.5.0 documentation is (still?) missing, so I there isn't much documentation but the release notes.

PS: Also, the erratum RP2040-E15 is missing from the current RP2040 data sheet. Where I can find its description?
PPS: Good to see that my humble example apparently was used as part of the test case for the E15 erratum: github.com/P33M/rp2040-e15-testcase@2707219c2a

The [SDK 1.5.0 release notes](https://github.com/raspberrypi/pico-sdk/releases/tag/1.5.0) mention the following new variable: > Defaulted new PICO_RP2040_USB_DEVICE_UFRAME_FIX variable to 1 as a workaround for errata RP2040-E15. This sets the default value for TinyUSB's dcd_rp2040 driver's TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX flag. This fix is required for correctness, but comes at the cost of some performance, so applications that won't ever be plugged into a Pi 4 or Pi 400 can optionally disable this by setting the value to 0. However: How do I actually set PICO_RP2040_USB_DEVICE_UFRAME_FIX to 0? I would have expected to be able to add it to my CMakeLists.txt like other configuration parameters: ```CMake target_compile_definitions(my_project_name PRIVATE PICO_RP2040_USB_DEVICE_UFRAME_FIX=0 ) ``` However that results in a warning during the build process: ``` <command-line>: warning: "PICO_RP2040_USB_DEVICE_UFRAME_FIX" redefined <command-line>: note: this is the location of the previous definition ``` ... and checking the command-line shows that my project is still built with PICO_RP2040_USB_DEVICE_UFRAME_FIX=**1**. Sadly, the SDK 1.5.0 documentation is (still?) missing, so I there isn't much documentation but the release notes. PS: Also, the erratum RP2040-E15 is missing from the current RP2040 data sheet. Where I can find its description? PPS: Good to see that my humble example apparently was used as part of the test case for the E15 erratum: https://github.com/P33M/rp2040-e15-testcase/commit/2707219c2a28fd7f601448bba68d53261b13a1b0
kilograham commented 2023-02-15 14:50:22 -06:00 (Migrated from github.com)

you have the right idea, but yes this is a bug.

for now use TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX=0 instead (either via target_compile_definitions or in your tusb_config.h`

you have the right idea, but yes this is a bug. for now use `TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX=0` instead (either via `target_compile_definitions` or in your tusb_config.h`
czietz commented 2023-02-15 14:58:28 -06:00 (Migrated from github.com)

Thank you. I can confirm that setting TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX=0 via target_compile_definitions has the intended effect of disabling the workaround for erratum E15.

Thank you. I can confirm that setting `TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX=0` via `target_compile_definitions` has the intended effect of disabling the workaround for erratum E15.
kilograham commented 2023-02-15 17:16:56 -06:00 (Migrated from github.com)

i have updated the release notes

i have updated the release notes
kilograham commented 2023-05-30 17:01:02 -05:00 (Migrated from github.com)

changed to "documentation" as the workaround is actually the correct thing to do

changed to "documentation" as the workaround is actually the correct thing to do
lurch commented 2023-05-31 01:51:25 -05:00 (Migrated from github.com)

@kilograham AFAICT https://github.com/raspberrypi/pico-sdk/releases/tag/1.5.0 and Appendix F (SDK 1.5.0. Release Notes) of https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf and Appendix B (RP2040-E15) of https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf are all describing using TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX - what other documentation updates are needed to fix this? (or are the ducks all already in a row? 🦆 )

@kilograham AFAICT https://github.com/raspberrypi/pico-sdk/releases/tag/1.5.0 and Appendix F (SDK 1.5.0. Release Notes) of https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf and Appendix B (RP2040-E15) of https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf are all describing using `TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX` - what other documentation updates are needed to fix this? (or are the ducks all already in a row? :duck: )
lurch commented 2023-06-13 11:05:46 -05:00 (Migrated from github.com)

@P33M Are there any other changes needed here?

@P33M Are there any other changes needed here?
P33M commented 2023-06-14 03:14:24 -05:00 (Migrated from github.com)

None?

None?
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#1260
No description provided.