Files
micropython/ports/esp32/boards/ARDUINO_NANO_ESP32/mpconfigboard.h
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

35 lines
1.2 KiB
C

#define MICROPY_HW_BOARD_NAME "Arduino Nano ESP32"
#define MICROPY_HW_MCU_NAME "ESP32S3"
// Network config
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-nano-esp32"
#define MICROPY_HW_I2C0_SCL (12)
#define MICROPY_HW_I2C0_SDA (11)
#define MICROPY_HW_I2C1_SCL (8)
#define MICROPY_HW_I2C1_SDA (9)
#define MICROPY_HW_SPI1_MOSI (38)
#define MICROPY_HW_SPI1_MISO (47)
#define MICROPY_HW_SPI1_SCK (48)
#define MICROPY_HW_SPI2_MOSI (10)
#define MICROPY_HW_SPI2_MISO (17)
#define MICROPY_HW_SPI2_SCK (18)
#define MICROPY_HW_ENABLE_USBDEV (1)
#define MICROPY_HW_USB_CDC_1200BPS_TOUCH (1)
#define MICROPY_SCHEDULER_STATIC_NODES (1)
#define MICROPY_HW_USB_VID 0x2341
#define MICROPY_HW_USB_PID 0x056B
#define MICROPY_HW_USB_MANUFACTURER_STRING "Arduino"
#define MICROPY_HW_USB_PRODUCT_FS_STRING "Nano ESP32"
#define MICROPY_BOARD_STARTUP NANO_ESP32_board_startup
void NANO_ESP32_board_startup(void);
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args) NANO_ESP32_enter_bootloader()
void NANO_ESP32_enter_bootloader(void);