summaryrefslogtreecommitdiff
path: root/ports/esp32/esp32_common.cmake
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2025-11-12 15:48:59 +1100
committerDamien George <damien@micropython.org>2025-11-19 12:12:54 +1100
commit4f193132d2de4b464bbed29c9029727440da486a (patch)
tree5ce2a0fcf82fbe10b2823d7f73572b942f56cf40 /ports/esp32/esp32_common.cmake
parenta435e4ecfd87b8aa7720d0429acbd4043965b7e5 (diff)
esp32: Remove dependency on esp_tinyusb.
Instead, depend directly on espressif/tinyusb component (which is otherwise transitively included via esp_tinyusb). Turns out esp_tinyusb builds a bunch of source files with symbols that conflict with our tinyusb symbols (i.e. descriptors_control.c). This only works because nothing in MicroPython causes the linker to include the esp_tinyusb.a library, however in order to override the dcd_int_handler (in following commit) this caused the linker to pull this library in and break the build. There's also a problematic header skew - TinyUSB component was building with the tusb_config.h file from esp_tinyusb component, but we have our own tusb_config.h file in shared/tinyusb. The changes in parent commit allow us to build the TinyUSB component with our tusb_config.h header. User-facing impacts are: - Can no longer override USB VID & PID via sdkconfig, have to set MICROPY_HW_USB_VID/PID instead (changes applied in this commit). - esp32 boards will have the same USB serial number as other ports (i.e. based on the hardware MAC address, not hard-coded). Side effects include: - CFG_TUD_DWC2_SLAVE_ENABLE is now set, DMA mode is disabled. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'ports/esp32/esp32_common.cmake')
-rw-r--r--ports/esp32/esp32_common.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/esp32/esp32_common.cmake b/ports/esp32/esp32_common.cmake
index 6922ac5fe..807d71283 100644
--- a/ports/esp32/esp32_common.cmake
+++ b/ports/esp32/esp32_common.cmake
@@ -97,6 +97,14 @@ if(MICROPY_PY_TINYUSB)
list(APPEND MICROPY_INC_TINYUSB
${MICROPY_DIR}/shared/tinyusb/
)
+
+ # Build the Espressif tinyusb component with MicroPython shared/tinyusb/tusb_config.h
+ idf_component_get_property(tusb_lib espressif__tinyusb COMPONENT_LIB)
+ target_include_directories(${tusb_lib} PRIVATE
+ ${MICROPY_DIR}/shared/tinyusb
+ ${MICROPY_DIR}
+ ${MICROPY_PORT_DIR}
+ ${MICROPY_BOARD_DIR})
endif()
list(APPEND MICROPY_SOURCE_PORT