8000 esp32: Rename GENERIC* boards to ESP32_GENERIC*. · micropython/micropython@21f4eb4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 21f4eb4

Browse files
committed
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>
1 parent 6b27abf commit 21f4eb4

24 files changed

+32
-17
lines changed

ports/esp32/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.12)
44

55
# Set the board if it's not already set.
66
if(NOT MICROPY_BOARD)
7-
set(MICROPY_BOARD GENERIC)
7+
set(MICROPY_BOARD ESP32_GENERIC)
88
endif()
99

1010
# Set the board directory and check that it exists.

ports/esp32/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ifdef BOARD_DIR
88
# the path as the board name.
99
BOARD ?= $(notdir $(BOARD_DIR:/=))
1010
else
11-
# If not given on the command line, then default to GENERIC.
12-
BOARD ?= GENERIC
11+
# If not given on the command line, then default to ESP32_GENERIC.
12+
BOARD ?= ESP32_GENERIC
1313
BOARD_DIR ?= boards/$(BOARD)
1414
endif
1515

ports/esp32/README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ $ make submodules
9393
$ make
9494
```
9595

96-
This will produce a combined `firmware.bin` image in the `build-GENERIC/`
96+
This will produce a combined `firmware.bin` image in the `build-ESP32_GENERIC/`
9797
subdirectory (this firmware image is made up of: bootloader.bin, partitions.bin
9898
and micropython.bin).
9999

@@ -123,12 +123,12 @@ To flash the MicroPython firmware to your ESP32 use:
123123
$ make deploy
124124
```
125125

126-
The default ESP32 board build by the above commands is the `GENERIC` one, which
127-
should work on most ESP32 modules. You can specify a different board by passing
128-
`BOARD=<board>` to the make commands, for example:
126+
The default ESP32 board build by the above commands is the `ESP32_GENERIC`
127+
one, which should work on most ESP32 modules. You can specify a different
128+
board by passing `BOARD=<board>` to the make commands, for example:
129129

130130
```bash
131-
$ make BOARD=GENERIC_SPIRAM
131+
$ make BOARD=ESP32_GENERIC_S3
132132
```
133133

134134
Note: the above "make" commands are thin wrappers for the underlying `idf.py`
@@ -137,10 +137,25 @@ for example:
137137

138138
```bash
139139
$ idf.py build
140-
$ idf.py -D MICROPY_BOARD=GENERIC_SPIRAM build
140+
$ idf.py -D MICROPY_BOARD=ESP32_GENERIC build
141141
$ idf.py flash
142142
```
143143

144+
Some boards also support "variants", which are allow for small variations of
145+
an otherwise similar board. For example different flash sizes or features. For
146+
example to build the `OTA` variant of `ESP32_GENERIC`.
147+
148+
```bash
149+
$ make BOARD=ESP32_GENERIC BOARD_VARIANT=OTA
150+
```
151+
152+
or to enable octal-SPIRAM support for the `ESP32_GENERIC_S3` board:
153+
154+
```bash
155+
$ make BOARD=ESP32_GENERIC BOARD_VARIANT=SPIRAM_OCT
156+
```
157+
158+
144159
Getting a Python prompt on the device
145160
-------------------------------------
146161

@@ -202,10 +217,10 @@ antenna = machine.Pin(16, machine.Pin.OUT, value=0)
202217
Defining a custom ESP32 board
203218
-----------------------------
204219

205-
The default ESP-IDF configuration settings are provided by the `GENERIC`
206-
board definition in the directory `boards/GENERIC`. For a custom configuration
220+
The default ESP-IDF configuration settings are provided by the `ESP32_GENERIC`
221+
board definition in the directory `boards/ESP32_GENERIC`. For a custom configuration
207222
you can define your own board directory. Start a new board configuration by
208-
copying an existing one (like `GENERIC`) and modifying it to suit your board.
223+
copying an existing one (like `ESP32_GENERIC`) and modifying it to suit your board.
209224

210225
MicroPython specific configuration values are defined in the board-specif 341A ic
211226
`mpconfigboard.h` file, which is included by `mpconfigport.h`. Additional

ports/esp32/boards/GENERIC/mpconfigboard.cmake renamed to ports/esp32/boards/ESP32_GENERIC/mpconfigboard.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(SDKCONFIG_DEFAULTS
66
if(MICROPY_BOARD_VARIANT STREQUAL "D2WD")
77
set(SDKCONFIG_DEFAULTS
88
${SDKCONFIG_DEFAULTS}
9-
boards/GENERIC/sdkconfig.d2wd
9+
boards/ESP32_GENERIC/sdkconfig.d2wd
1010
)
1111

1212
list(APPEND MICROPY_DEF_BOARD
@@ -17,7 +17,7 @@ endif()
1717
if(MICROPY_BOARD_VARIANT STREQUAL "OTA")
1818
set(SDKCONFIG_DEFAULTS
1919
${SDKCONFIG_DEFAULTS}
20-
boards/GENERIC/sdkconfig.ota
20+
boards/ESP32_GENERIC/sdkconfig.ota
2121
)
2222

2323
list(APPEND MICROPY_DEF_BOARD
@@ -39,7 +39,7 @@ endif()
3939
if(MICROPY_BOARD_VARIANT STREQUAL "UNICORE")
4040
set(SDKCONFIG_DEFAULTS
4141
${SDKCONFIG_DEFAULTS}
42-
boards/GENERIC/sdkconfig.unicore
42+
boards/ESP32_GENERIC/sdkconfig.unicore
4343
)
4444

4545
list(APPEND MICROPY_DEF_BOARD

0 commit comments

Comments
 (0)
0