From c88c398f30d93bb0841a154dd771f2e88cc38faa Mon Sep 17 00:00:00 2001 From: "Sameer .I. Siddiqui" Date: Sun, 21 Sep 2025 00:27:05 +0530 Subject: [PATCH] build(tab5): configure 16mb factory layout --- .github/workflows/idf-build.yml | 9 +++++++++ platforms/tab5/CMakeLists.txt | 5 +++++ platforms/tab5/main/CMakeLists.txt | 21 --------------------- platforms/tab5/partitions_no_ota_16mb.csv | 5 +++++ platforms/tab5/sdkconfig.defaults | 2 ++ 5 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 platforms/tab5/partitions_no_ota_16mb.csv diff --git a/.github/workflows/idf-build.yml b/.github/workflows/idf-build.yml index 5cacfb0..d5ee4f9 100644 --- a/.github/workflows/idf-build.yml +++ b/.github/workflows/idf-build.yml @@ -33,6 +33,15 @@ jobs: path: platforms/tab5 command: idf.py build + - name: Size report + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: v5.4.2 + target: esp32p4 + path: platforms/tab5 + command: >- + bash -lc "idf.py size && idf.py size-components && (idf.py size-files || true)" + # Optional: show the auto-generated flash args for reference in logs - name: Show flash args if: always() diff --git a/platforms/tab5/CMakeLists.txt b/platforms/tab5/CMakeLists.txt index 10d0700..b3eac24 100644 --- a/platforms/tab5/CMakeLists.txt +++ b/platforms/tab5/CMakeLists.txt @@ -49,3 +49,8 @@ set(EXTRA_COMPONENT_DIRS ) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(m5tab5_userdemo) + +# Disable the linker flag added for non-contiguous SRAM regions to avoid +# discarding large .bss sections from the C++ runtime when linking the +# oversized factory app image. +idf_build_set_property(LINK_OPTIONS "-Wl,--no-enable-non-contiguous-regions" APPEND) diff --git a/platforms/tab5/main/CMakeLists.txt b/platforms/tab5/main/CMakeLists.txt index 6970757..c3a4be2 100644 --- a/platforms/tab5/main/CMakeLists.txt +++ b/platforms/tab5/main/CMakeLists.txt @@ -28,24 +28,3 @@ idf_component_register( sensor_bmi270 espressif__usb_host_hid usb imlib json EMBED_TXTFILES "../audio/canon_in_d.mp3" "../audio/startup_sfx.mp3" "../audio/shutdown_sfx.mp3") -set(CUSTOM_ASSETS_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../custom/assets") -get_filename_component(CUSTOM_ASSETS_DIR "${CUSTOM_ASSETS_DIR}" REALPATH) - -set(CUSTOM_ASSETS_IMAGE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/spiffs_custom_assets") -set(CUSTOM_ASSETS_STAMP "${CUSTOM_ASSETS_IMAGE_ROOT}/.staged") -file(GLOB_RECURSE CUSTOM_ASSET_FILES CONFIGURE_DEPENDS LIST_DIRECTORIES false - "${CUSTOM_ASSETS_DIR}/*") - -add_custom_command( - OUTPUT "${CUSTOM_ASSETS_STAMP}" - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CUSTOM_ASSETS_IMAGE_ROOT}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${CUSTOM_ASSETS_IMAGE_ROOT}/custom" - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CUSTOM_ASSETS_DIR}" - "${CUSTOM_ASSETS_IMAGE_ROOT}/custom/assets" - COMMAND ${CMAKE_COMMAND} -E touch "${CUSTOM_ASSETS_STAMP}" - DEPENDS ${CUSTOM_ASSET_FILES} - COMMENT "Staging custom assets for SPIFFS image" -) - -spiffs_create_partition_image(storage "${CUSTOM_ASSETS_IMAGE_ROOT}" FLASH_IN_PROJECT - DEPENDS "${CUSTOM_ASSETS_STAMP}") diff --git a/platforms/tab5/partitions_no_ota_16mb.csv b/platforms/tab5/partitions_no_ota_16mb.csv new file mode 100644 index 0000000..c407385 --- /dev/null +++ b/platforms/tab5/partitions_no_ota_16mb.csv @@ -0,0 +1,5 @@ +# ESP-IDF Partition Table — Single factory app, no OTA (16MB flash) +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x6000 +phy_init, data, phy, 0xF000, 0x1000 +factory, app, factory, 0x10000, 0xFF0000 diff --git a/platforms/tab5/sdkconfig.defaults b/platforms/tab5/sdkconfig.defaults index 215f425..be8bf0e 100644 --- a/platforms/tab5/sdkconfig.defaults +++ b/platforms/tab5/sdkconfig.defaults @@ -2,6 +2,8 @@ CONFIG_IDF_TARGET="esp32p4" CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_no_ota_16mb.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_no_ota_16mb.csv" CONFIG_I2C_ENABLE_LEGACY_DRIVERS=n CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK=y CONFIG_COMPILER_OPTIMIZATION_PERF=y