Skip to content

Commit 25bbc17

Browse files
committed
Build all ESP32 boards with LVGL module. Add build script for generic ESP32 SPIRAM variant
1 parent 649b30c commit 25bbc17

14 files changed

+50
-23
lines changed

ports/esp32/boards/M5STACK_CORE2/mpconfigboard.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ set(SDKCONFIG_DEFAULTS
88

99
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=1)
1010

11-
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
12-
13-
set(USER_C_MODULES ${MICROPY_BOARD_DIR}/../../../../user_modules/lv_binding_micropython/micropython.cmake)
11+
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
#define MICROPY_HW_BOARD_NAME "M5Stack Core2"
2-
#define MICROPY_HW_MCU_NAME "ESP32"
3-
4-
// Required for LVGL
5-
#define MICROPY_ENABLE_SCHEDULER (1)
6-
#define MICROPY_MODULE_BUILTIN_INIT (1)
7-
#define MICROPY_PY_SYS_SETTRACE (0)
2+
#define MICROPY_HW_MCU_NAME "ESP32"

ports/esp32/esp32_common.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ endif()
1111
# Include core source components.
1212
include(${MICROPY_DIR}/py/py.cmake)
1313

14+
set(USER_C_MODULES "${MICROPY_DIR}/user_modules/lv_binding_micropython/micropython.cmake")
15+
1416
# CMAKE_BUILD_EARLY_EXPANSION is set during the component-discovery phase of
1517
# `idf.py build`, so none of the extmod/usermod (and in reality, most of the
1618
# micropython) rules need to happen. Specifically, you cannot invoke add_library.

ports/esp32/mpconfigport.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,8 @@ void boardctrl_startup(void);
382382
#ifndef MICROPY_PY_STRING_TX_GIL_THRESHOLD
383383
#define MICROPY_PY_STRING_TX_GIL_THRESHOLD (20)
384384
#endif
385+
386+
// Required for LVGL
387+
#define MICROPY_ENABLE_SCHEDULER (1)
388+
#define MICROPY_MODULE_BUILTIN_INIT (1)
389+
#define MICROPY_PY_SYS_SETTRACE (0)

ports/esp32/partitions-16MiB-ota.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
nvs, data, nvs, 0x9000, 0x4000,
66
otadata, data, ota, 0xd000, 0x2000,
77
phy_init, data, phy, 0xf000, 0x1000,
8-
ota_0, app, ota_0, 0x10000, 0x270000,
9-
ota_1, app, ota_1, 0x280000, 0x270000,
10-
vfs, data, fat, 0x4f0000, 0xb10000,
8+
ota_0, app, ota_0, 0x10000, 0x280000,
9+
ota_1, app, ota_1, 0x290000, 0x280000,
10+
vfs, data, fat, 0x510000, 0xAD0000,

ports/esp32/partitions-16MiB.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Name, Type, SubType, Offset, Size, Flags
44
nvs, data, nvs, 0x9000, 0x6000,
55
phy_init, data, phy, 0xf000, 0x1000,
6-
factory, app, factory, 0x10000, 0x1F0000,
7-
vfs, data, fat, 0x200000, 0xE00000,
6+
factory, app, factory, 0x10000, 0x300000,
7+
vfs, data, fat, 0x310000, 0xCD0000,

ports/esp32/partitions-32MiB-ota.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
nvs, data, nvs, 0x9000, 0x4000,
66
otadata, data, ota, 0xd000, 0x2000,
77
phy_init, data, phy, 0xf000, 0x1000,
8-
ota_0, app, ota_0, 0x10000, 0x270000,
9-
ota_1, app, ota_1, 0x280000, 0x270000,
10-
vfs, data, fat, 0x4f0000, 0x1B10000,
8+
ota_0, app, ota_0, 0x10000, 0x280000,
9+
ota_1, app, ota_1, 0x290000, 0x280000,
10+
vfs, data, fat, 0x510000, 0x1AF0000,

ports/esp32/partitions-32MiB.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Name, Type, SubType, Offset, Size, Flags
44
nvs, data, nvs, 0x9000, 0x6000,
55
phy_init, data, phy, 0xf000, 0x1000,
6-
factory, app, factory, 0x10000, 0x1F0000,
7-
vfs, data, fat, 0x200000, 0x1E00000,
6+
factory, app, factory, 0x10000, 0x280000,
7+
vfs, data, fat, 0x290000, 0x1D70000,

ports/esp32/partitions-4MiB.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Name, Type, SubType, Offset, Size, Flags
44
nvs, data, nvs, 0x9000, 0x6000,
55
phy_init, data, phy, 0xf000, 0x1000,
6-
factory, app, factory, 0x10000, 0x240000,
7-
vfs, data, fat, 0x250000, 0x1b0000,
6+
factory, app, factory, 0x10000, 0x300000,
7+
vfs, data, fat, 0x310000, 0x0F0000,

ports/esp32/partitions-8MiB.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Name, Type, SubType, Offset, Size, Flags
44
nvs, data, nvs, 0x9000, 0x6000,
55
phy_init, data, phy, 0xf000, 0x1000,
6-
factory, app, factory, 0x10000, 0x1F0000,
7-
vfs, data, fat, 0x200000, 0x600000,
6+
factory, app, factory, 0x10000, 0x300000,
7+
vfs, data, fat, 0x310000, 0x4F0000,

scripts/build-generic-spiram.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Build MicroPython-LVGL firmware for: Generic ESP32 boards
2+
3+
source env-variables-micropython.sh
4+
source env-variables-esp32.sh
5+
6+
BOARD=ESP32_GENERIC
7+
VARIANT=SPIRAM
8+
9+
cd $MICROPYTHON
10+
make -C mpy-cross
11+
12+
cd $MICROPYTHON/ports/esp32
13+
make submodules
14+
make BOARD=$BOARD VARIANT=$VARIANT

scripts/build-m5core2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ cd $MICROPYTHON
99
make -C mpy-cross
1010

1111
cd $MICROPYTHON/ports/esp32
12+
make submodules
1213
make BOARD=$BOARD

scripts/deploy-generic-spiram.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Deploy firmware to device: Generic ESP32 boards
2+
3+
source env-variables-micropython.sh
4+
source env-variables-esp32.sh
5+
6+
BOARD=ESP32_GENERIC
7+
VARIANT=SPIRAM
8+
9+
cd $MICROPYTHON/ports/esp32
10+
make deploy BOARD=$BOARD VARIANT=$VARIANT

scripts/env-variables-esp32.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22

33
ESPIDF=~/esp/esp-idf-5-2-3
44

5+
BOARD=ESP32_GENERIC
6+
57
source $ESPIDF/export.sh
68

0 commit comments

Comments
 (0)