diff --git a/Dockerfile.toolchain b/Dockerfile.toolchain index 26b8e9e..9455ae4 100644 --- a/Dockerfile.toolchain +++ b/Dockerfile.toolchain @@ -4,6 +4,8 @@ MAINTAINER runtime.io ENV DEBIAN_FRONTEND noninteractive ARG JLINK_RELEASE +ARG OPENOCD_RELEASE + # gcc-arm-embedded is pulled from ppa:team-gcc-arm-embedded/ppa RUN apt-get update && \ @@ -19,7 +21,20 @@ RUN apt-get update && \ gcc-multilib \ gcc-arm-embedded \ gdb \ - openocd \ + libhidapi-hidraw0 \ + libftdi-dev \ + libgpiod-dev \ + libusb-0.1-4 \ + libusb-1.0-0 \ + libhidapi-dev \ + libusb-1.0-0-dev \ + libusb-dev \ + libtool \ + make \ + automake \ + pkg-config \ + autoconf \ + texinfo \ netcat && \ apt-get autoremove && \ apt-get clean && \ @@ -30,3 +45,29 @@ COPY JLink_Linux_V${JLINK_RELEASE}_x86_64.deb /tmp/ RUN dpkg -i /tmp/JLink_Linux_V${JLINK_RELEASE}_x86_64.deb && \ dpkg-query -l && \ rm /tmp/JLink_Linux_V${JLINK_RELEASE}_x86_64.deb + +#build and install OPENOCD from repository +RUN cd /usr/src/ \ + && git clone --depth 1 https://git.code.sf.net/p/openocd/code openocd \ + && cd openocd \ + && git checkout ${OPENOCD_RELEASE} \ + && ./bootstrap \ + && ./configure --enable-cmsis-dap --enable-xlnx-pcie-xvc \ + && make -j"$(nproc)" \ + && make install \ + && cp /usr/local/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d/60-openocd.rules \ + && rm -rf /usr/src/openocd \ + && apt -y purge libftdi-dev \ + libgpiod-dev \ + libhidapi-dev \ + libusb-1.0-0-dev \ + libusb-dev \ + libtool \ + make \ + automake \ + pkg-config \ + autoconf \ + texinfo + +# OpenOCD telnet port +EXPOSE 4444 diff --git a/Makefile b/Makefile index 571b215..c0bd816 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ JLINK_RELEASE := 648 JLINK_BIN := JLink_Linux_V$(JLINK_RELEASE)_x86_64.deb JLINK_URL := https://www.segger.com/downloads/jlink JLINK_CHKS := $(JLINK_BIN).sha256 +OPENOCD_RELEASE := b3a4f771 all: @echo "make toolchain-image"