EspTinyUSB icon indicating copy to clipboard operation
EspTinyUSB copied to clipboard

hal/usb_hal.h missing in Arduino

Open mortenp opened this issue 1 year ago • 10 comments
trafficstars

For both ESP32S3 andESP32S2, on both MacOS and Windows, I am missing usb_hal.h Boards are up to date with esp32 boards v. 3.0.1

This is the only library where I get this compilation error, but I have no idea whether it's a dependency on another library, or a file I'm supposed to find somewhere else.

/Arduino/libraries/ESP32TinyUSB/src/esptinyusb.cpp:3:10: fatal error: hal/usb_hal.h: No such file or directory 3 | #include "hal/usb_hal.h" | ^~~~~~~~~~~~~~~ compilation terminated. exit status 1

mortenp avatar Jun 23 '24 16:06 mortenp

Hi, probably my library is not compatible with arduino-esp32 v3.x. Im guessing that this header file change name in esp-idf 5.x.

chegewara avatar Jun 24 '24 01:06 chegewara

Hi, Will you update your library for esp32 v3 ? It could help me. Thanks.

sebcbien37 avatar Aug 01 '24 12:08 sebcbien37

Not in the near future, sorry.

chegewara avatar Aug 01 '24 21:08 chegewara

hi, i got the same error in that new library https://github.com/chegewara/esp32-usb-v2/issues/12

imakin avatar Sep 09 '24 11:09 imakin

Hi, has anyone solved this issue yet? I really need a solution.

LJH666666666 avatar Nov 09 '24 08:11 LJH666666666

No, I always use the ESP32 lib in 2.0.17

sebcbien37 avatar Nov 12 '24 08:11 sebcbien37

Ran into the same issue. Anyone knows a solution?

mabuware avatar Mar 08 '25 15:03 mabuware

The following settings work for me with pio:

board = esp32-s2-saola-1
framework = arduino
platform = [email protected]
board_build.mcu = esp32s2

[email protected] and newer are not working.

Steffen-W avatar Apr 10 '25 09:04 Steffen-W

The best thing for me now is to switch to TinyUSB. I couldn't use it in my old code because it wasn't available yet. But now it is available.

[env:esp32-s2-saola-1]
board = esp32-s2-saola-1
framework = arduino
board_build.arduino.usb = native
platform = [email protected]
board_build.mcu = esp32s2
#include "USB.h"
#include "USBCDC.h"

USBCDC USBSerial;

void setup() {
  USB.begin();
  USBSerial.begin();

  while (!USBSerial) delay(100);

  USBSerial.println("Native USB Serial");
}

void loop() {
  USBSerial.println("Ping!");
  delay(1000);
}

Steffen-W avatar Apr 11 '25 09:04 Steffen-W

Thanks @Steffen-W for all info.

chegewara avatar Apr 15 '25 20:04 chegewara