Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Adjusting Dockerfiles for ESP32 IDF4.3 #2101

Merged
merged 1 commit into from
Oct 15, 2021
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile.All
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-all:v1.3
FROM ghcr.io/nanoframework/dev-container-all:v2.0
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile.ESP32
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-esp32:v1.2
FROM ghcr.io/nanoframework/dev-container-esp32:v2.0
46 changes: 17 additions & 29 deletions .devcontainer/sources/Dockerfile.All
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,6 @@ RUN curl -o /tmp/dc-downloads/cmake.sh $CMAKE_SCRIPT \
&& chmod +x /tmp/dc-downloads/cmake.sh \
&& bash /tmp/dc-downloads/cmake.sh --skip-license --prefix=/tmp/dc-extracted/cmake

ARG IDF_URI=https://dl.espressif.com/dl/esp-idf/releases/esp-idf-v3.3.5.zip
RUN curl -o /tmp/dc-downloads/esp-idf.zip $IDF_URI \
&& unzip -d /tmp/dc-extracted/esp-idf /tmp/dc-downloads/esp-idf.zip

ARG IDF_LIBS_URI=https://dl.cloudsmith.io/public/net-nanoframework/internal-build-tools/raw/names/IDF_libs/versions/v3.3.5/IDF_libs-v3.3.5.zip
RUN curl -o /tmp/dc-downloads/esp-idf-libs.zip $IDF_LIBS_URI -L \
&& unzip -d /tmp/dc-extracted/esp-idf-libs /tmp/dc-downloads/esp-idf-libs.zip

ARG IDF_LIBS_URI=https://dl.cloudsmith.io/public/net-nanoframework/internal-build-tools/raw/names/IDF_libs/versions/v3.3.5_BLE/IDF_libs-v3.3.5_BLE.zip
RUN curl -o /tmp/dc-downloads/esp-idf-libs-ble.zip $IDF_LIBS_URI -L \
&& unzip -d /tmp/dc-extracted/esp-idf-libs_BLE /tmp/dc-downloads/esp-idf-libs-ble.zip

ARG IDF_LIBS_URI=https://dl.cloudsmith.io/public/net-nanoframework/internal-build-tools/raw/names/IDF_libs/versions/v3.3.5_V3/IDF_libs-v3.3.5_V3.zip
RUN curl -o /tmp/dc-downloads/esp-idf-libs-v3.zip $IDF_LIBS_URI -L \
&& unzip -d /tmp/dc-extracted/esp-idf-libs_V3 /tmp/dc-downloads/esp-idf-libs-v3.zip

ARG XTENSA_URI=https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz
RUN mkdir -p /tmp/dc-extracted/xtensa \
&& curl -o /tmp/dc-downloads/xtensa.tar.gz $XTENSA_URI \
&& tar -xzf /tmp/dc-downloads/xtensa.tar.gz -C /tmp/dc-extracted/xtensa --strip-components 1

# This is TI XDC tools for linux. Cheack all versions here: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/index.html
ARG TI_TOOL_URL=http://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 \
Expand Down Expand Up @@ -66,11 +45,11 @@ RUN apt-get update \
srecord \
python3 \
python3-pip \
nodejs
nodejs \
libffi-dev

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

# Clone repos for STM32 including AzureRTOS
Expand All @@ -87,8 +66,16 @@ RUN git clone --branch mbedtls-2.26.0 https://github.com/ARMmbed/mbedtls.git --d
# 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 \
&& git clone --branch STABLE-2_0_3_RELEASE https://git.savannah.nongnu.org/git/lwip.git --depth 1 ./sources/lwip \
&& git clone --branch nf-build https://github.com/nanoframework/spiffs.git --depth 1 ./sources/spiffs

# The certificate of this one is not prolely propagated in the base image, ignoring the verification of this clone
ENV GIT_SSL_NO_VERIFY=1
RUN git clone --branch STABLE-2_0_3_RELEASE https://git.savannah.nongnu.org/git/lwip.git --depth 1 ./sources/lwip
ENV GIT_SSL_NO_VERIFY=0

# Clone ESP-IDF
RUN git clone --branch release/v4.3 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
Expand All @@ -100,11 +87,6 @@ RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC
# Copy from our other container
COPY --from=downloader /tmp/dc-extracted/gcc /usr/local/bin/gcc
COPY --from=downloader /tmp/dc-extracted/cmake /usr
COPY --from=downloader /tmp/dc-extracted/esp-idf /sources/esp-idf
COPY --from=downloader /tmp/dc-extracted/esp-idf-libs_BLE /sources/esp-idf-libs_BLE
COPY --from=downloader /tmp/dc-extracted/esp-idf-libs_V3 /sources/esp-idf-libs_V3
COPY --from=downloader /tmp/dc-extracted/esp-idf-libs /sources/esp-idf-libs
COPY --from=downloader /tmp/dc-extracted/xtensa /usr/local/bin/xtensa
COPY --from=downloader /tmp/dc-extracted/titools/xdctools_3_62_00_08_core /usr/local/bin/titools
# COPY ./scripts/git-pull-repos.sh /usr/local/git-pull-repos.sh

Expand All @@ -118,6 +100,12 @@ RUN mkdir -p /usr/local/bin/hex2dfu \
RUN ln -fs /usr/bin/python3 /usr/bin/python \
&& pip3 install pyserial

# Install ESP-IDF
ENV IDF_PATH=/sources/esp-idf
RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh
ENV PATH=$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-2021r1-8.4.0/xtensa-esp32-elf/bin:/root/.espressif/tools/xtensa-esp32s2-elf/esp-2021r1-8.4.0/xtensa-esp32s2-elf/bin:/root/.espressif/tools/riscv32-esp-elf/esp-2021r1-8.4.0/riscv32-esp-elf/bin

# Clean up downloaded files
RUN apt-get autoremove -y \
&& apt-get clean -y \
Expand Down
49 changes: 12 additions & 37 deletions .devcontainer/sources/Dockerfile.ESP32
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,6 @@ RUN curl -o /tmp/dc-downloads/cmake.sh $CMAKE_SCRIPT \
&& chmod +x /tmp/dc-downloads/cmake.sh \
&& bash /tmp/dc-downloads/cmake.sh --skip-license --prefix=/tmp/dc-extracted/cmake

ARG IDF_URI=https://dl.espressif.com/dl/esp-idf/releases/esp-idf-v3.3.5.zip
RUN curl -o /tmp/dc-downloads/esp-idf.zip $IDF_URI \
&& unzip -d /tmp/dc-extracted/esp-idf /tmp/dc-downloads/esp-idf.zip

ARG IDF_LIBS_URI=https://dl.cloudsmith.io/public/net-nanoframework/internal-build-tools/raw/names/IDF_libs/versions/v3.3.5/IDF_libs-v3.3.5.zip
RUN curl -o /tmp/dc-downloads/esp-idf-libs.zip $IDF_LIBS_URI -L \
&& unzip -d /tmp/dc-extracted/esp-idf-libs /tmp/dc-downloads/esp-idf-libs.zip

ARG IDF_LIBS_URI=https://dl.cloudsmith.io/public/net-nanoframework/internal-build-tools/raw/names/IDF_libs/versions/v3.3.5_BLE/IDF_libs-v3.3.5_BLE.zip
RUN curl -o /tmp/dc-downloads/esp-idf-libs-ble.zip $IDF_LIBS_URI -L \
&& unzip -d /tmp/dc-extracted/esp-idf-libs_BLE /tmp/dc-downloads/esp-idf-libs-ble.zip

ARG IDF_LIBS_URI=https://dl.cloudsmith.io/public/net-nanoframework/internal-build-tools/raw/names/IDF_libs/versions/v3.3.5_V3/IDF_libs-v3.3.5_V3.zip
RUN curl -o /tmp/dc-downloads/esp-idf-libs-v3.zip $IDF_LIBS_URI -L \
&& unzip -d /tmp/dc-extracted/esp-idf-libs_V3 /tmp/dc-downloads/esp-idf-libs-v3.zip

ARG XTENSA_URI=https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-97-gc752ad5-5.2.0.tar.gz
RUN mkdir -p /tmp/dc-extracted/xtensa \
&& curl -o /tmp/dc-downloads/xtensa.tar.gz $XTENSA_URI \
&& tar -xzf /tmp/dc-downloads/xtensa.tar.gz -C /tmp/dc-extracted/xtensa --strip-components 1

FROM debian:10.4-slim AS devcontainer

# Avoid warnings by switching to noninteractive
Expand All @@ -59,42 +38,38 @@ RUN apt-get update \
srecord \
python3 \
python3-pip \
nodejs
nodejs \
libffi-dev

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

# Clone mbedtls and fatfs
RUN git clone --branch mbedtls-2.26.0 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
&& git clone --branch R0.14 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs
# 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 \
&& git clone --branch STABLE-2_0_3_RELEASE https://git.savannah.nongnu.org/git/lwip.git --depth 1 ./sources/lwip \
&& git clone --branch nf-build https://github.com/nanoframework/spiffs.git --depth 1 ./sources/spiffs

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

# Copy from our other container
COPY --from=downloader /tmp/dc-extracted/gcc /usr/local/bin/gcc
COPY --from=downloader /tmp/dc-extracted/cmake /usr
COPY --from=downloader /tmp/dc-extracted/esp-idf /sources/esp-idf
COPY --from=downloader /tmp/dc-extracted/esp-idf-libs_BLE /sources/esp-idf-libs_BLE
COPY --from=downloader /tmp/dc-extracted/esp-idf-libs_V3 /sources/esp-idf-libs_V3
COPY --from=downloader /tmp/dc-extracted/esp-idf-libs /sources/esp-idf-libs
COPY --from=downloader /tmp/dc-extracted/xtensa /usr/local/bin/xtensa
# COPY ./scripts/git-pull-repos.sh /usr/local/git-pull-repos.sh

# Putting hex2dfu in the container
ARG HEX2DFU=https://github.com/nanoframework/hex2dfu/releases/download/v2.0.9/hex2dfu
RUN mkdir -p /usr/local/bin/hex2dfu \
&& curl -o /usr/local/bin/hex2dfu/hex2dfu $HEX2DFU -L \
&& chmod +x /usr/local/bin/hex2dfu/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
RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh
ENV PATH=$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-2021r1-8.4.0/xtensa-esp32-elf/bin:/root/.espressif/tools/xtensa-esp32s2-elf/esp-2021r1-8.4.0/xtensa-esp32s2-elf/bin:/root/.espressif/tools/riscv32-esp-elf/esp-2021r1-8.4.0/riscv32-esp-elf/bin

# Clean up downloaded files
RUN apt-get autoremove -y \
&& apt-get clean -y \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and push image for all RTOS

env:
GCR_IMAGE: ghcr.io/nanoframework/dev-container-all
GCR_VERSION: v1.3
GCR_VERSION: v2.0
GCR_FILE: .devcontainer/sources/Dockerfile.All

# Controls when the action will run.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/esp32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and push ESP32 image

env:
GCR_IMAGE: ghcr.io/nanoframework/dev-container-esp32
GCR_VERSION: v1.2
GCR_VERSION: v2.0
GCR_FILE: .devcontainer/sources/Dockerfile.ESP32

# Controls when the action will run.
Expand Down
32 changes: 16 additions & 16 deletions .vscode/cmake-variants-DEVCONTAINER.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,17 @@
"API_System.Math": "ON"
}
},
"ESP32_REV1": {
"short": "ESP32_REV1",
"ESP32_REV0": {
"short": "ESP32_REV0",
"settings": {
"BUILD_VERBOSE": "OFF",
"BUILD_VERSION": "0.9.99.999",
"CMAKE_TOOLCHAIN_FILE": "CMake/toolchain.xtensa-esp32-elf.cmake",
"TARGET_SERIES": "ESP32",
"TARGET_BOARD": "ESP32",
"TARGET_NAME": "ESP32_REV1",
"TARGET_NAME": "ESP32_REV0",
"SDK_CONFIG_FILE": "",
"ESP32_IDF_PATH": "",
"ESP32_IDF_PATH": "/sources/esp-idf",
"RTOS": "ESP32",
"NF_BUILD_RTM": "OFF",
"NF_FEATURE_DEBUGGER": "ON",
Expand All @@ -300,7 +300,7 @@
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"NF_SECURITY_MBEDTLS": "ON",
"MBEDTLS_SOURCE": "",
"MBEDTLS_SOURCE": "/sources/mbedtls",
"API_System.Math": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
Expand All @@ -323,17 +323,17 @@
"API_nanoFramework.Graphics": "OFF"
}
},
"ESP32_REV1_BLE": {
"short": "ESP32_REV1_BLE",
"ESP32_REV0_BLE": {
"short": "ESP32_REV0_BLE",
"settings": {
"BUILD_VERBOSE": "OFF",
"BUILD_VERSION": "0.9.99.999",
"CMAKE_TOOLCHAIN_FILE": "CMake/toolchain.xtensa-esp32-elf.cmake",
"TARGET_SERIES": "ESP32",
"TARGET_BOARD": "ESP32",
"TARGET_NAME": "ESP32_REV1_BLE",
"TARGET_NAME": "ESP32_REV0_BLE",
"SDK_CONFIG_FILE": "sdkconfig.default_ble.esp32",
"ESP32_IDF_PATH": "",
"ESP32_IDF_PATH": "/sources/esp-idf",
"RTOS": "ESP32",
"NF_BUILD_RTM": "OFF",
"NF_FEATURE_DEBUGGER": "ON",
Expand All @@ -344,7 +344,7 @@
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"NF_SECURITY_MBEDTLS": "ON",
"MBEDTLS_SOURCE": "",
"MBEDTLS_SOURCE": "/sources/mbedtls",
"API_System.Math": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
Expand Down Expand Up @@ -378,7 +378,7 @@
"TARGET_BOARD": "ESP32",
"TARGET_NAME": "ESP32_PICO",
"SDK_CONFIG_FILE": "sdkconfig.default_pico",
"ESP32_IDF_PATH": "",
"ESP32_IDF_PATH": "/sources/esp-idf",
"RTOS": "ESP32",
"TARGET_SERIAL_BAUDRATE": "115200",
"NF_BUILD_RTM": "OFF",
Expand All @@ -390,7 +390,7 @@
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"NF_SECURITY_MBEDTLS": "ON",
"MBEDTLS_SOURCE": "",
"MBEDTLS_SOURCE": "/sources/mbedtls",
"API_System.Math": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
Expand Down Expand Up @@ -423,7 +423,7 @@
"TARGET_BOARD": "ESP32",
"TARGET_NAME": "ESP_WROVER_KIT",
"SDK_CONFIG_FILE": "",
"ESP32_IDF_PATH": "",
"ESP32_IDF_PATH": "/sources/esp-idf",
"RTOS": "ESP32",
"NF_BUILD_RTM": "OFF",
"NF_FEATURE_DEBUGGER": "ON",
Expand All @@ -434,7 +434,7 @@
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"NF_SECURITY_MBEDTLS": "ON",
"MBEDTLS_SOURCE": "",
"MBEDTLS_SOURCE": "/sources/mbedtls",
"API_System.Math": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
Expand Down Expand Up @@ -469,7 +469,7 @@
"TARGET_BOARD": "ESP32",
"TARGET_NAME": "ESP32_LILYGO",
"SDK_CONFIG_FILE": "",
"ESP32_IDF_PATH": "",
"ESP32_IDF_PATH": "/sources/esp-idf",
"RTOS": "ESP32",
"NF_BUILD_RTM": "OFF",
"NF_FEATURE_DEBUGGER": "ON",
Expand All @@ -482,7 +482,7 @@
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"NF_SECURITY_MBEDTLS": "ON",
"MBEDTLS_SOURCE": "",
"MBEDTLS_SOURCE": "/sources/mbedtls",
"API_System.Math": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
Expand Down