Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

dist/tools/esptool: fix the all target #21129

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dist/tools/esptools/export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,36 @@
case $1 in
esp8266)
TARGET_ARCH="xtensa-esp8266-elf"
ESP32_GCC_RELEASE=${ESP8266_GCC_RELEASE}
ESP_GCC_RELEASE="${ESP8266_GCC_RELEASE}"
;;
esp32)
TARGET_ARCH="xtensa-esp32-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32c3)
TARGET_ARCH="riscv32-esp-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s2)
TARGET_ARCH="xtensa-esp32s2-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s3)
TARGET_ARCH="xtensa-esp32s3-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
*)
echo "Unknown architecture $1"
return
esac

TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP32_GCC_RELEASE}/${TARGET_ARCH}"
TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP_GCC_RELEASE}/${TARGET_ARCH}"
TOOLS_DIR_IN_PATH="$(echo $PATH | grep "${TOOLS_DIR}")"

Check warning on line 43 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

if [ ! -e "${TOOLS_DIR}" ]; then
echo "${TOOLS_DIR} does not exist - please run"
echo $(echo $0 | sed 's/export/install/') $1

Check warning on line 47 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

Check warning on line 47 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Quote this to prevent word splitting. [SC2046]
exit 1
return
fi

if [ -z "${TOOLS_DIR_IN_PATH}" ]; then
Expand All @@ -58,7 +62,7 @@
export_openocd()
{
TOOLS_DIR="${TOOLS_PATH}/openocd-esp32/${ESP32_OPENOCD_VERSION}"
TOOLS_DIR_IN_PATH="$(echo $PATH | grep "${TOOLS_DIR}")"

Check warning on line 65 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]
OPENOCD_DIR="${TOOLS_DIR}/openocd-esp32"

if [ -e "${OPENOCD_DIR}" ] && [ -z "${TOOLS_DIR_IN_PATH}" ]; then
Expand All @@ -81,7 +85,7 @@
# map different platform names to a unique OS name
case "${PLATFORM}" in
linux-amd64|linux64|Linux-x86_64|FreeBSD-amd64)
OS="linux-amd64"

Check warning on line 88 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

OS appears unused. Verify use (or export if used externally). [SC2034]
;;
*)
echo "error: OS architecture ${PLATFORM} not supported"
Expand All @@ -101,7 +105,7 @@
fi

TOOLS_DIR="${TOOLS_PATH}/qemu-esp32/${ESP32_QEMU_VERSION}/qemu"
TOOLS_DIR_IN_PATH="$(echo $PATH | grep "${TOOLS_DIR}")"

Check warning on line 108 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

if [ -e "${TOOLS_DIR}" ] && [ -z "${TOOLS_DIR_IN_PATH}" ]; then
echo "Extending PATH by ${TOOLS_DIR}/bin"
Expand All @@ -128,7 +132,7 @@
GDB_VERSION="12.1_20221002"

TOOLS_DIR="${TOOLS_PATH}/${GDB_ARCH}/${GDB_VERSION}/${GDB_ARCH}"
TOOLS_DIR_IN_PATH="$(echo $PATH | grep "${TOOLS_DIR}")"

Check warning on line 135 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

if [ -e "${TOOLS_DIR}" ] && [ -z "${TOOLS_DIR_IN_PATH}" ]; then
echo "Extending PATH by ${TOOLS_DIR}/bin"
Expand Down Expand Up @@ -165,7 +169,7 @@
elif [ "$1" = "qemu" ]; then
export_qemu
else
export_arch $1

Check warning on line 172 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]
fi

unset ESP32_GCC_RELEASE
Expand Down
10 changes: 7 additions & 3 deletions dist/tools/esptools/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

ESP32_GCC_RELEASE="esp-12.2.0_20230208"
ESP32_GCC_VERSION_DIR="12.2.0"

Check warning on line 4 in dist/tools/esptools/install.sh

View workflow job for this annotation

GitHub Actions / static-tests

ESP32_GCC_VERSION_DIR appears unused. Verify use (or export if used externally). [SC2034]
ESP32_GCC_VERSION_DOWNLOAD="12.2.0_20230208"

ESP8266_GCC_RELEASE="esp-5.2.0_20191018"
Expand Down Expand Up @@ -88,33 +88,37 @@
case "$1" in
esp8266)
TARGET_ARCH="xtensa-esp8266-elf"
ESP32_GCC_RELEASE=${ESP8266_GCC_RELEASE}
ESP_GCC_RELEASE="${ESP8266_GCC_RELEASE}"
;;
esp32)
TARGET_ARCH="xtensa-esp32-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32c3)
TARGET_ARCH="riscv32-esp-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s2)
TARGET_ARCH="xtensa-esp32s2-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s3)
TARGET_ARCH="xtensa-esp32s3-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
*)
echo "error: Unknown architecture $1"
exit 1
esac

TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP32_GCC_RELEASE}"
TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP_GCC_RELEASE}"

if [ "$1" = "esp8266" ]; then
git clone https://github.com/gschorcht/xtensa-esp8266-elf ${TOOLS_DIR}/${TARGET_ARCH}

Check warning on line 117 in dist/tools/esptools/install.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]
else
URL_PATH="https://github.com/espressif/crosstool-NG/releases/download"
URL_TGZ="${TARGET_ARCH}-${ESP32_GCC_VERSION_DOWNLOAD}-${OS}.tar.xz"
URL="${URL_PATH}/${ESP32_GCC_RELEASE}/${URL_TGZ}"
URL="${URL_PATH}/${ESP_GCC_RELEASE}/${URL_TGZ}"

echo "Creating directory ${TOOLS_DIR} ..." && \
mkdir -p "${TOOLS_DIR}" && \
Expand Down
Loading