Update to IDF v4.4.3.

Rewrote the embed_lfs.sh section addr/size handling since it was still having
issues between compiler versions.
This commit is contained in:
Johny Mattsson 2022-11-10 17:03:07 +11:00 committed by Johny Mattsson
parent 1d173c818b
commit 4379dd9d31
2 changed files with 10 additions and 22 deletions

@ -1 +1 @@
Subproject commit 1b16ef6cfc2479a08136782f9dc57effefa86f66
Subproject commit 6407ecb3f8d2cc07c4c230e7e64f2046af5c86f7

View File

@ -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}"