Skip to content

Commit f9f5064

Browse files
authored
Merge pull request #159 from baba-dev/codex/add-custom-partition-table-for-16mb-flash
build: configure 16mb factory layout
2 parents 6d99b8d + c88c398 commit f9f5064

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

.github/workflows/idf-build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ jobs:
3333
path: platforms/tab5
3434
command: idf.py build
3535

36+
- name: Size report
37+
uses: espressif/esp-idf-ci-action@v1
38+
with:
39+
esp_idf_version: v5.4.2
40+
target: esp32p4
41+
path: platforms/tab5
42+
command: >-
43+
bash -lc "idf.py size && idf.py size-components && (idf.py size-files || true)"
44+
3645
# Optional: show the auto-generated flash args for reference in logs
3746
- name: Show flash args
3847
if: always()

platforms/tab5/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ set(EXTRA_COMPONENT_DIRS
4949
)
5050
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
5151
project(m5tab5_userdemo)
52+
53+
# Disable the linker flag added for non-contiguous SRAM regions to avoid
54+
# discarding large .bss sections from the C++ runtime when linking the
55+
# oversized factory app image.
56+
idf_build_set_property(LINK_OPTIONS "-Wl,--no-enable-non-contiguous-regions" APPEND)

platforms/tab5/main/CMakeLists.txt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,3 @@ idf_component_register(
2828
sensor_bmi270 espressif__usb_host_hid usb imlib json
2929
EMBED_TXTFILES "../audio/canon_in_d.mp3" "../audio/startup_sfx.mp3" "../audio/shutdown_sfx.mp3")
3030

31-
set(CUSTOM_ASSETS_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../custom/assets")
32-
get_filename_component(CUSTOM_ASSETS_DIR "${CUSTOM_ASSETS_DIR}" REALPATH)
33-
34-
set(CUSTOM_ASSETS_IMAGE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/spiffs_custom_assets")
35-
set(CUSTOM_ASSETS_STAMP "${CUSTOM_ASSETS_IMAGE_ROOT}/.staged")
36-
file(GLOB_RECURSE CUSTOM_ASSET_FILES CONFIGURE_DEPENDS LIST_DIRECTORIES false
37-
"${CUSTOM_ASSETS_DIR}/*")
38-
39-
add_custom_command(
40-
OUTPUT "${CUSTOM_ASSETS_STAMP}"
41-
COMMAND ${CMAKE_COMMAND} -E rm -rf "${CUSTOM_ASSETS_IMAGE_ROOT}"
42-
COMMAND ${CMAKE_COMMAND} -E make_directory "${CUSTOM_ASSETS_IMAGE_ROOT}/custom"
43-
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CUSTOM_ASSETS_DIR}"
44-
"${CUSTOM_ASSETS_IMAGE_ROOT}/custom/assets"
45-
COMMAND ${CMAKE_COMMAND} -E touch "${CUSTOM_ASSETS_STAMP}"
46-
DEPENDS ${CUSTOM_ASSET_FILES}
47-
COMMENT "Staging custom assets for SPIFFS image"
48-
)
49-
50-
spiffs_create_partition_image(storage "${CUSTOM_ASSETS_IMAGE_ROOT}" FLASH_IN_PROJECT
51-
DEPENDS "${CUSTOM_ASSETS_STAMP}")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ESP-IDF Partition Table — Single factory app, no OTA (16MB flash)
2+
# Name, Type, SubType, Offset, Size, Flags
3+
nvs, data, nvs, 0x9000, 0x6000
4+
phy_init, data, phy, 0xF000, 0x1000
5+
factory, app, factory, 0x10000, 0xFF0000

platforms/tab5/sdkconfig.defaults

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ CONFIG_IDF_TARGET="esp32p4"
22
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
33
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
44
CONFIG_PARTITION_TABLE_CUSTOM=y
5+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_no_ota_16mb.csv"
6+
CONFIG_PARTITION_TABLE_FILENAME="partitions_no_ota_16mb.csv"
57
CONFIG_I2C_ENABLE_LEGACY_DRIVERS=n
68
CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK=y
79
CONFIG_COMPILER_OPTIMIZATION_PERF=y

0 commit comments

Comments
 (0)