Commit Graph

6 Commits

Author SHA1 Message Date
Damien George
7702f7f59d esp32/main: Update esp_hosted component to latest version 2.7.0.
This updates the esp_hosted component for ESP32-P4 boards to use the latest
version 2.7.0.  Testing on a P4 board with C6 WiFi shows there are no
regressions for WiFi or BLE.

Also rename the `CONFIG_ESP_ENABLE_BT` option to the new
`CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE` option used by the component.

This change is made partly to work around a current issue with the IDF
component manager, that esp_hosted versions after 2.0.17 and prior to
2.7.0 have all disappeared.

Signed-off-by: Damien George <damien@micropython.org>
2025-12-08 09:48:08 +11:00
Vincent1-python
e6f1f78713 esp32: Add support for ESP32-P4.
This commit adds support for ESP32-P4 SoCs.

Signed-off-by: Vincent1-python <pywei201209@163.com>
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Signed-off-by: Damien George <damien@micropython.org>
2025-12-01 13:08:52 +11:00
Angus Gratton
713f9dcd22 esp32: Fix USB Zero Length Packet issue with patched tinyusb.
Temporarily switch from the espressif TinyUSB component to
a MicroPython fork where this fix has been cherry-picked:
https://github.com/hathach/tinyusb/pull/3293

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-19 12:12:54 +11:00
Angus Gratton
4f193132d2 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>
2025-11-19 12:12:54 +11:00
Damien George
0f49a1d240 esp32: Update to use ESP-IDF v5.5.1.
Tested with ESP32_GENERIC, ESP32_GENERIC_C3, ESP32_GENERIC_C6 and
ESP32_GENERIC_S3 firmware, using the full test suite.  There do not seem to
be any regressions.

Signed-off-by: Damien George <damien@micropython.org>
2025-10-17 12:33:02 +11:00
Angus Gratton
8d5a8892d2 esp32: Add IDF Component Lockfiles to git repo.
This is recommended by Espressif, and it's the only way to ensure
everyone builds the same set of component versions.

The awkward part is that updating the ESP-IDF version will churn a line
in each of these files (and possibly other changes).

Adds a build-time check for lock file changes, which is either a warning or
a hard error depending on the value of MICROPY_MAINTAINER_BUILD
flag (introduced in previous commit).

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-09-09 11:31:42 +10:00