Skip to content

Update cherryusb-host#420

Closed
Rbb666 wants to merge 1 commit into
cherry-embedded:masterfrom
Firmament-Autopilot:host
Closed

Update cherryusb-host#420
Rbb666 wants to merge 1 commit into
cherry-embedded:masterfrom
Firmament-Autopilot:host

Conversation

@Rbb666

@Rbb666 Rbb666 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Added Infineon DWC2 controller library integration to the build system
    • Optimized memory placement for USB host class management structures
    • Improved build system deduplication logic

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 481efe4d-6266-4bb1-9e3c-4908c24d70f1

📥 Commits

Reviewing files that changed from the base of the PR and between af16015 and 655b7e0.

📒 Files selected for processing (4)
  • SConscript
  • class/hub/usbh_hub.c
  • class/video/usbh_video.c
  • core/usbh_core.c

📝 Walkthrough

Walkthrough

Build system updates add Infineon DWC2 prebuilt library linking and source path deduplication. Global USB host class and bus state variables move to non-cacheable RAM sections in core and class driver files for memory layout optimization.

Changes

USB Host Build and Memory Layout

Layer / File(s) Summary
Build system improvements
SConscript
Infineon DWC2 host controller variant now links against a prebuilt usb_hc_dwc2 library. A new unique_sources() helper deduplicates source file paths to prevent redundant compilation and preserve ordering.
USB host memory section placement
core/usbh_core.c, class/hub/usbh_hub.c, class/video/usbh_video.c
Global USB host class driver state (g_hub_class, g_video_class, g_devinuse) and core bus management structures (usbh_class_info_table_begin/end, g_bus_head, g_usbhost_bus) are placed into USB_NOCACHE_RAM_SECTION for consistent non-cacheable memory layout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A hop through memory lanes so bright,
Build systems dance with dedup's might,
Cache-free zones for USB host,
The structures we treasure most—
All placed just right!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
class/hub/usbh_hub.c

class/hub/usbh_hub.c:6:10: fatal error: 'usbh_core.h' file not found
6 | #include "usbh_core.h"
| ^~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/655b7e00195b40eb125f443049f859fa4aaa20c1-23de8cc18ecab016/tmp/clang_command_.tmp.bcad58.txt
++Contents of '/tmp/coderabbit-infer/655b7e00195b40eb125f443049f859fa4aaa20c1-23de8cc18ecab016/tmp/clang_command_.tmp.bcad58.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-clea

... [truncated 688 characters] ...

pt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/23de8cc18ecab016/file.o" "-x" "c"
"class/hub/usbh_hub.c" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

class/video/usbh_video.c

class/video/usbh_video.c:6:10: fatal error: 'usbh_core.h' file not found
6 | #include "usbh_core.h"
| ^~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/655b7e00195b40eb125f443049f859fa4aaa20c1-9d00e1d3a36612bd/tmp/clang_command_.tmp.7b663b.txt
++Contents of '/tmp/coderabbit-infer/655b7e00195b40eb125f443049f859fa4aaa20c1-9d00e1d3a36612bd/tmp/clang_command_.tmp.7b663b.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-

... [truncated 698 characters] ...

nfer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/9d00e1d3a36612bd/file.o" "-x" "c"
"class/video/usbh_video.c" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

core/usbh_core.c

In file included from core/usbh_core.c:6:
core/usbh_core.h:14:10: fatal error: 'usb_config.h' file not found
14 | #include "usb_config.h"
| ^~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/655b7e00195b40eb125f443049f859fa4aaa20c1-a749940a0b0d8e85/tmp/clang_command_.tmp.24beca.txt
++Contents of '/tmp/coderabbit-infer/655b7e00195b40eb125f443049f859fa4aaa20c1-a749940a0b0d8e85/tmp/clang_command_.tmp.24beca.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj

... [truncated 727 characters] ...

"/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/a749940a0b0d8e85/file.o" "-x" "c"
"core/usbh_core.c" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Rbb666 Rbb666 closed this Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant