summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-08-15 23:49:35 +1000
committerJim Mussared <jim.mussared@gmail.com>2023-08-23 13:54:37 +1000
commitaa236981192395cda555efa3db5f490c168bebdd (patch)
tree18cab89f79e98279934dd1c129c2f1a1c16ae478
parent97ffc53ec9ff10c7585125229ef077233c77cc48 (diff)
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>
-rw-r--r--ports/esp32/CMakeLists.txt2
-rw-r--r--ports/esp32/Makefile7
-rw-r--r--ports/esp32/README.md33
-rw-r--r--ports/esp32/boards/ESP32_GENERIC/board.json (renamed from ports/esp32/boards/GENERIC/board.json)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC/board.md (renamed from ports/esp32/boards/GENERIC/board.md)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC/mpconfigboard.cmake (renamed from ports/esp32/boards/GENERIC/mpconfigboard.cmake)6
-rw-r--r--ports/esp32/boards/ESP32_GENERIC/mpconfigboard.h (renamed from ports/esp32/boards/GENERIC/mpconfigboard.h)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd (renamed from ports/esp32/boards/GENERIC/sdkconfig.d2wd)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota (renamed from ports/esp32/boards/GENERIC/sdkconfig.ota)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC/sdkconfig.unicore (renamed from ports/esp32/boards/GENERIC/sdkconfig.unicore)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_C3/board.json (renamed from ports/esp32/boards/GENERIC_C3/board.json)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_C3/board.md (renamed from ports/esp32/boards/GENERIC_C3/board.md)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake (renamed from ports/esp32/boards/GENERIC_C3/mpconfigboard.cmake)2
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.h (renamed from ports/esp32/boards/GENERIC_C3/mpconfigboard.h)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_C3/sdkconfig.c3usb (renamed from ports/esp32/boards/GENERIC_C3/sdkconfig.c3usb)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S2/board.json (renamed from ports/esp32/boards/GENERIC_S2/board.json)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S2/board.md (renamed from ports/esp32/boards/GENERIC_S2/board.md)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S2/mpconfigboard.cmake (renamed from ports/esp32/boards/GENERIC_S2/mpconfigboard.cmake)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S2/mpconfigboard.h (renamed from ports/esp32/boards/GENERIC_S2/mpconfigboard.h)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S3/board.json (renamed from ports/esp32/boards/GENERIC_S3/board.json)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S3/board.md (renamed from ports/esp32/boards/GENERIC_S3/board.md)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.cmake (renamed from ports/esp32/boards/GENERIC_S3/mpconfigboard.cmake)2
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.h (renamed from ports/esp32/boards/GENERIC_S3/mpconfigboard.h)0
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board (renamed from ports/esp32/boards/GENERIC_S3/sdkconfig.board)0
-rwxr-xr-xtools/ci.sh6
25 files changed, 38 insertions, 20 deletions
diff --git a/ports/esp32/CMakeLists.txt b/ports/esp32/CMakeLists.txt
index 4e29e9610..94047a048 100644
--- a/ports/esp32/CMakeLists.txt
+++ b/ports/esp32/CMakeLists.txt
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.12)
# Set the board if it's not already set.
if(NOT MICROPY_BOARD)
- set(MICROPY_BOARD GENERIC)
+ set(MICROPY_BOARD ESP32_GENERIC)
endif()
# Set the board directory and check that it exists.
diff --git a/ports/esp32/Makefile b/ports/esp32/Makefile
index 9d57ee4c2..bf275ffe6 100644
--- a/ports/esp32/Makefile
+++ b/ports/esp32/Makefile
@@ -8,12 +8,15 @@ ifdef BOARD_DIR
# the path as the board name.
BOARD ?= $(notdir $(BOARD_DIR:/=))
else
-# If not given on the command line, then default to GENERIC.
-BOARD ?= GENERIC
+# If not given on the command line, then default to ESP32_GENERIC.
+BOARD ?= ESP32_GENERIC
BOARD_DIR ?= boards/$(BOARD)
endif
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))
endif
diff --git a/ports/esp32/README.md b/ports/esp32/README.md
index 2d5b05b92..169de4073 100644
--- a/ports/esp32/README.md
+++ b/ports/esp32/README.md
@@ -93,7 +93,7 @@ $ make submodules
$ 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
and micropython.bin).
@@ -123,12 +123,12 @@ To flash the MicroPython firmware to your ESP32 use:
$ make deploy
```
-The default ESP32 board build by the above commands is the `GENERIC` one, which
-should work on most ESP32 modules. You can specify a different board by passing
-`BOARD=<board>` to the make commands, for example:
+The default ESP32 board build by the above commands is the `ESP32_GENERIC`
+one, which should work on most ESP32 modules. You can specify a different
+board by passing `BOARD=<board>` to the make commands, for example:
```bash
-$ make BOARD=GENERIC_SPIRAM
+$ make BOARD=ESP32_GENERIC_S3
```
Note: the above "make" commands are thin wrappers for the underlying `idf.py`
@@ -137,10 +137,25 @@ for example:
```bash
$ idf.py build
-$ idf.py -D MICROPY_BOARD=GENERIC_SPIRAM build
+$ idf.py -D MICROPY_BOARD=ESP32_GENERIC build
$ 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
-------------------------------------
@@ -202,10 +217,10 @@ antenna = machine.Pin(16, machine.Pin.OUT, value=0)
Defining a custom ESP32 board
-----------------------------
-The default ESP-IDF configuration settings are provided by the `GENERIC`
-board definition in the directory `boards/GENERIC`. For a custom configuration
+The default ESP-IDF configuration settings are provided by the `ESP32_GENERIC`
+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
-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
`mpconfigboard.h` file, which is included by `mpconfigport.h`. Additional
diff --git a/ports/esp32/boards/GENERIC/board.json b/ports/esp32/boards/ESP32_GENERIC/board.json
index 0db38c25d..0db38c25d 100644
--- a/ports/esp32/boards/GENERIC/board.json
+++ b/ports/esp32/boards/ESP32_GENERIC/board.json
diff --git a/ports/esp32/boards/GENERIC/board.md b/ports/esp32/boards/ESP32_GENERIC/board.md
index 8a669411d..8a669411d 100644
--- a/ports/esp32/boards/GENERIC/board.md
+++ b/ports/esp32/boards/ESP32_GENERIC/board.md
diff --git a/ports/esp32/boards/GENERIC/mpconfigboard.cmake b/ports/esp32/boards/ESP32_GENERIC/mpconfigboard.cmake
index 14b47b3e5..74cb591c0 100644
--- a/ports/esp32/boards/GENERIC/mpconfigboard.cmake
+++ b/ports/esp32/boards/ESP32_GENERIC/mpconfigboard.cmake
@@ -6,7 +6,7 @@ set(SDKCONFIG_DEFAULTS
if(MICROPY_BOARD_VARIANT STREQUAL "D2WD")
set(SDKCONFIG_DEFAULTS
${SDKCONFIG_DEFAULTS}
- boards/GENERIC/sdkconfig.d2wd
+ boards/ESP32_GENERIC/sdkconfig.d2wd
)
list(APPEND MICROPY_DEF_BOARD
@@ -17,7 +17,7 @@ endif()
if(MICROPY_BOARD_VARIANT STREQUAL "OTA")
set(SDKCONFIG_DEFAULTS
${SDKCONFIG_DEFAULTS}
- boards/GENERIC/sdkconfig.ota
+ boards/ESP32_GENERIC/sdkconfig.ota
)
list(APPEND MICROPY_DEF_BOARD
@@ -39,7 +39,7 @@ endif()
if(MICROPY_BOARD_VARIANT STREQUAL "UNICORE")
set(SDKCONFIG_DEFAULTS
${SDKCONFIG_DEFAULTS}
- boards/GENERIC/sdkconfig.unicore
+ boards/ESP32_GENERIC/sdkconfig.unicore
)
list(APPEND MICROPY_DEF_BOARD
diff --git a/ports/esp32/boards/GENERIC/mpconfigboard.h b/ports/esp32/boards/ESP32_GENERIC/mpconfigboard.h
index 7171a84bb..7171a84bb 100644
--- a/ports/esp32/boards/GENERIC/mpconfigboard.h
+++ b/ports/esp32/boards/ESP32_GENERIC/mpconfigboard.h
diff --git a/ports/esp32/boards/GENERIC/sdkconfig.d2wd b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd
index 7b4313b7d..7b4313b7d 100644
--- a/ports/esp32/boards/GENERIC/sdkconfig.d2wd
+++ b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd
diff --git a/ports/esp32/boards/GENERIC/sdkconfig.ota b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota
index 4a164aa6f..4a164aa6f 100644
--- a/ports/esp32/boards/GENERIC/sdkconfig.ota
+++ b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota
diff --git a/ports/esp32/boards/GENERIC/sdkconfig.unicore b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.unicore
index f0b0b5e03..f0b0b5e03 100644
--- a/ports/esp32/boards/GENERIC/sdkconfig.unicore
+++ b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.unicore
diff --git a/ports/esp32/boards/GENERIC_C3/board.json b/ports/esp32/boards/ESP32_GENERIC_C3/board.json
index 4a81d227a..4a81d227a 100644
--- a/ports/esp32/boards/GENERIC_C3/board.json
+++ b/ports/esp32/boards/ESP32_GENERIC_C3/board.json
diff --git a/ports/esp32/boards/GENERIC_C3/board.md b/ports/esp32/boards/ESP32_GENERIC_C3/board.md
index 1604b879c..1604b879c 100644
--- a/ports/esp32/boards/GENERIC_C3/board.md
+++ b/ports/esp32/boards/ESP32_GENERIC_C3/board.md
diff --git a/ports/esp32/boards/GENERIC_C3/mpconfigboard.cmake b/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake
index c8f78c161..429366afa 100644
--- a/ports/esp32/boards/GENERIC_C3/mpconfigboard.cmake
+++ b/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake
@@ -3,5 +3,5 @@ set(IDF_TARGET esp32c3)
set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base
boards/sdkconfig.ble
- boards/GENERIC_C3/sdkconfig.c3usb
+ boards/ESP32_GENERIC_C3/sdkconfig.c3usb
)
diff --git a/ports/esp32/boards/GENERIC_C3/mpconfigboard.h b/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.h
index d403e70e4..d403e70e4 100644
--- a/ports/esp32/boards/GENERIC_C3/mpconfigboard.h
+++ b/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.h
diff --git a/ports/esp32/boards/GENERIC_C3/sdkconfig.c3usb b/ports/esp32/boards/ESP32_GENERIC_C3/sdkconfig.c3usb
index d9e7c7f61..d9e7c7f61 100644
--- a/ports/esp32/boards/GENERIC_C3/sdkconfig.c3usb
+++ b/ports/esp32/boards/ESP32_GENERIC_C3/sdkconfig.c3usb
diff --git a/ports/esp32/boards/GENERIC_S2/board.json b/ports/esp32/boards/ESP32_GENERIC_S2/board.json
index 35d06f2f7..35d06f2f7 100644
--- a/ports/esp32/boards/GENERIC_S2/board.json
+++ b/ports/esp32/boards/ESP32_GENERIC_S2/board.json
diff --git a/ports/esp32/boards/GENERIC_S2/board.md b/ports/esp32/boards/ESP32_GENERIC_S2/board.md
index 3e46c0246..3e46c0246 100644
--- a/ports/esp32/boards/GENERIC_S2/board.md
+++ b/ports/esp32/boards/ESP32_GENERIC_S2/board.md
diff --git a/ports/esp32/boards/GENERIC_S2/mpconfigboard.cmake b/ports/esp32/boards/ESP32_GENERIC_S2/mpconfigboard.cmake
index 76d185d90..76d185d90 100644
--- a/ports/esp32/boards/GENERIC_S2/mpconfigboard.cmake
+++ b/ports/esp32/boards/ESP32_GENERIC_S2/mpconfigboard.cmake
diff --git a/ports/esp32/boards/GENERIC_S2/mpconfigboard.h b/ports/esp32/boards/ESP32_GENERIC_S2/mpconfigboard.h
index aaea41bcd..aaea41bcd 100644
--- a/ports/esp32/boards/GENERIC_S2/mpconfigboard.h
+++ b/ports/esp32/boards/ESP32_GENERIC_S2/mpconfigboard.h
diff --git a/ports/esp32/boards/GENERIC_S3/board.json b/ports/esp32/boards/ESP32_GENERIC_S3/board.json
index 671936c92..671936c92 100644
--- a/ports/esp32/boards/GENERIC_S3/board.json
+++ b/ports/esp32/boards/ESP32_GENERIC_S3/board.json
diff --git a/ports/esp32/boards/GENERIC_S3/board.md b/ports/esp32/boards/ESP32_GENERIC_S3/board.md
index cc902eeb8..cc902eeb8 100644
--- a/ports/esp32/boards/GENERIC_S3/board.md
+++ b/ports/esp32/boards/ESP32_GENERIC_S3/board.md
diff --git a/ports/esp32/boards/GENERIC_S3/mpconfigboard.cmake b/ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.cmake
index 29974aaba..36b4fe562 100644
--- a/ports/esp32/boards/GENERIC_S3/mpconfigboard.cmake
+++ b/ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.cmake
@@ -5,7 +5,7 @@ set(SDKCONFIG_DEFAULTS
boards/sdkconfig.usb
boards/sdkconfig.ble
boards/sdkconfig.spiram_sx
- boards/GENERIC_S3/sdkconfig.board
+ boards/ESP32_GENERIC_S3/sdkconfig.board
)
if(MICROPY_BOARD_VARIANT STREQUAL "SPIRAM_OCT")
diff --git a/ports/esp32/boards/GENERIC_S3/mpconfigboard.h b/ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.h
index 8d369c7db..8d369c7db 100644
--- a/ports/esp32/boards/GENERIC_S3/mpconfigboard.h
+++ b/ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.h
diff --git a/ports/esp32/boards/GENERIC_S3/sdkconfig.board b/ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board
index a36b97116..a36b97116 100644
--- a/ports/esp32/boards/GENERIC_S3/sdkconfig.board
+++ b/ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board
diff --git a/tools/ci.sh b/tools/ci.sh
index b9bfb7eef..55e90dc4a 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -129,9 +129,9 @@ function ci_esp32_build {
make ${MAKEOPTS} -C ports/esp32 \
USER_C_MODULES=../../../examples/usercmodule/micropython.cmake \
FROZEN_MANIFEST=$(pwd)/ports/esp32/boards/manifest_test.py
- make ${MAKEOPTS} -C ports/esp32 BOARD=GENERIC_C3
- make ${MAKEOPTS} -C ports/esp32 BOARD=GENERIC_S2
- make ${MAKEOPTS} -C ports/esp32 BOARD=GENERIC_S3
+ make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_C3
+ make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_S2
+ make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_S3
# Test building native .mpy with xtensawin architecture.
ci_native_mpy_modules_build xtensawin