Skip to content

Commit

Permalink
Merge pull request #584 from duncandrennan/esp32c3_dev
Browse files Browse the repository at this point in the history
Add docker build for ESP32-C3
  • Loading branch information
rojer committed Nov 15, 2021
2 parents 29114d1 + c5e5291 commit 33d58d2
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tools/docker/esp32c3/Dockerfile-esp32c3-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM ubuntu:bionic-20190807

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
apt-utils autoconf bison build-essential flex gawk gdb-multiarch git gperf help2man \
libexpat-dev libncurses5-dev libtool-bin \
python python-dev python-git python-pyelftools python-serial python-six python-yaml \
python3 python3-dev python3-git python3-pyelftools python3-serial python3-six python3-yaml \
software-properties-common texinfo unzip wget zip && \
apt-get clean

RUN cd /tmp && \
git clone https://github.com/rojer/fsync-stub && \
cd /tmp/fsync-stub && ./install.sh && \
rm -rf /tmp/fsync-stub

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
python-click python3-click \
python-cryptography python3-cryptography \
python-future python3-future \
python-pkg-resources python3-pkg-resources \
python-pyparsing python3-pyparsing \
python-setuptools python3-setuptools \
python-pip python3-pip \
rsync && \
apt-get clean

RUN pip install reedsolo bitstring ecdsa

RUN useradd -d /opt/Espressif -m -s /bin/bash user && chown -R user /opt

ARG TOOLCHAIN_VERSION
RUN cd /opt/Espressif && wget -q https://dl.espressif.com/dl/$TOOLCHAIN_VERSION.tar.gz && \
tar xzf $TOOLCHAIN_VERSION.tar.gz && \
rm $TOOLCHAIN_VERSION.tar.gz
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/Espressif/riscv32-esp-elf/bin
ADD ct_path.sh /etc/profile.d

ARG DOCKER_TAG
RUN git clone -j 8 --branch $DOCKER_TAG --depth 1 --recursive --shallow-submodules https://github.com/duncandrennan/esp-idf.git /opt/Espressif/esp-idf
RUN cd /opt/Espressif/esp-idf && git tag v$DOCKER_TAG
ENV IDF_PATH=/opt/Espressif/esp-idf

# Apply submodule patches.
#RUN cd $IDF_PATH && ./patch_submodules.sh

# Pre-build configuration tools
RUN cd $IDF_PATH/tools/kconfig && make conf-idf

ADD rom.bin rom.elf /opt/Espressif/rom/

ADD mgos_fw_meta.py mklfs mkspiffs mkspiffs8 /usr/local/bin/
ADD serve_core/ /opt/serve_core/
RUN ln -s /opt/serve_core/serve_core.py /usr/local/bin/serve_core.py

ARG DOCKER_TAG
ENV MGOS_TARGET_GDB /opt/Espressif/riscv32-esp-elf/bin/riscv32-esp-elf-gdb
ENV MGOS_SDK_REVISION $DOCKER_TAG
ENV MGOS_SDK_BUILD_IMAGE docker.io/mgos/esp32c3-build:$DOCKER_TAG
11 changes: 11 additions & 0 deletions tools/docker/esp32c3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DOCKERFILES = esp32c3-build
SPIFFS_CONFIG_PATH = /vfs-fs-spiffs/include/esp32
TOOLCHAIN_VERSION = riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64
DOCKER_FLAGS = --build-arg=TOOLCHAIN_VERSION=$(TOOLCHAIN_VERSION) \
--build-arg=DOCKER_TAG=$(DOCKER_TAG)

include ../docker.mk

docker-pre-build-esp32c3-build: mgos_fw_meta.py serve_core mklfs mkspiffs mkspiffs8

clean: clean-tools
2 changes: 2 additions & 0 deletions tools/docker/esp32c3/ct_path.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export PATH="$PATH:/opt/Espressif/riscv32-esp-elf/bin"
export SDK_PATH=/opt/Espressif/esp-idf
Binary file added tools/docker/esp32c3/rom.bin
Binary file not shown.
Binary file added tools/docker/esp32c3/rom.elf
Binary file not shown.

0 comments on commit 33d58d2

Please sign in to comment.