esp32: Rename GENERIC* boards to ESP32_GENERIC*.

Board names need to be unique across ports, and GENERIC clashes with
the ESP8266 (which will be renamed to ESP8266_GENERIC).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2023-08-15 23:49:35 +10:00
parent 97ffc53ec9
commit aa23698119
25 changed files with 38 additions and 20 deletions

View File

@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.12)
# Set the board if it's not already set. # Set the board if it's not already set.
if(NOT MICROPY_BOARD) if(NOT MICROPY_BOARD)
set(MICROPY_BOARD GENERIC) set(MICROPY_BOARD ESP32_GENERIC)
endif() endif()
# Set the board directory and check that it exists. # Set the board directory and check that it exists.

View File

@@ -8,12 +8,15 @@ ifdef BOARD_DIR
# the path as the board name. # the path as the board name.
BOARD ?= $(notdir $(BOARD_DIR:/=)) BOARD ?= $(notdir $(BOARD_DIR:/=))
else else
# If not given on the command line, then default to GENERIC. # If not given on the command line, then default to ESP32_GENERIC.
BOARD ?= GENERIC BOARD ?= ESP32_GENERIC
BOARD_DIR ?= boards/$(BOARD) BOARD_DIR ?= boards/$(BOARD)
endif endif
ifeq ($(wildcard $(BOARD_DIR)/.),) ifeq ($(wildcard $(BOARD_DIR)/.),)
ifeq ($(findstring boards/GENERIC,$(BOARD_DIR)),boards/GENERIC)
$(warning The GENERIC* boards have been renamed to ESP32_GENERIC*)
endif
$(error Invalid BOARD specified: $(BOARD_DIR)) $(error Invalid BOARD specified: $(BOARD_DIR))
endif endif

View File

@@ -93,7 +93,7 @@ $ make submodules
$ make $ make
``` ```
This will produce a combined `firmware.bin` image in the `build-GENERIC/` This will produce a combined `firmware.bin` image in the `build-ESP32_GENERIC/`
subdirectory (this firmware image is made up of: bootloader.bin, partitions.bin subdirectory (this firmware image is made up of: bootloader.bin, partitions.bin
and micropython.bin). and micropython.bin).
@@ -123,12 +123,12 @@ To flash the MicroPython firmware to your ESP32 use:
$ make deploy $ make deploy
``` ```
The default ESP32 board build by the above commands is the `GENERIC` one, which The default ESP32 board build by the above commands is the `ESP32_GENERIC`
should work on most ESP32 modules. You can specify a different board by passing one, which should work on most ESP32 modules. You can specify a different
`BOARD=<board>` to the make commands, for example: board by passing `BOARD=<board>` to the make commands, for example:
```bash ```bash
$ make BOARD=GENERIC_SPIRAM $ make BOARD=ESP32_GENERIC_S3
``` ```
Note: the above "make" commands are thin wrappers for the underlying `idf.py` Note: the above "make" commands are thin wrappers for the underlying `idf.py`
@@ -137,10 +137,25 @@ for example:
```bash ```bash
$ idf.py build $ idf.py build
$ idf.py -D MICROPY_BOARD=GENERIC_SPIRAM build $ idf.py -D MICROPY_BOARD=ESP32_GENERIC build
$ idf.py flash $ idf.py flash
``` ```
Some boards also support "variants", which are allow for small variations of
an otherwise similar board. For example different flash sizes or features. For
example to build the `OTA` variant of `ESP32_GENERIC`.
```bash
$ make BOARD=ESP32_GENERIC BOARD_VARIANT=OTA
```
or to enable octal-SPIRAM support for the `ESP32_GENERIC_S3` board:
```bash
$ make BOARD=ESP32_GENERIC BOARD_VARIANT=SPIRAM_OCT
```
Getting a Python prompt on the device Getting a Python prompt on the device
------------------------------------- -------------------------------------
@@ -202,10 +217,10 @@ antenna = machine.Pin(16, machine.Pin.OUT, value=0)
Defining a custom ESP32 board Defining a custom ESP32 board
----------------------------- -----------------------------
The default ESP-IDF configuration settings are provided by the `GENERIC` The default ESP-IDF configuration settings are provided by the `ESP32_GENERIC`
board definition in the directory `boards/GENERIC`. For a custom configuration board definition in the directory `boards/ESP32_GENERIC`. For a custom configuration
you can define your own board directory. Start a new board configuration by you can define your own board directory. Start a new board configuration by
copying an existing one (like `GENERIC`) and modifying it to suit your board. copying an existing one (like `ESP32_GENERIC`) and modifying it to suit your board.
MicroPython specific configuration values are defined in the board-specific MicroPython specific configuration values are defined in the board-specific
`mpconfigboard.h` file, which is included by `mpconfigport.h`. Additional `mpconfigboard.h` file, which is included by `mpconfigport.h`. Additional

View File

@@ -6,7 +6,7 @@ set(SDKCONFIG_DEFAULTS
if(MICROPY_BOARD_VARIANT STREQUAL "D2WD") if(MICROPY_BOARD_VARIANT STREQUAL "D2WD")
set(SDKCONFIG_DEFAULTS set(SDKCONFIG_DEFAULTS
${SDKCONFIG_DEFAULTS} ${SDKCONFIG_DEFAULTS}
boards/GENERIC/sdkconfig.d2wd boards/ESP32_GENERIC/sdkconfig.d2wd
) )
list(APPEND MICROPY_DEF_BOARD list(APPEND MICROPY_DEF_BOARD
@@ -17,7 +17,7 @@ endif()
if(MICROPY_BOARD_VARIANT STREQUAL "OTA") if(MICROPY_BOARD_VARIANT STREQUAL "OTA")
set(SDKCONFIG_DEFAULTS set(SDKCONFIG_DEFAULTS
${SDKCONFIG_DEFAULTS} ${SDKCONFIG_DEFAULTS}
boards/GENERIC/sdkconfig.ota boards/ESP32_GENERIC/sdkconfig.ota
) )
list(APPEND MICROPY_DEF_BOARD list(APPEND MICROPY_DEF_BOARD
@@ -39,7 +39,7 @@ endif()
if(MICROPY_BOARD_VARIANT STREQUAL "UNICORE") if(MICROPY_BOARD_VARIANT STREQUAL "UNICORE")
set(SDKCONFIG_DEFAULTS set(SDKCONFIG_DEFAULTS
${SDKCONFIG_DEFAULTS} ${SDKCONFIG_DEFAULTS}
boards/GENERIC/sdkconfig.unicore boards/ESP32_GENERIC/sdkconfig.unicore
) )
list(APPEND MICROPY_DEF_BOARD list(APPEND MICROPY_DEF_BOARD

View File

@@ -3,5 +3,5 @@ set(IDF_TARGET esp32c3)
set(SDKCONFIG_DEFAULTS set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base boards/sdkconfig.base
boards/sdkconfig.ble boards/sdkconfig.ble
boards/GENERIC_C3/sdkconfig.c3usb boards/ESP32_GENERIC_C3/sdkconfig.c3usb
) )

View File

@@ -5,7 +5,7 @@ set(SDKCONFIG_DEFAULTS
boards/sdkconfig.usb boards/sdkconfig.usb
boards/sdkconfig.ble boards/sdkconfig.ble
boards/sdkconfig.spiram_sx boards/sdkconfig.spiram_sx
boards/GENERIC_S3/sdkconfig.board boards/ESP32_GENERIC_S3/sdkconfig.board
) )
if(MICROPY_BOARD_VARIANT STREQUAL "SPIRAM_OCT") if(MICROPY_BOARD_VARIANT STREQUAL "SPIRAM_OCT")

View File

@@ -129,9 +129,9 @@ function ci_esp32_build {
make ${MAKEOPTS} -C ports/esp32 \ make ${MAKEOPTS} -C ports/esp32 \
USER_C_MODULES=../../../examples/usercmodule/micropython.cmake \ USER_C_MODULES=../../../examples/usercmodule/micropython.cmake \
FROZEN_MANIFEST=$(pwd)/ports/esp32/boards/manifest_test.py FROZEN_MANIFEST=$(pwd)/ports/esp32/boards/manifest_test.py
make ${MAKEOPTS} -C ports/esp32 BOARD=GENERIC_C3 make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_C3
make ${MAKEOPTS} -C ports/esp32 BOARD=GENERIC_S2 make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_S2
make ${MAKEOPTS} -C ports/esp32 BOARD=GENERIC_S3 make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_S3
# Test building native .mpy with xtensawin architecture. # Test building native .mpy with xtensawin architecture.
ci_native_mpy_modules_build xtensawin ci_native_mpy_modules_build xtensawin