Skip to content

Commit f57bad1

Browse files
author
Michael O'Cleirigh
committed
[esp32] update MICROLITE board config for latest micropython
I copied the micropython board ESP32_GENERIC and replaced MICROLITE with minor adjustments to enable the microlite module and the name of the board.
1 parent bd91b47 commit f57bad1

File tree

14 files changed

+167
-100
lines changed

14 files changed

+167
-100
lines changed

boards/esp32/MICROLITE/CMakeLists.txt

Lines changed: 0 additions & 34 deletions
This file was deleted.

boards/esp32/MICROLITE/board.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"docs": "",
6+
"features": [
7+
"BLE",
8+
"External Flash",
9+
"WiFi"
10+
],
11+
"images": [
12+
"esp32_devkitc.jpg"
13+
],
14+
"mcu": "esp32",
15+
"product": "ESP32 / WROOM",
16+
"thumbnail": "",
17+
"url": "https://www.espressif.com/en/products/modules",
18+
"variants": {
19+
"IDF3": "Compiled with IDF 3.x",
20+
"D2WD": "ESP32 D2WD",
21+
"SPIRAM": "Support for SPIRAM / WROVER",
22+
"UNICORE": "ESP32 Unicore",
23+
"OTA": "Support for OTA"
24+
},
25+
"vendor": "Espressif"
26+
}

boards/esp32/MICROLITE/board.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The following files are firmware that should work on most ESP32-based boards
2+
with 4MiB of flash, including WROOM WROVER, SOLO, PICO, and MINI modules.
3+
4+
If your board is based on a WROVER module, or otherwise has SPIRAM (also known
5+
as PSRAM), then use the "spiram" variant.
6+
7+
The "d2wd" variant is for ESP32-D2WD chips (with 2MiB flash), and "unicore" is
8+
for single-core ESP32 chips (e.g. the "SOLO" modules). The "ota" variant sets
9+
up the partition table to allow for Over-the-Air updates.

boards/esp32/MICROLITE/main/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,58 @@
1-
set (IDF_TARGET esp32)
2-
31
set(SDKCONFIG_DEFAULTS
4-
${MICROPY_PORT_DIR}/boards/sdkconfig.base
5-
${MICROPY_PORT_DIR}/boards/sdkconfig.ble
6-
${MICROPY_PORT_DIR}/boards/sdkconfig.240mhz
7-
${MICROPY_BOARD_DIR}/sdkconfig.partition
8-
2+
boards/sdkconfig.base
3+
boards/sdkconfig.ble
4+
../../../../boards/esp32/ESP32_GENERIC/sdkconfig.partition
95
)
106

11-
message (STATUS "mpconfigboard.cmake: PROJECT_DIR=${PROJECT_DIR}")
7+
if(MICROPY_BOARD_VARIANT STREQUAL "D2WD")
8+
set(SDKCONFIG_DEFAULTS
9+
${SDKCONFIG_DEFAULTS}
10+
boards/ESP32_GENERIC/sdkconfig.d2wd
11+
)
12+
13+
list(APPEND MICROPY_DEF_BOARD
14+
MICROPY_HW_MCU_NAME="ESP32-D2WD"
15+
)
16+
endif()
17+
18+
if(MICROPY_BOARD_VARIANT STREQUAL "OTA")
19+
set(SDKCONFIG_DEFAULTS
20+
${SDKCONFIG_DEFAULTS}
21+
boards/ESP32_GENERIC/sdkconfig.ota
22+
)
23+
24+
list(APPEND MICROPY_DEF_BOARD
25+
MICROPY_HW_BOARD_NAME="Generic ESP32 module with OTA"
26+
)
27+
endif()
28+
29+
if(MICROPY_BOARD_VARIANT STREQUAL "SPIRAM")
30+
set(SDKCONFIG_DEFAULTS
31+
${SDKCONFIG_DEFAULTS}
32+
boards/sdkconfig.spiram
33+
)
34+
35+
list(APPEND MICROPY_DEF_BOARD
36+
MICROPY_HW_BOARD_NAME="Generic ESP32 module with SPIRAM"
37+
)
38+
endif()
39+
40+
if(MICROPY_BOARD_VARIANT STREQUAL "UNICORE")
41+
set(SDKCONFIG_DEFAULTS
42+
${SDKCONFIG_DEFAULTS}
43+
boards/ESP32_GENERIC/sdkconfig.unicore
44+
)
45+
46+
list(APPEND MICROPY_DEF_BOARD
47+
MICROPY_HW_MCU_NAME="ESP32-UNICORE"
48+
)
49+
endif()
50+
1251

1352
set(USER_C_MODULES
14-
${PROJECT_DIR}/micropython-modules/micropython.cmake
53+
${CMAKE_CURRENT_LIST_DIR}/../../../micropython-modules/micropython.cmake
1554
)
1655

17-
if(NOT MICROPY_FROZEN_MANIFEST)
18-
set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py)
19-
endif()
56+
# set (COMPONENTS esp-tflite-micro)
57+
# list(APPEND IDF_COMPONENTS esp-tflite-micro)
58+
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../dependencies/tflite-micro-esp-examples/components/esp-tflite-micro)
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
#define MICROPY_HW_BOARD_NAME "ESP32 module (microlite)"
2-
#define MICROPY_HW_MCU_NAME "ESP32"
1+
// Both of these can be set by mpconfigboard.cmake if a BOARD_VARIANT is
2+
// specified.
3+
4+
#ifndef MICROPY_HW_BOARD_NAME
5+
#define MICROPY_HW_BOARD_NAME "Microlite ESP32 module"
6+
#endif
7+
8+
#ifndef MICROPY_HW_MCU_NAME
9+
#define MICROPY_HW_MCU_NAME "Microlite ESP32"
10+
#endif
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Optimise using -Os to reduce size
2+
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
3+
CONFIG_COMPILER_OPTIMIZATION_PERF=n
4+
CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y
5+
6+
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
7+
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
8+
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
9+
CONFIG_PARTITION_TABLE_CUSTOM=y
10+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MiB.csv"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
2+
CONFIG_PARTITION_TABLE_CUSTOM=y
3+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MiB-ota.csv"
4+
5+
# Reduce firmware size to fit in the OTA partition.
6+
CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y

boards/esp32/MICROLITE/sdkconfig.partition

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
#CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
55
CONFIG_PARTITION_TABLE_CUSTOM=y
66
# move back up from micropython/ports/esp32 to the main project source code
7-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../boards/esp32/MICROLITE/custom-partitions.csv"
7+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../../boards/esp32/ESP32_GENERIC/custom-partitions.csv"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_FREERTOS_UNICORE=y

0 commit comments

Comments
 (0)