tinyusb icon indicating copy to clipboard operation
tinyusb copied to clipboard

esp32s3: tools/get_deps and make BOARD=xxx get-deps fails

Open karlp opened this issue 2 months ago • 5 comments

Operating System

Linux

Commit SHA

21ed72bab119

Board

espressif_s3_devkitc

Firmware

N/A

What happened ?

As documented on https://docs.tinyusb.org/en/latest/reference/getting_started.html#dependencies you should be able to do either make -C examples/host/cdc_msc_hid_freertos BOARD=espressif_s3_devkitc get-deps or

tools/get_deps esp32 (or esp32s3)

This works for other platforms. For esp32s3 you receive for the make form:

/tinyusb/examples/host/cdc_msc_hid_freertos (master)$ make BOARD=espressif_s3_devkitc get-deps
../../build_system/make/make.mk:96: /home/karlp/src/l2-kinetis1/extern/tinyusb/hw/bsp/espressif/family.mk: No such file or directory
make: *** No rule to make target '/home/karlp/src/l2-kinetis1/extern/tinyusb/hw/bsp/espressif/family.mk'.  Stop.

and for the tools/get_deps form:

$ python tools/get_deps.py esp32s3
cloning lib/FreeRTOS-Kernel with https://github.com/FreeRTOS/FreeRTOS-Kernel.git
cloning lib/lwip with https://github.com/lwip-tcpip/lwip.git
cloning tools/uf2 with https://github.com/microsoft/uf2.git
$ python tools/get_deps.py esp32
cloning lib/FreeRTOS-Kernel with https://github.com/FreeRTOS/FreeRTOS-Kernel.git
cloning lib/lwip with https://github.com/lwip-tcpip/lwip.git
cloning tools/uf2 with https://github.com/microsoft/uf2.git
$ 

Obviously, neither of those are getting deps.

If ESP32-S3 et al aren't supported via get_deps, that should be documented more clearly....

How to reproduce ?

as above

Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)

included above

Screenshots

No response

I have checked existing issues, discussion and documentation

  • [x] I confirm I have checked existing issues, discussion and documentation.

karlp avatar Oct 08 '25 15:10 karlp

FWIW, even if you have an active ESP-IDF in your shell, that's not sufficient.

karlp avatar Oct 08 '25 15:10 karlp

I agree the doc is lagging behind, cmake support was added long ago. It would be appreciated if you could help improving the doc from a user's view, neither me or Thach speak native English.

For esp32 you can do like this:

  1. source esp-idf
  2. Enter example folder
  3. cmake -DBOARD=espressif_s3_devkitc -B build -G Ninja .
  4. cmake --build build

Or use presets (broken for esp32 ATM until #3279):

  1. source esp-idf
  2. Enter example folder
  3. cmake --preset espressif_s3_devkitc
  4. cmake --build --preset espressif_s3_devkitc

HiFiPhile avatar Oct 08 '25 17:10 HiFiPhile

Should the classic makefiles be considered deprecated? or are they intended to be supported? This is the second time I've run into things not really working with make, but working with cmake :) I will see what I can cook up with docs, but I'm mostly trying to figure out what should work first :)

karlp avatar Oct 08 '25 18:10 karlp

Should the classic makefiles be considered deprecated? or are they intended to be supported?

Makefile is still supported but only tested on Linux with GCC. CMake works also in Windows and plays nicer with IAR compiler, since more CI runs with CMake it has less chance to be broken.

For esp32 only CMake works since their SDK only support CMake.

HiFiPhile avatar Oct 08 '25 19:10 HiFiPhile

yeah, I am mostly use cmake at the moment. Also for esp, its esp-idf natively support cmake, so make in case of esp32 is only an thin wrapper to call cmake. It may not be complete. I agree I don't spend enough time on docs.

hathach avatar Oct 09 '25 02:10 hathach

For anyone wanting to build the example cdc_dualports out of the box for an stm32f103 bluepill board, this is what I had to do. unzip your copy of tinyusb "tinyusb.zip" into a folder... I used "/whatever" cd /whatever/tinyusb-0.20.0/examples/device/cdc_dual_ports make -C . BOARD=stm32f103_bluepill get-deps make -C . BOARD=stm32f103_bluepill all The resulting .bin or .hex files are then in the subfolder "_build/stm32f103_bluepill/"

HattonLe avatar Dec 15 '25 13:12 HattonLe