Commit 38ccd7b2 authored by Johny Mattsson's avatar Johny Mattsson Committed by Johny Mattsson
Browse files

Upgrade IDF to v4.4.2

Slightly reworked embed_lfs.sh to better cope with attribute size changes
in future compiler versions, without needing to be updated again.

RMT register naming changed once again...
parent d8f07ddf
...@@ -111,9 +111,9 @@ static int node_bootreason( lua_State *L) ...@@ -111,9 +111,9 @@ static int node_bootreason( lua_State *L)
#endif #endif
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
case GLITCH_RTC_RESET: case GLITCH_RTC_RESET:
case EFUSE_RESET:
#endif #endif
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
case EFUSE_RESET:
case USB_UART_CHIP_RESET: case USB_UART_CHIP_RESET:
case USB_JTAG_CHIP_RESET: case USB_JTAG_CHIP_RESET:
case POWER_GLITCH_RESET: case POWER_GLITCH_RESET:
......
...@@ -104,10 +104,12 @@ static void ws2812_isr(void *arg) ...@@ -104,10 +104,12 @@ static void ws2812_isr(void *arg)
RMT.int_clr.val = BIT(channel+24); RMT.int_clr.val = BIT(channel+24);
ws2812_chain_t *chain = &(ws2812_chains[channel]); ws2812_chain_t *chain = &(ws2812_chains[channel]);
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) #if defined(CONFIG_IDF_TARGET_ESP32)
uint32_t data_sub_len = RMT.tx_lim_ch[channel].limit/8; uint32_t data_sub_len = RMT.tx_lim_ch[channel].limit/8;
#elif defined(CONFIG_IDF_TARGET_ESP32S3) #elif defined(CONFIG_IDF_TARGET_ESP32S3)
uint32_t data_sub_len = RMT.chn_tx_lim[channel].tx_lim_chn/8; uint32_t data_sub_len = RMT.chn_tx_lim[channel].tx_lim_chn/8;
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
uint32_t data_sub_len = RMT.tx_lim_ch[channel].tx_lim/8;
#else #else
uint32_t data_sub_len = RMT.tx_lim[channel].limit/8; uint32_t data_sub_len = RMT.tx_lim[channel].limit/8;
#endif #endif
......
Subproject commit d83021a6e8550b4d462e11d61aaab0214dc03f5a Subproject commit 1b16ef6cfc2479a08136782f9dc57effefa86f66
#!/bin/bash #!/bin/bash
LUA_APP_SRC="$@" LUA_APP_SRC=("$@")
MAP_FILE=build/nodemcu.map MAP_FILE=build/nodemcu.map
LUAC_OUTPUT=build/luac.out LUAC_OUTPUT=build/luac.out
...@@ -15,43 +15,49 @@ if [ ! -f "${LUAC_CROSS}" ]; then ...@@ -15,43 +15,49 @@ if [ ! -f "${LUAC_CROSS}" ]; then
exit 1 exit 1
fi fi
LFS_ADDR_SIZE=$(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 -w 0x0 | grep -v -w 0x24 | tr -s ' ') # Extract the line containing the data size of the LFS object, filtering out
if [ -z "${LFS_ADDR_SIZE}" ]; then # 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?" echo "Error: LFS segment not found. Use 'make clean; make' perhaps?"
exit 1 exit 1
fi fi
LFS_ADDR=$(echo "${LFS_ADDR_SIZE}" | cut -d ' ' -f 2) LFS_ADDR=$(echo "${LFS_SIZE_ADDR}" | cut -d ' ' -f 2)
if [ -z "${LFS_ADDR}" ]; then if [ -z "${LFS_ADDR}" ]; then
echo "Error: LFS segment address not found" echo "Error: LFS segment address not found"
exit 1 exit 1
fi fi
# The reported size is +4 due to the length field added by the IDF # The reported size is +4 due to the length field added by the IDF
LFS_SIZE=$(( $(echo "${LFS_ADDR_SIZE}" | cut -d ' ' -f 3) - 4 )) LFS_SIZE=$(( $(echo "${LFS_SIZE_ADDR}" | cut -d ' ' -f 1) - 4 ))
if [ -z "${LFS_SIZE}" ]; then if [ -z "${LFS_SIZE}" ]; then
echo "Error: LFS segment size not found" echo "Error: LFS segment size not found"
exit 1 exit 1
fi fi
echo "LFS segment address ${LFS_ADDR}, length ${LFS_SIZE}" printf "LFS segment address %s, length %s (0x%x)\n" "${LFS_ADDR}" "${LFS_SIZE}" "${LFS_SIZE}"
if ${LUAC_CROSS} -v | grep -q 'Lua 5.1' if ${LUAC_CROSS} -v | grep -q 'Lua 5.1'
then then
echo "Generating Lua 5.1 LFS image..." echo "Generating Lua 5.1 LFS image..."
${LUAC_CROSS} -a ${LFS_ADDR} -m ${LFS_SIZE} -o ${LUAC_OUTPUT} ${LUA_APP_SRC} ${LUAC_CROSS} -a "${LFS_ADDR}" -m ${LFS_SIZE} -o ${LUAC_OUTPUT} "${LUA_APP_SRC[@]}"
else else
set -e set -e
echo "Generating intermediate Lua 5.3 LFS image..." echo "Generating intermediate Lua 5.3 LFS image..."
${LUAC_CROSS} -f -m ${LFS_SIZE} -o ${LUAC_OUTPUT}.tmp ${LUA_APP_SRC} ${LUAC_CROSS} -f -m ${LFS_SIZE} -o ${LUAC_OUTPUT}.tmp "${LUA_APP_SRC[@]}"
echo "Converting to absolute LFS image..." echo "Converting to absolute LFS image..."
${LUAC_CROSS} -F ${LUAC_OUTPUT}.tmp -a ${LFS_ADDR} -o ${LUAC_OUTPUT} ${LUAC_CROSS} -F ${LUAC_OUTPUT}.tmp -a "${LFS_ADDR}" -o ${LUAC_OUTPUT}
rm ${LUAC_OUTPUT}.tmp rm ${LUAC_OUTPUT}.tmp
fi fi
# shellcheck disable=SC2181
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Error: luac.cross failed" echo "Error: luac.cross failed"
exit 1 exit 1
else else
echo "Generated $(ls -l ${LUAC_OUTPUT} | cut -f5 -d' ') bytes of LFS data" echo "Generated $(stat -c "%s" ${LUAC_OUTPUT}) bytes of LFS data"
fi fi
# cmake depencies don't seem to pick up the change to luac.out? # cmake depencies don't seem to pick up the change to luac.out?
rm -f build/lua.flash.store.reserved rm -f build/lua.flash.store.reserved
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment