diff --git a/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.cmake b/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.cmake index 7c78f9a14..045977a59 100644 --- a/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.cmake +++ b/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.cmake @@ -8,6 +8,4 @@ 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) \ No newline at end of file +set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) \ No newline at end of file diff --git a/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.h b/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.h index 1a7338f7c..23b2446cd 100644 --- a/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.h +++ b/ports/esp32/boards/M5STACK_CORE2/mpconfigboard.h @@ -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) \ No newline at end of file +#define MICROPY_HW_MCU_NAME "ESP32" \ No newline at end of file diff --git a/ports/esp32/esp32_common.cmake b/ports/esp32/esp32_common.cmake index 565f6feec..750d8e5c6 100644 --- a/ports/esp32/esp32_common.cmake +++ b/ports/esp32/esp32_common.cmake @@ -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. diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h index e36d12bc0..752fbaa0d 100644 --- a/ports/esp32/mpconfigport.h +++ b/ports/esp32/mpconfigport.h @@ -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) \ No newline at end of file diff --git a/ports/esp32/partitions-16MiB-ota.csv b/ports/esp32/partitions-16MiB-ota.csv index a6f83bc46..ee0bbe554 100644 --- a/ports/esp32/partitions-16MiB-ota.csv +++ b/ports/esp32/partitions-16MiB-ota.csv @@ -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, diff --git a/ports/esp32/partitions-16MiB.csv b/ports/esp32/partitions-16MiB.csv index ae926c7b9..fe9e0a02c 100644 --- a/ports/esp32/partitions-16MiB.csv +++ b/ports/esp32/partitions-16MiB.csv @@ -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, diff --git a/ports/esp32/partitions-32MiB-ota.csv b/ports/esp32/partitions-32MiB-ota.csv index 7366a2ad8..15d9ed6ca 100644 --- a/ports/esp32/partitions-32MiB-ota.csv +++ b/ports/esp32/partitions-32MiB-ota.csv @@ -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, diff --git a/ports/esp32/partitions-32MiB.csv b/ports/esp32/partitions-32MiB.csv index 31591c994..be3edc300 100644 --- a/ports/esp32/partitions-32MiB.csv +++ b/ports/esp32/partitions-32MiB.csv @@ -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, diff --git a/ports/esp32/partitions-4MiB.csv b/ports/esp32/partitions-4MiB.csv index e7987e6ff..7effb8340 100644 --- a/ports/esp32/partitions-4MiB.csv +++ b/ports/esp32/partitions-4MiB.csv @@ -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, diff --git a/ports/esp32/partitions-8MiB.csv b/ports/esp32/partitions-8MiB.csv index 582d3b50e..004554f44 100644 --- a/ports/esp32/partitions-8MiB.csv +++ b/ports/esp32/partitions-8MiB.csv @@ -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, diff --git a/scripts/build-generic-spiram.sh b/scripts/build-generic-spiram.sh new file mode 100755 index 000000000..2f48d7b82 --- /dev/null +++ b/scripts/build-generic-spiram.sh @@ -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 diff --git a/scripts/build-m5core2.sh b/scripts/build-m5core2.sh index 178a4550e..341bd415a 100755 --- a/scripts/build-m5core2.sh +++ b/scripts/build-m5core2.sh @@ -9,4 +9,5 @@ cd $MICROPYTHON make -C mpy-cross cd $MICROPYTHON/ports/esp32 +make submodules make BOARD=$BOARD diff --git a/scripts/deploy-generic-spiram.sh b/scripts/deploy-generic-spiram.sh new file mode 100755 index 000000000..cf76f73cb --- /dev/null +++ b/scripts/deploy-generic-spiram.sh @@ -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 diff --git a/scripts/env-variables-esp32.sh b/scripts/env-variables-esp32.sh index 1a2af4c7f..bf3906dc0 100755 --- a/scripts/env-variables-esp32.sh +++ b/scripts/env-variables-esp32.sh @@ -2,5 +2,7 @@ ESPIDF=~/esp/esp-idf-5-2-3 +BOARD=ESP32_GENERIC + source $ESPIDF/export.sh