Skip to content

Compilation and file saving errors #396

@zhou19830318

Description

@zhou19830318

Describe the bug
Thank you so much for reading my question,I am using esp32s3FN8+gc9a01 display, the command to compile is: python3 make.py esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=gc9a01 INDEV=cst816s, compiled and burned Firmware, reboot after saving the written file。

Images

Image

If you are having a problem compiling paste the build output below. (NO SCREENSHOTS)

[2337/2340] Building C object CMakeFiles/micropython.elf.dir/home/codespace/esp/lvgl_micropython/ext_mod/lcd_utils/src/bi[2338/2340] Linking CXX executable micropython.elf                                                                       [2339/2340] Generating binary image from built executable
esptool.py v4.9.0
Creating esp32s3 image...
Merged 3 ELF sections
Successfully created esp32s3 image.
Generated /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
[2340/2340] cd /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esptool_py && /root/.espressif/python_env/idf5.4_py3.12_env/bin/python /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/partition_table/partition-table.bin /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
FAILED: esp-idf/esptool_py/CMakeFiles/app_check_size /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esptool_py/CMakeFiles/app_check_size
cd /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esptool_py && /root/.espressif/python_env/idf5.4_py3.12_env/bin/python /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/partition_table/partition-table.bin /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
Error: app partition is too small for binary micropython.bin size 0x279730:
- Part 'factory' 0/0 @ 0x10000 size 0x25a000 (overflow 0x1f730)
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/log/idf_py_stderr_output_17676 and /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/log/idf_py_stdout_output_17676
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: Leaving directory '/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32'
make: *** [Makefile:77: all] Error 1


***** Resizing Partition *****

***** Running build again *****

make: Entering directory '/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Executing action: all (aliases: build)
Running ninja in directory /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT
Executing "ninja all"...
-- Building ESP-IDF components for target esp32s3
NOTICE: Processing 4 dependencies:
NOTICE: [1/4] espressif/esp_tinyusb (1.0.3)
NOTICE: [2/4] espressif/mdns (1.1.0)
NOTICE: [3/4] espressif/tinyusb (0.18.0~2)
NOTICE: [4/4] idf (5.4.0)
-- Project sdkconfig file /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig
Loading defaults file /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined...
/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined:104 CONFIG_ESP32_WIFI_IRAM_OPT was replaced with CONFIG_ESP_WIFI_IRAM_OPT
/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined:105 CONFIG_ESP32_WIFI_RX_IRAM_OPT was replaced with CONFIG_ESP_WIFI_RX_IRAM_OPT
/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined:170 CONFIG_BT_NIMBLE_TASK_STACK_SIZE was replaced with CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE
/tmp/kconfgen_tmpqawz89e5:188 line was updated to CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n
/tmp/kconfgen_tmpqawz89e5:190 line was updated to CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n
/tmp/kconfgen_tmpqawz89e5:209 line was updated to CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_40=n
/tmp/kconfgen_tmpqawz89e5:210 line was updated to CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80=n
/tmp/kconfgen_tmpqawz89e5:211 line was updated to CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=n
/tmp/kconfgen_tmpqawz89e5:215 line was updated to CONFIG_SPIRAM_MODE_QUAD=n
warning: unknown kconfig symbol 'XTAL_FREQ_AUTO' assigned to 'y' in /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/sdkconfig.combined
-- App "micropython" version: f498a16-dirty  
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esp_system/ld/sections.ld.in
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.bt_funcs.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/soc/esp32s3/ld/esp32s3.peripherals.ld
Including User C Module(s) from ../../../../../ext_mod/micropython.cmake
Found User C Module(s): usermod_spi3wire, usermod_lcd_bus, usermod_lvgl, lvgl_interface, usermod_lcd_utils
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_driver_ana_cmpr esp_driver_cam esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_isp esp_driver_jpeg esp_driver_ledc esp_driver_mcpwm esp_driver_parlio esp_driver_pcnt esp_driver_ppa esp_driver_rmt esp_driver_sdio esp_driver_sdm esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_touch_sens esp_driver_tsens esp_driver_uart esp_driver_usb_serial_jtag esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_security esp_system esp_timer esp_vfs_console esp_wifi espcoredump espressif__esp_tinyusb espressif__mdns espressif__tinyusb esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread rt sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/app_trace /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/app_update /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/bootloader /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/bootloader_support /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/bt /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/cmock /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/console /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/cxx /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/driver /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/efuse /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp-tls /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_adc /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_app_format /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_bootloader_format /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_coex /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_common /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_ana_cmpr /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_cam /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_dac /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_gpio /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_gptimer /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_i2c /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_i2s /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_isp /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_jpeg /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_ledc /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_mcpwm /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_parlio /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_pcnt /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_ppa /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_rmt /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_sdio /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_sdm /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_sdmmc /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_sdspi /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_spi /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_touch_sens /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_tsens /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_uart /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_driver_usb_serial_jtag /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_eth /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_event /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_gdbstub /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_hid /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_http_client /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_http_server /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_https_ota /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_https_server /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_hw_support /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_lcd /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_local_ctrl /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_mm /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_netif /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_netif_stack /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_partition /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_phy /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_pm /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_psram /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_ringbuf /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_rom /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_security /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_system /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_timer /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_vfs_console /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esp_wifi /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/espcoredump /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/managed_components/espressif__esp_tinyusb /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/managed_components/espressif__mdns /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/managed_components/espressif__tinyusb /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/esptool_py /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/fatfs /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/freertos /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/hal /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/heap /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/http_parser /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/idf_test /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/ieee802154 /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/json /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/log /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/lwip /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/main /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/mbedtls /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/mqtt /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/newlib /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/nvs_flash /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/nvs_sec_provider /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/openthread /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/partition_table /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/perfmon /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/protobuf-c /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/protocomm /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/pthread /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/rt /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/sdmmc /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/soc /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/spi_flash /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/spiffs /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/tcp_transport /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/touch_element /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/ulp /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/unity /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/usb /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/vfs /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/wear_levelling /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/wifi_provisioning /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/wpa_supplicant /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/xtensa
-- Generating done (0.7s) 
-- Build files have been written to: /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT
[1/296] cd /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/main && /usr/bin/cmake -E make_directory /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/genhdr && /root/.espressif/python_env/idf5.4_py3.12_env/bin/python /home/codespace/esp/lvgl_micropython/lib/micropython/py/makeversionhdr.py /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_[2/12] Generating ../../partition_table/partition-table.bin                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
Partition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,2536K,
vfs,data,fat,0x28a000,5592K,
*******************************************************************************
[1/1] cd /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader/esp-idf/esptool_py && /root/.espressif/python_env/idf5.4_py3.12_env/bin/python /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader/bootloader.bin
Bootloader binary size 0x4ad0 bytes. 0x3530 bytes (42%) free.
[5/12] cd /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/main && /root/.espressif/python_env/idf5.4_py3.12_env/bin/python /home/codespace/esp/lvgl_micropython/lib/micropython/tools/makemanifest.py -o /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/frozen_content.c -v BOARD_DIR=/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3 -v MPY_DIR=/home/codespace/esp/lvgl_micropython/lib/micropython -v MPY_LIB_DIR=/home/codespace/esp/lvgl_micropython/lib/micropython/lib/micropython-lib -v PORT_DIR=/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32 -b /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT -f-march=xtensawin --mpy-tool-flags= /[6/7] Completed 'bootloader'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   [7/7] cd /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/esp-idf/esptool_py && /root/.espressif/python_env/idf5.4_py3.12_env/bin/python /home/codespace/esp/lvgl_micropython/lib/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/partition_table/partition-table.bin /home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
micropython.bin binary size 0x279730 bytes. Smallest app partition is 0x27a000 bytes. 0x8d0 bytes (0%) free.
Warning: The smallest app partition is nearly full (0% free space left)!
Project build complete. To flash, run:
idf.py flash
or
idf.py -p PORT flash
or
python -m esptool --chip esp32s3 -b 460800 --before default_reset --after no_reset write_flash --flash_mode dio --flash_size 8MB --flash_freq 80m 0x0 build-ESP32_GENERIC_S3-SPIRAM_OCT/bootloader/bootloader.bin 0x8000 build-ESP32_GENERIC_S3-SPIRAM_OCT/partition_table/partition-table.bin 0x10000 build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin
or from the "/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT" directory
python -m esptool --chip esp32s3 -b 460800 --before default_reset --after no_reset write_flash "@flash_args"
bootloader  @0x000000    19152  (   13616 remaining)
partitions  @0x008000     3072  (    1024 remaining)
application @0x010000  2594608  (    2256 remaining)
total                  2660144
make: Leaving directory '/home/codespace/esp/lvgl_micropython/lib/micropython/ports/esp32'

esptool.py v4.9.0
Wrote 0x289730 bytes to file /home/codespace/esp/lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-8.bin, ready to flash to offset 0x0


To flash firmware:
Replace `(PORT)` with the serial port for your esp32 and run the following command.

/root/.espressif/python_env/idf5.4_py3.12_env/bin/python -m esptool --chip esp32s3 -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 8MB --flash_freq 80m --erase-all 0x0 /home/codespace/esp/lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-8.bin

If your problem is running the binding please past the code you are using below.*
I need to see ALL of the setup code exactly as it is being ran.

import lvgl as lv
import gc9a01
import lcd_bus
from machine import SPI, Pin
from micropython import const
import utime
import gc

_WIDTH = const(240)
_HEIGHT = const(240)

_SPI_HOST = const(2)
_SPI_SCK = const(8)
_SPI_MOSI = const(9)
_SPI_MISO = const(-1)

_LCD_FREQ = const(80000000)
_LCD_DC = const(11)
_LCD_CS = const(12)
_LCD_RST = const(10)
_LCD_BACKLIGHT = const(13)

# Initialize LVGL
try:
    lv.init()
except Exception as e:
    print(f"LVGL initialization failed: {e}")
    raise

# Initialize the SPI bus
try:
    spi_bus = SPI.Bus(
        host=_SPI_HOST,
        mosi=_SPI_MOSI,
        miso=_SPI_MISO,
        sck=_SPI_SCK
    )
except Exception as e:
    print(f"SPI initialization failed: {e}")
    raise

# Initialize the display bus
try:
    display_bus = lcd_bus.SPIBus(
        spi_bus=spi_bus,
        dc=_LCD_DC,
        cs=_LCD_CS,
        freq=_LCD_FREQ
    )
except Exception as e:
    print(f"Display bus initialization failed: {e}")
    raise

# Initialize the GC9A01 display driver
try:
    display = gc9a01.GC9A01(
        data_bus=display_bus,
        display_width=_WIDTH,
        display_height=_HEIGHT,
        reset_pin=_LCD_RST,
        reset_state=gc9a01.STATE_LOW,
        power_on_state=gc9a01.STATE_HIGH,
        backlight_pin=None,
        offset_x=0,
        offset_y=0,
        color_space=lv.COLOR_FORMAT.RGB565,
        rgb565_byte_swap=True
    )
except Exception as e:
    print(f"GC9A01 initialization failed: {e}")
    raise

# Initialize display
try:
    display.init()
except Exception as e:
    print(f"Display initialization failed: {e}")
    raise

class TextDisplay:
    def __init__(self, screen, display, debug=0):
        """Initialize text display for LVGL on GC9A01."""
        self.screen = screen
        self.display = display
        self.debug = debug
        self.width = _WIDTH
        self.height = _HEIGHT
        self.line_height = 20  # Adjust based on font size
        self.line_spacing = 4
        self.max_lines = (self.height - 20) // (self.line_height + self.line_spacing)
        self.current_line = 0
        self.current_y = 20
        self.text_color = lv.color_hex(0x000000)  # White
        self.bg_color = lv.color_hex(0xFFFFFF)  # Blue
        self.char_delay = 0.001  # Delay per character in seconds
        self.labels = []  # Track all labels created
        
        # Clear screen initially
        self.clear_screen()

    def clear_screen(self):
        """Clear the screen and reset state."""
        start_time = utime.ticks_ms()
        try:
            # Delete all tracked labels
            for label in self.labels:
                try:
                    label.delete()
                except:
                    pass  # Ignore if label is already deleted
            self.labels.clear()
            
            # Set background color
            self.screen.set_style_bg_color(self.bg_color, 0)
            self.current_line = 0
            self.current_y = 20
            lv.screen_load(self.screen)
            gc.collect()
            if self.debug >= 1:
                print(f"Clear screen time: {utime.ticks_diff(utime.ticks_ms(), start_time)} ms")
                print(f"Memory after clear_screen: {gc.mem_free()} bytes")
        except Exception as e:
            print(f"Clear screen failed: {e}")
            raise

    def display_text(self, text, color=None, bg_color=None, char_delay=None):
        """Display text line by line, clearing screen when full."""
        start_time = utime.ticks_ms()
        
        self.text_color = color or self.text_color
        self.bg_color = bg_color or self.bg_color
        self.char_delay = char_delay if char_delay is not None else self.char_delay
        
        # Split text into words
        words = text.split()
        current_line_text = ""
        
        for word in words:
            # Measure text width using lv.text_get_width
            try:
                test_text = current_line_text + (word + " " if current_line_text else word)
                width = lv.text_get_width(test_text, len(test_text), None, 0)
            except Exception as e:
                print(f"Failed to measure text width for '{word}': {e}")
                width = self.width  # Fallback to assume it doesn't fit
                self._render_line(current_line_text.strip())
                current_line_text = word + " "
                continue
            
            if width > self.width - 20:  # Check if line exceeds screen width
                self._render_line(current_line_text.strip())
                current_line_text = word + " "
            else:
                current_line_text += word + " "
            
            # If screen is full, clear and reset
            if self.current_line >= self.max_lines:
                self.clear_screen()
        
        # Render any remaining text
        if current_line_text.strip():
            self._render_line(current_line_text.strip())
        
        gc.collect()
        if self.debug >= 1:
            print(f"Total display_text time: {utime.ticks_diff(utime.ticks_ms(), start_time)} ms")
            print(f"Memory after display_text: {gc.mem_free()} bytes")

    def _render_line(self, text):
        """Render a single line of text."""
        if not text:
            return
        try:
            label = lv.label(self.screen)
            label.set_text(text)
            label.set_style_text_color(self.text_color, 0)
            label.set_pos(10, self.current_y)
            label.set_width(self.width - 20)  # Set width to constrain text
            # Removed set_long_mode since LABEL_LONG_WRAP is not available
            self.labels.append(label)  # Track the label
            self.current_line += 1
            self.current_y += self.line_height + self.line_spacing
            if self.char_delay > 0:
                utime.sleep(self.char_delay * len(text))
            lv.screen_load(self.screen)
        except Exception as e:
            print(f"Failed to render line '{text}': {e}")
            raise

# Main execution
if __name__ == "__main__":
    try:
        scr = lv.screen_active()
        text_display = TextDisplay(scr, display, debug=1)
        test_text = "Hello LVGL! This is a test of the display system. It should wrap text and clear the screen when full, then continue displaying the remaining text."
        text_display.display_text(test_text)
        print("LVGL test script executed successfully")
        
        import task_handler
        th = task_handler.TaskHandler()
    except Exception as e:
        print(f"Test failed: {e}")

**Exact make and model number of the MCU that you are compiling for or the firmware is running on. **

  • Make:
  • Model:

For ESP32 MCU's The PSRAM and FLASH SPI type, quad SPI or octal SPI.

  • PSRAM: None
  • FLASH: 8M

I need to know the OS and OS version of the machine that compiled the binary. If using a VM then I need to know the OS and OS version the VM is running. (WSL == VM)

  • OS: [e.g. iOS]

Build Command

sudo python3 make.py esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=gc9a01 INDEV=cst816s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions