Skip to content

Commit

Permalink
Upgrade ESP32 IDF to v5.2.2 (#2991)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSoundy authored Jul 30, 2024
1 parent c6dee33 commit a384668
Show file tree
Hide file tree
Showing 18 changed files with 1,931 additions and 1,911 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/All/Dockerfile.All
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-all:v2.49
FROM ghcr.io/nanoframework/dev-container-all:v2.50
300 changes: 150 additions & 150 deletions .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
@@ -1,150 +1,150 @@
FROM ubuntu:latest AS downloader
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils \
&& apt-get install -y \
curl \
xz-utils \
unzip \
wget

RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted

ARG GCC_VERSION=13.2.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
&& xz -d /tmp/dc-downloads/gcc-arm.tar.xz \
&& tar -xvf /tmp/dc-downloads/gcc-arm.tar -C /tmp/dc-extracted/gcc --strip-components 1 \
&& rm -rf /tmp/dc-extracted/gcc/share/doc/ /tmp/dc-extracted/gcc/share/gcc-arm-none-eabi/samples/

ARG CMAKE_VERSION=3.27.6
ARG CMAKE_SCRIPT=https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh
RUN wget $CMAKE_SCRIPT \
-q -O /tmp/dc-downloads/cmake-install.sh \
&& chmod u+x /tmp/dc-downloads/cmake-install.sh \
&& mkdir -p /tmp/dc-extracted/cmake \
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \
&& rm /tmp/dc-downloads/cmake-install.sh

# This is TI XDC tools for linux. Cheack all versions here: https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/index.html
ARG TI_TOOL_URL=https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_62_00_08/exports/xdccore/xdctools_3_62_00_08_core_linux.zip
RUN mkdir -p /tmp/dc-extracted/titools \
&& curl -o /tmp/dc-downloads/titools.zip $TI_TOOL_URL -L \
&& unzip -d /tmp/dc-extracted/titools /tmp/dc-downloads/titools.zip

FROM python:3.11 AS devcontainer

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# You can set up non-root user
# ARG USERNAME=vscode
# ARG USER_UID=1000
# ARG USER_GID=$USER_UID

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 \
&& apt-get install -y \
git \
git-lfs \
git-svn \
subversion \
clang-format \
curl \
ninja-build \
srecord \
nodejs \
libffi-dev

# Create needed directories
RUN mkdir -p /usr/local/bin/gcc \
&& mkdir -p /usr/local/bin/titools

# Clone ChibiOS repo
# RUN git svn clone http://svn.code.sf.net/p/chibios/code/branches/stable_21.11.x -rHEAD ./sources/ChibiOs
# Alternative source for those having issues with git svn downloads:
RUN git clone --branch stable_21.11.x https://github.com/ArduPilot/ChibiOS.svn.git --depth 1 ./sources/ChibiOs

# Clone support repos for STM32 including AzureRTOS
RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git --depth 1 ./sources/STM32CubeL4 \
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF7.git --depth 1 ./sources/STM32CubeF7 \
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF4.git --depth 1 ./sources/STM32CubeF4 \
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeH7.git --depth 1 ./sources/STM32CubeH7 \
&& git clone --branch chibios-21.11.x https://github.com/ChibiOS/ChibiOS-Contrib.git --depth 1 ./sources/ChibiOs-Contrib

# Clone repos for AzureRTOS
RUN git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/threadx.git --depth 1 ./sources/AzureRTOS \
&& git clone --branch v6.3.0_rel --recursive https://github.com/eclipse-threadx/netxduo.git --depth 1 ./sources/NetxDuo

# Clone dependent repos (mbedtls, fatfs and littlefs)
RUN git clone --branch mbedtls-3.5.2 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
&& git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs

# Clone FreeRTOS and what is needed for ESP32
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5

# Clone lwIP for STM32 and NXP
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip

# Clone ESP-IDF
RUN git clone --branch v5.1.4 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Clone what is needed for TI
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
# you can't use the nanoFramework repository as it's Windows only
# && git clone --branch 3.61.00.16 https://github.com/nanoframework/TI_XDCTools.git --depth 1 ./sources/TI_XDCTools \
&& git clone --branch 5.40.00.40 https://github.com/nanoframework/SimpleLink_CC13xx_26xx_SDK.git --depth 1 ./sources/SimpleLinkCC13 \
&& git clone --branch 1.10.0 https://github.com/nanoframework/TI_SysConfig.git --depth 1 ./sources/TI_SysConfig \
&& chmod +x ./sources/TI_SysConfig/sysconfig_cli.sh

# set gcc location
ARG TMP_GCC_PATH=/usr/local/bin/gcc
ENV ARM_GCC_PATH=$TMP_GCC_PATH/bin

# Copy from our other container
COPY --from=downloader /tmp/dc-extracted/gcc $TMP_GCC_PATH
COPY --from=downloader /tmp/dc-extracted/titools/xdctools_3_62_00_08_core /usr/local/bin/titools
COPY --from=downloader /tmp/dc-extracted/cmake /usr/bin/cmake

ENV PATH=/usr/bin/cmake/bin:${PATH}

# Putting hex2dfu in the container
ENV HEX2DFU_PATH=/usr/local/bin/hex2dfu

ARG HEX2DFU=https://github.com/nanoframework/hex2dfu/releases/latest/download/hex2dfu
RUN mkdir -p $HEX2DFU_PATH \
&& curl -o $HEX2DFU_PATH/hex2dfu $HEX2DFU -L \
&& chmod +x $HEX2DFU_PATH/hex2dfu

# Creating static link python for pyhton3
RUN ln -fs /usr/bin/python3 /usr/bin/python \
&& pip3 install pyserial

# Install ESP-IDF
ENV IDF_PATH=/sources/esp-idf
ENV ESP_PATCH_VER=esp-12.2.0_20230208
# This is now taking care in the following line
# RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh

ENV PATH=/root/.espressif/python_env/idf5.1_py3.11_env/bin:$PATH:\
$IDF_PATH/components/esptool_py/esptool:\
$IDF_PATH/components/espcoredump:\
$IDF_PATH/components/partition_table/:\
$IDF_PATH/tools/:\
$IDF_PATH/components/app_update:\
/root/.espressif/tools/xtensa-esp32-elf/$ESP_PATCH_VER/xtensa-esp32-elf/bin:\
/root/.espressif/tools/xtensa-esp32s2-elf/$ESP_PATCH_VER/xtensa-esp32s2-elf/bin:\
/root/.espressif/tools/xtensa-esp32s3-elf/$ESP_PATCH_VER/xtensa-esp32s3-elf/bin:\
/root/.espressif/tools/riscv32-esp-elf/$ESP_PATCH_VER/riscv32-esp-elf/bin

# Clean up downloaded files
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
FROM ubuntu:latest AS downloader
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils \
&& apt-get install -y \
curl \
xz-utils \
unzip \
wget
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted
ARG GCC_VERSION=13.2.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
&& xz -d /tmp/dc-downloads/gcc-arm.tar.xz \
&& tar -xvf /tmp/dc-downloads/gcc-arm.tar -C /tmp/dc-extracted/gcc --strip-components 1 \
&& rm -rf /tmp/dc-extracted/gcc/share/doc/ /tmp/dc-extracted/gcc/share/gcc-arm-none-eabi/samples/
ARG CMAKE_VERSION=3.27.6
ARG CMAKE_SCRIPT=https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh
RUN wget $CMAKE_SCRIPT \
-q -O /tmp/dc-downloads/cmake-install.sh \
&& chmod u+x /tmp/dc-downloads/cmake-install.sh \
&& mkdir -p /tmp/dc-extracted/cmake \
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \
&& rm /tmp/dc-downloads/cmake-install.sh
# This is TI XDC tools for linux. Cheack all versions here: https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/index.html
ARG TI_TOOL_URL=https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_62_00_08/exports/xdccore/xdctools_3_62_00_08_core_linux.zip
RUN mkdir -p /tmp/dc-extracted/titools \
&& curl -o /tmp/dc-downloads/titools.zip $TI_TOOL_URL -L \
&& unzip -d /tmp/dc-extracted/titools /tmp/dc-downloads/titools.zip
FROM python:3.11 AS devcontainer
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# You can set up non-root user
# ARG USERNAME=vscode
# ARG USER_UID=1000
# ARG USER_GID=$USER_UID
# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 \
&& apt-get install -y \
git \
git-lfs \
git-svn \
subversion \
clang-format \
curl \
ninja-build \
srecord \
nodejs \
libffi-dev
# Create needed directories
RUN mkdir -p /usr/local/bin/gcc \
&& mkdir -p /usr/local/bin/titools
# Clone ChibiOS repo
# RUN git svn clone http://svn.code.sf.net/p/chibios/code/branches/stable_21.11.x -rHEAD ./sources/ChibiOs
# Alternative source for those having issues with git svn downloads:
RUN git clone --branch stable_21.11.x https://github.com/ArduPilot/ChibiOS.svn.git --depth 1 ./sources/ChibiOs
# Clone support repos for STM32 including AzureRTOS
RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git --depth 1 ./sources/STM32CubeL4 \
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF7.git --depth 1 ./sources/STM32CubeF7 \
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF4.git --depth 1 ./sources/STM32CubeF4 \
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeH7.git --depth 1 ./sources/STM32CubeH7 \
&& git clone --branch chibios-21.11.x https://github.com/ChibiOS/ChibiOS-Contrib.git --depth 1 ./sources/ChibiOs-Contrib
# Clone repos for AzureRTOS
RUN git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/threadx.git --depth 1 ./sources/AzureRTOS \
&& git clone --branch v6.3.0_rel --recursive https://github.com/eclipse-threadx/netxduo.git --depth 1 ./sources/NetxDuo
# Clone dependent repos (mbedtls, fatfs and littlefs)
RUN git clone --branch mbedtls-3.5.2 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
&& git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs
# Clone FreeRTOS and what is needed for ESP32
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5
# Clone lwIP for STM32 and NXP
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip
# Clone ESP-IDF
RUN git clone --branch v5.2.2 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
# Clone what is needed for TI
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
# you can't use the nanoFramework repository as it's Windows only
# && git clone --branch 3.61.00.16 https://github.com/nanoframework/TI_XDCTools.git --depth 1 ./sources/TI_XDCTools \
&& git clone --branch 5.40.00.40 https://github.com/nanoframework/SimpleLink_CC13xx_26xx_SDK.git --depth 1 ./sources/SimpleLinkCC13 \
&& git clone --branch 1.10.0 https://github.com/nanoframework/TI_SysConfig.git --depth 1 ./sources/TI_SysConfig \
&& chmod +x ./sources/TI_SysConfig/sysconfig_cli.sh
# set gcc location
ARG TMP_GCC_PATH=/usr/local/bin/gcc
ENV ARM_GCC_PATH=$TMP_GCC_PATH/bin
# Copy from our other container
COPY --from=downloader /tmp/dc-extracted/gcc $TMP_GCC_PATH
COPY --from=downloader /tmp/dc-extracted/titools/xdctools_3_62_00_08_core /usr/local/bin/titools
COPY --from=downloader /tmp/dc-extracted/cmake /usr/bin/cmake
ENV PATH=/usr/bin/cmake/bin:${PATH}
# Putting hex2dfu in the container
ENV HEX2DFU_PATH=/usr/local/bin/hex2dfu
ARG HEX2DFU=https://github.com/nanoframework/hex2dfu/releases/latest/download/hex2dfu
RUN mkdir -p $HEX2DFU_PATH \
&& curl -o $HEX2DFU_PATH/hex2dfu $HEX2DFU -L \
&& chmod +x $HEX2DFU_PATH/hex2dfu
# Creating static link python for pyhton3
RUN ln -fs /usr/bin/python3 /usr/bin/python \
&& pip3 install pyserial
# Install ESP-IDF
ENV IDF_PATH=/sources/esp-idf
ENV ESP_PATCH_VER=esp-13.2.0_20230928
# This is now taking care in the following line
# RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh
ENV PATH=/root/.espressif/python_env/idf5.1_py3.11_env/bin:$PATH:\
$IDF_PATH/components/esptool_py/esptool:\
$IDF_PATH/components/espcoredump:\
$IDF_PATH/components/partition_table/:\
$IDF_PATH/tools/:\
$IDF_PATH/components/app_update:\
/root/.espressif/tools/xtensa-esp32-elf/$ESP_PATCH_VER/xtensa-esp32-elf/bin:\
/root/.espressif/tools/xtensa-esp32s2-elf/$ESP_PATCH_VER/xtensa-esp32s2-elf/bin:\
/root/.espressif/tools/xtensa-esp32s3-elf/$ESP_PATCH_VER/xtensa-esp32s3-elf/bin:\
/root/.espressif/tools/riscv32-esp-elf/$ESP_PATCH_VER/riscv32-esp-elf/bin
# Clean up downloaded files
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
2 changes: 1 addition & 1 deletion .devcontainer/ESP32/Dockerfile.ESP32
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-esp32:v2.31
FROM ghcr.io/nanoframework/dev-container-esp32:v2.32
Loading

0 comments on commit a384668

Please sign in to comment.