Build all ESP32 boards with LVGL module. Add build script for generic ESP32 SPIRAM variant

This commit is contained in:
Gabor Peresztegi 2025-03-05 00:36:24 +01:00
parent 649b30cef2
commit 25bbc174dc
14 changed files with 50 additions and 23 deletions

View File

@ -9,5 +9,3 @@ set(SDKCONFIG_DEFAULTS
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=1)
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
set(USER_C_MODULES ${MICROPY_BOARD_DIR}/../../../../user_modules/lv_binding_micropython/micropython.cmake)

View File

@ -1,7 +1,2 @@
#define MICROPY_HW_BOARD_NAME "M5Stack Core2"
#define MICROPY_HW_MCU_NAME "ESP32"
// Required for LVGL
#define MICROPY_ENABLE_SCHEDULER (1)
#define MICROPY_MODULE_BUILTIN_INIT (1)
#define MICROPY_PY_SYS_SETTRACE (0)

View File

@ -11,6 +11,8 @@ endif()
# Include core source components.
include(${MICROPY_DIR}/py/py.cmake)
set(USER_C_MODULES "${MICROPY_DIR}/user_modules/lv_binding_micropython/micropython.cmake")
# CMAKE_BUILD_EARLY_EXPANSION is set during the component-discovery phase of
# `idf.py build`, so none of the extmod/usermod (and in reality, most of the
# micropython) rules need to happen. Specifically, you cannot invoke add_library.

View File

@ -382,3 +382,8 @@ void boardctrl_startup(void);
#ifndef MICROPY_PY_STRING_TX_GIL_THRESHOLD
#define MICROPY_PY_STRING_TX_GIL_THRESHOLD (20)
#endif
// Required for LVGL
#define MICROPY_ENABLE_SCHEDULER (1)
#define MICROPY_MODULE_BUILTIN_INIT (1)
#define MICROPY_PY_SYS_SETTRACE (0)

View File

@ -5,6 +5,6 @@
nvs, data, nvs, 0x9000, 0x4000,
otadata, data, ota, 0xd000, 0x2000,
phy_init, data, phy, 0xf000, 0x1000,
ota_0, app, ota_0, 0x10000, 0x270000,
ota_1, app, ota_1, 0x280000, 0x270000,
vfs, data, fat, 0x4f0000, 0xb10000,
ota_0, app, ota_0, 0x10000, 0x280000,
ota_1, app, ota_1, 0x290000, 0x280000,
vfs, data, fat, 0x510000, 0xAD0000,

1 # Partition table for MicroPython with OTA support using 16MB flash
5 nvs, data, nvs, 0x9000, 0x4000,
6 otadata, data, ota, 0xd000, 0x2000,
7 phy_init, data, phy, 0xf000, 0x1000,
8 ota_0, app, ota_0, 0x10000, 0x270000, ota_0, app, ota_0, 0x10000, 0x280000,
9 ota_1, app, ota_1, 0x280000, 0x270000, ota_1, app, ota_1, 0x290000, 0x280000,
10 vfs, data, fat, 0x4f0000, 0xb10000, vfs, data, fat, 0x510000, 0xAD0000,

View File

@ -3,5 +3,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x1F0000,
vfs, data, fat, 0x200000, 0xE00000,
factory, app, factory, 0x10000, 0x300000,
vfs, data, fat, 0x310000, 0xCD0000,

1 # Notes: the offset of the partition table itself is set in
3 # Name, Type, SubType, Offset, Size, Flags
4 nvs, data, nvs, 0x9000, 0x6000,
5 phy_init, data, phy, 0xf000, 0x1000,
6 factory, app, factory, 0x10000, 0x1F0000, factory, app, factory, 0x10000, 0x300000,
7 vfs, data, fat, 0x200000, 0xE00000, vfs, data, fat, 0x310000, 0xCD0000,

View File

@ -5,6 +5,6 @@
nvs, data, nvs, 0x9000, 0x4000,
otadata, data, ota, 0xd000, 0x2000,
phy_init, data, phy, 0xf000, 0x1000,
ota_0, app, ota_0, 0x10000, 0x270000,
ota_1, app, ota_1, 0x280000, 0x270000,
vfs, data, fat, 0x4f0000, 0x1B10000,
ota_0, app, ota_0, 0x10000, 0x280000,
ota_1, app, ota_1, 0x290000, 0x280000,
vfs, data, fat, 0x510000, 0x1AF0000,

1 # Partition table for MicroPython with OTA support using 32MB flash
5 nvs, data, nvs, 0x9000, 0x4000,
6 otadata, data, ota, 0xd000, 0x2000,
7 phy_init, data, phy, 0xf000, 0x1000,
8 ota_0, app, ota_0, 0x10000, 0x270000, ota_0, app, ota_0, 0x10000, 0x280000,
9 ota_1, app, ota_1, 0x280000, 0x270000, ota_1, app, ota_1, 0x290000, 0x280000,
10 vfs, data, fat, 0x4f0000, 0x1B10000, vfs, data, fat, 0x510000, 0x1AF0000,

View File

@ -3,5 +3,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x1F0000,
vfs, data, fat, 0x200000, 0x1E00000,
factory, app, factory, 0x10000, 0x280000,
vfs, data, fat, 0x290000, 0x1D70000,

1 # Notes: the offset of the partition table itself is set in
3 # Name, Type, SubType, Offset, Size, Flags
4 nvs, data, nvs, 0x9000, 0x6000,
5 phy_init, data, phy, 0xf000, 0x1000,
6 factory, app, factory, 0x10000, 0x1F0000, factory, app, factory, 0x10000, 0x280000,
7 vfs, data, fat, 0x200000, 0x1E00000, vfs, data, fat, 0x290000, 0x1D70000,

View File

@ -3,5 +3,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x240000,
vfs, data, fat, 0x250000, 0x1b0000,
factory, app, factory, 0x10000, 0x300000,
vfs, data, fat, 0x310000, 0x0F0000,

1 # Notes: the offset of the partition table itself is set in
3 # Name, Type, SubType, Offset, Size, Flags
4 nvs, data, nvs, 0x9000, 0x6000,
5 phy_init, data, phy, 0xf000, 0x1000,
6 factory, app, factory, 0x10000, 0x240000, factory, app, factory, 0x10000, 0x300000,
7 vfs, data, fat, 0x250000, 0x1b0000, vfs, data, fat, 0x310000, 0x0F0000,

View File

@ -3,5 +3,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x1F0000,
vfs, data, fat, 0x200000, 0x600000,
factory, app, factory, 0x10000, 0x300000,
vfs, data, fat, 0x310000, 0x4F0000,

1 # Notes: the offset of the partition table itself is set in
3 # Name, Type, SubType, Offset, Size, Flags
4 nvs, data, nvs, 0x9000, 0x6000,
5 phy_init, data, phy, 0xf000, 0x1000,
6 factory, app, factory, 0x10000, 0x1F0000, factory, app, factory, 0x10000, 0x300000,
7 vfs, data, fat, 0x200000, 0x600000, vfs, data, fat, 0x310000, 0x4F0000,

14
scripts/build-generic-spiram.sh Executable file
View File

@ -0,0 +1,14 @@
# Build MicroPython-LVGL firmware for: Generic ESP32 boards
source env-variables-micropython.sh
source env-variables-esp32.sh
BOARD=ESP32_GENERIC
VARIANT=SPIRAM
cd $MICROPYTHON
make -C mpy-cross
cd $MICROPYTHON/ports/esp32
make submodules
make BOARD=$BOARD VARIANT=$VARIANT

View File

@ -9,4 +9,5 @@ cd $MICROPYTHON
make -C mpy-cross
cd $MICROPYTHON/ports/esp32
make submodules
make BOARD=$BOARD

View File

@ -0,0 +1,10 @@
# Deploy firmware to device: Generic ESP32 boards
source env-variables-micropython.sh
source env-variables-esp32.sh
BOARD=ESP32_GENERIC
VARIANT=SPIRAM
cd $MICROPYTHON/ports/esp32
make deploy BOARD=$BOARD VARIANT=$VARIANT

View File

@ -2,5 +2,7 @@
ESPIDF=~/esp/esp-idf-5-2-3
BOARD=ESP32_GENERIC
source $ESPIDF/export.sh