-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LPC55xx USB not working with SPEED_OPTIMIZATIONS=y #78268
Comments
I got some additional context for the When running with
When building without speed optimizations, the full boot + enumeration looks like this:
|
Meanwhile I have found out that it's specifically the Sounds like some instructions are getting reordered, which shouldn't be for the hardware to function (no USB interrupts are being generated, apart from the very first one). |
Narrowed it down to This is a workaround by patching diff --git a/soc/nxp/lpc/lpc55xxx/CMakeLists.txt b/soc/nxp/lpc/lpc55xxx/CMakeLists.txt
index 4dae5afa7ee..e53408bdf57 100644
--- a/soc/nxp/lpc/lpc55xxx/CMakeLists.txt
+++ b/soc/nxp/lpc/lpc55xxx/CMakeLists.txt
@@ -7,6 +7,9 @@ zephyr_library()
zephyr_library_sources(soc.c)
+# THIS FIXES THE USB ENUMERATION ISSUE WHEN USING SPEED_OPTIMIZATIONS=y (-O2)
+zephyr_library_compile_options(-fno-schedule-insns)
+
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/${ARCH}/include
|
Fixed here: #78377 |
Describe the bug
When using the USB stack on an LPC55x16, the USB device does not enumerate on the host, when using SPEED_OPTIMIZATIONS=y (gcc -O2 flag)
samples/subsys/usb/cdc_acm
sample applicationTo Reproduce
Steps to reproduce the behavior:
cd zephyr/samples/subsys/usb/cdc_acm
echo "CONFIG_SPEED_OPTIMIZATIONS=y" >> speedopt.conf
west build -p always -b lpcxpresso55s16 -- -DEXTRA_CONF_FILE=speedopt.conf
west flash
Expected behavior
USB device enumerates and shows up on the host.
E.g. when building the same
cdc_acm
sample without speed optimizations:Impact
Cannot use the speed optimizations in my application, which are crucial to get good performance.
Environment (please complete the following information):
zephyr-sdk-0.16.3
ccc4357f0a2
(Today'smain
)The text was updated successfully, but these errors were encountered: