Skip to content
14 changes: 12 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,17 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do

# Build IDF Libs
idf_libs_configs="$main_configs"

# Extract frequency from idf_libs (element [1]) for esp32s3
if [ "$target" = "esp32s3" ]; then
export MEM_VARIANT_FREQ=$(echo "$target_json" | jq -r '.idf_libs[1]')
fi

for defconf in `echo "$target_json" | jq -c '.idf_libs[]' | tr -d '"'`; do
idf_libs_configs="$idf_libs_configs;configs/defconfig.$defconf"
done

echo "* Build IDF-Libs: $idf_libs_configs"
echo "* Build IDF-Libs: $idf_libs_configs (freq: $MEM_VARIANT_FREQ)"
rm -rf build sdkconfig
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" idf-libs
if [ $? -ne 0 ]; then exit 1; fi
Expand All @@ -236,11 +242,15 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
# Build Memory Variants
for mem_conf in `echo "$target_json" | jq -c '.mem_variants[]'`; do
mem_configs="$main_configs"

# Extract frequency from mem_variant (element [1])
export MEM_VARIANT_FREQ=$(echo "$mem_conf" | jq -r '.[1]')

for defconf in `echo "$mem_conf" | jq -c '.[]' | tr -d '"'`; do
mem_configs="$mem_configs;configs/defconfig.$defconf";
done

echo "* Build Memory Variant: $mem_configs"
echo "* Build Memory Variant: $mem_configs (freq: $MEM_VARIANT_FREQ)"
rm -rf build sdkconfig
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$mem_configs" mem-variant
if [ $? -ne 0 ]; then exit 1; fi
Expand Down
9 changes: 5 additions & 4 deletions configs/builds.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,19 @@
{
"target": "esp32s3",
"features":[],
"idf_libs":["qio","120m","opi_ram"],
"idf_libs":["qio","80m","qio_ram"],
"bootloaders":[
["qio","120m","qio_ram"],
["opi","120m","opi_ram"],
["qio","80m","qio_ram"],
["opi","80m","opi_ram"]
],
"mem_variants":[
["opi","120m","qio_ram"],
["opi","80m","opi_ram"],
["qio","80m","opi_ram"],
["qio","120m","opi_ram"],
["opi","120m","opi_ram"],
["qio","120m","qio_ram"],
["qio","120m","opi_ram"]
["qio","120m","qio_ram"]
]
}
]
Expand Down
9 changes: 7 additions & 2 deletions tools/copy-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ else
fi
MEMCONF=$OCT_FLASH"_$OCT_PSRAM"

# For esp32s3, add frequency from environment variable set by build.sh
if [ "$IDF_TARGET" = "esp32s3" ] && [ -n "$MEM_VARIANT_FREQ" ]; then
MEMCONF=$MEMCONF"_$MEM_VARIANT_FREQ"
fi

source ./tools/config.sh

echo "IDF_TARGET: $IDF_TARGET, MEMCONF: $MEMCONF, PWD: $PWD, OUT: $AR_SDK"
Expand Down Expand Up @@ -463,7 +468,7 @@ for item; do
fi
fi
done
echo " join($PIO_SDK, board_config.get(\"build.arduino.memory_type\", (board_config.get(\"build.flash_mode\", \"dio\") + \"_qspi\")), \"include\")," >> "$AR_PLATFORMIO_PY"
echo " join($PIO_SDK, (board_config.get(\"build.arduino.memory_type\", (board_config.get(\"build.flash_mode\", \"dio\") + \"_qspi\")) + (\"_\" + board_config.get(\"build.f_boot\", board_config.get(\"build.f_flash\", \"80000000L\")).replace(\"000000L\", \"m\") if board_config.get(\"build.mcu\") == \"esp32s3\" else \"\")), \"include\")," >> "$AR_PLATFORMIO_PY"
echo " join(FRAMEWORK_DIR, \"cores\", board_config.get(\"build.core\"))" >> "$AR_PLATFORMIO_PY"
echo " ]," >> "$AR_PLATFORMIO_PY"
echo "" >> "$AR_PLATFORMIO_PY"
Expand All @@ -488,7 +493,7 @@ done
echo " LIBPATH=[" >> "$AR_PLATFORMIO_PY"
echo " join($PIO_SDK, \"lib\")," >> "$AR_PLATFORMIO_PY"
echo " join($PIO_SDK, \"ld\")," >> "$AR_PLATFORMIO_PY"
echo " join($PIO_SDK, board_config.get(\"build.arduino.memory_type\", (board_config.get(\"build.flash_mode\", \"dio\") + \"_qspi\")))" >> "$AR_PLATFORMIO_PY"
echo " join($PIO_SDK, (board_config.get(\"build.arduino.memory_type\", (board_config.get(\"build.flash_mode\", \"dio\") + \"_qspi\")) + (\"_\" + board_config.get(\"build.f_boot\", board_config.get(\"build.f_flash\", \"80000000L\")).replace(\"000000L\", \"m\") if board_config.get(\"build.mcu\") == \"esp32s3\" else \"\")))" >> "$AR_PLATFORMIO_PY"
echo " ]," >> "$AR_PLATFORMIO_PY"
echo "" >> "$AR_PLATFORMIO_PY"

Expand Down
5 changes: 5 additions & 0 deletions tools/copy-mem-variant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ fi

MEMCONF=$OCT_FLASH"_$OCT_PSRAM"

# For esp32s3, add frequency from environment variable set by build.sh
if [ "$IDF_TARGET" = "esp32s3" ] && [ -n "$MEM_VARIANT_FREQ" ]; then
MEMCONF=$MEMCONF"_$MEM_VARIANT_FREQ"
fi

source ./tools/config.sh

echo "IDF_TARGET: $IDF_TARGET, MEMCONF: $MEMCONF"
Expand Down