From 4379dd9d31583feebefa58ab675c1b4c19847ab0 Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Thu, 10 Nov 2022 17:03:07 +1100 Subject: [PATCH] Update to IDF v4.4.3. Rewrote the embed_lfs.sh section addr/size handling since it was still having issues between compiler versions. --- sdk/esp32-esp-idf | 2 +- tools/embed_lfs.sh | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/sdk/esp32-esp-idf b/sdk/esp32-esp-idf index 1b16ef6cf..6407ecb3f 160000 --- a/sdk/esp32-esp-idf +++ b/sdk/esp32-esp-idf @@ -1 +1 @@ -Subproject commit 1b16ef6cfc2479a08136782f9dc57effefa86f66 +Subproject commit 6407ecb3f8d2cc07c4c230e7e64f2046af5c86f7 diff --git a/tools/embed_lfs.sh b/tools/embed_lfs.sh index d0f639a29..b032a037b 100755 --- a/tools/embed_lfs.sh +++ b/tools/embed_lfs.sh @@ -15,28 +15,16 @@ if [ ! -f "${LUAC_CROSS}" ]; then exit 1 fi -# Extract the line containing the data size of the LFS object, filtering out -# lines for .bss/.data/.text, sorting the remaining two entries (actual LFS -# data and (optional) riscv attributes) so we can discard the latter if -# present. If the map file was a bit saner with its line breaks this would -# have been a straight forward grep for for .rodata.embedded.*lua.flash.store -LFS_SIZE_ADDR=$(grep -E "0x[0-9a-f]+[ ]+0x[0-9a-f]+[ ]+esp-idf/embedded_lfs/libembedded_lfs.a\(lua.flash.store.reserved.S.obj\)" "${MAP_FILE}" | grep -v '^ \.' | awk '{print $2,$1}' | sort -n -k 1.3 | tail -1) -if [ -z "${LFS_SIZE_ADDR}" ]; then - echo "Error: LFS segment not found. Use 'make clean; make' perhaps?" - exit 1 -fi - -LFS_ADDR=$(echo "${LFS_SIZE_ADDR}" | cut -d ' ' -f 2) -if [ -z "${LFS_ADDR}" ]; then - echo "Error: LFS segment address not found" - exit 1 -fi -# The reported size is +4 due to the length field added by the IDF -LFS_SIZE=$(( $(echo "${LFS_SIZE_ADDR}" | cut -d ' ' -f 1) - 4 )) -if [ -z "${LFS_SIZE}" ]; then - echo "Error: LFS segment size not found" - exit 1 +# Extract the start/end symbols of the LFS object, then calculate the +# available size from that. +LFS_ADDR=$(grep -E '0x[0-9a-f]+ +_binary_lua_flash_store_reserved_start' "${MAP_FILE}" | awk '{print $1}') +LFS_ADDR_END=$(grep -E '0x[0-9a-f]+ +_binary_lua_flash_store_reserved_end' "${MAP_FILE}" | awk '{print $1}') +if [ "${LFS_ADDR}" = "" ] +then + echo "Error: LFS segment address not found" + exit 1 fi +LFS_SIZE=$((LFS_ADDR_END - LFS_ADDR)) printf "LFS segment address %s, length %s (0x%x)\n" "${LFS_ADDR}" "${LFS_SIZE}" "${LFS_SIZE}"