mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 09:52:45 +01:00
7b1f083cd8
RIOT-OS uses part of Espressif ESP8266 RTOS SDK to build support for this CPU. The SDK includes some vendor-provided closed source pre-compiled libraries that we need to modify to adapt to RIOT-OS usage. This library modifications was done once and uploaded to a fork of the vendor repository and was provided as an environment variable. This patch changes two things: 1. It installs the SDK as a RIOT PKG from the new pkg/esp8266_sdk directory instead of requiring the user to download it separately. 2. It performs the library modifications (symbol renames) on the pkg Makefile removing the need to use a fork with the modifications applied and simplifying the SDK update and future modifications. This change sets the SDK package version (git SHA) to the same one that our fork was using as a parent in the vendor repository, meaning that the output libraries are exactly the same as before. Tested with ``` ESP8266_RTOS_SDK_DIR=/dev/null USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash ``` and verified that the program works. The boot message now includes: ``` ESP8266-RTOS-SDK Version v3.1-51-g913a06a9 ``` confirming the SDK version used. `/dev/null` in the test is just to make sure that no evaluation of `ESP8266_RTOS_SDK_DIR` in make is affected by the environment variable value which would be set to the SDK for people who followed the set up instructions before this change. Tested the checkout size: ```bash $ du -hs build/pkg/esp8266_sdk/ 124M build/pkg/esp8266_sdk/ ```
94 lines
4.2 KiB
Bash
94 lines
4.2 KiB
Bash
# Install ARM GNU Embedded toolchain
|
|
ARM_GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm"
|
|
ARM_GCC_VERSION="9-2019q4"
|
|
ARM_GCC_ARCHIVE="gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2"
|
|
ARM_GCC_ARCHIVE_URL="${ARM_GCC_URL}/${ARM_GCC_VERSION}/${ARM_GCC_ARCHIVE}"
|
|
|
|
cd /opt && wget -nv -O - "${ARM_GCC_ARCHIVE_URL}" | tar -jxf -
|
|
|
|
echo "export PATH=/opt/gcc-arm-none-eabi-9-2019-q4-major/bin:\$PATH" >> /home/${SSH_USERNAME}/.bashrc
|
|
|
|
# Install MIPS toolchain
|
|
MIPS_VERSION=2018.09-03
|
|
curl -L "https://codescape.mips.com/components/toolchain/${MIPS_VERSION}/Codescape.GNU.Tools.Package.${MIPS_VERSION}.for.MIPS.MTI.Bare.Metal.CentOS-6.x86_64.tar.gz" -o - \
|
|
| tar -C /opt -zx
|
|
rm -rf /opt/mips-mti-elf/*/share/{doc,info,man,locale}
|
|
cd /opt/mips-mti-elf/*/mips-mti-elf/bin
|
|
for f in *; do test -f "../../bin/mips-mti-elf-$f" && ln -f "../../bin/mips-mti-elf-$f" "$f"; done
|
|
cd -
|
|
|
|
echo "export MIPS_ELF_ROOT=/opt/mips-mti-elf/${MIPS_VERSION}" >> /home/${SSH_USERNAME}/.bashrc
|
|
echo "export PATH=\$MIPS_ELF_ROOT/bin:\$PATH" >> /home/${SSH_USERNAME}/.bashrc
|
|
|
|
# Install MSP430 toolchain
|
|
MSP430_URL=https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports
|
|
MSP430_VERSION=8.3.0.16_linux64
|
|
wget -q ${MSP430_URL}/msp430-gcc-${MSP430_VERSION}.tar.bz2 -O- | tar -C /opt -xj
|
|
echo "export PATH=\$PATH:/opt/msp430-gcc-${MSP430_VERSION}/bin" >> /home/${SSH_USERNAME}/.bashrc
|
|
|
|
# Install RISC-V
|
|
RISCV_VERSION=8.2.0-2.2-20190521
|
|
RISCV_BUILD=0004
|
|
wget -q https://github.com/gnu-mcu-eclipse/riscv-none-gcc/releases/download/v${RISCV_VERSION}/gnu-mcu-eclipse-riscv-none-gcc-${RISCV_VERSION}-${RISCV_BUILD}-centos64.tgz -O- \
|
|
| tar -C /opt -xz
|
|
rm -rf /opt/gnu-mcu-eclipse/riscv-none-gcc/*/share/doc
|
|
cd /opt/gnu-mcu-eclipse/riscv-none-gcc/*/riscv-none-embed/bin
|
|
for f in *; do test -f "../../bin/riscv-none-embed-$f" && \
|
|
ln -f "../../bin/riscv-none-embed-$f" "$f"; \
|
|
done
|
|
cd -
|
|
|
|
echo "export PATH=/opt/gnu-mcu-eclipse/riscv-none-gcc/${RISCV_VERSION}-${RISCV_BUILD}/bin:\$PATH" >> /home/${SSH_USERNAME}/.bashrc
|
|
|
|
# Install ESP32 toolchain
|
|
echo 'Installing ESP32 toolchain'
|
|
mkdir -p /opt/esp
|
|
cd /opt/esp
|
|
git clone https://github.com/espressif/esp-idf.git
|
|
cd esp-idf
|
|
git checkout -q f198339ec09e90666150672884535802304d23ec
|
|
git submodule update --init --recursive
|
|
rm -rf .git* docs examples make tools
|
|
rm -f add_path.sh CONTRIBUTING.rst Kconfig Kconfig.compiler
|
|
cd components
|
|
rm -rf app_trace app_update aws_iot bootloader bt coap console cxx \
|
|
esp_adc_cal espcoredump esp_http_client esp-tls expat fatfs \
|
|
freertos idf_test jsmn json libsodium log lwip mbedtls mdns \
|
|
micro-ecc nghttp openssl partition_table pthread sdmmc spiffs \
|
|
tcpip_adapter ulp vfs wear_levelling xtensa-debug-module && \
|
|
find . -name '*.[csS]' -exec rm {} \;
|
|
cd /opt/esp
|
|
git clone https://github.com/gschorcht/xtensa-esp32-elf.git && \
|
|
cd xtensa-esp32-elf
|
|
git checkout -q ca40fb4c219accf8e7c8eab68f58a7fc14cadbab
|
|
|
|
echo "export PATH=/opt/esp/xtensa-esp32-elf/bin:\$PATH" >> /home/${SSH_USERNAME}/.bashrc
|
|
|
|
# Install ESP8266 toolchain
|
|
# Install complete ESP8266 toolchain in /opt/esp (146 MB after cleanup)
|
|
echo 'Installing ESP8266 toolchain' >&2 && \
|
|
cd /opt && \
|
|
git clone https://github.com/gschorcht/RIOT-Xtensa-ESP8266-toolchain.git esp && \
|
|
cd esp && \
|
|
git checkout -q df38b06 && \
|
|
rm -rf .git
|
|
|
|
echo "export PATH=\$PATH:/opt/esp/esp-open-sdk/xtensa-lx106-elf/bin" >> /home/${SSH_USERNAME}/.bashrc
|
|
echo "export ESP8266_SDK_DIR=/opt/esp/esp-open-sdk/sdk" >> /home/${SSH_USERNAME}/.bashrc
|
|
echo "export ESP8266_NEWLIB_DIR=/opt/esp/newlib-xtensa" >> /home/${SSH_USERNAME}/.bashrc
|
|
|
|
# Install complete ESP8266 toolchain in /opt/esp (125 MB after cleanup)
|
|
# remember https://github.com/RIOT-OS/RIOT/pull/10801 when updating
|
|
# NOTE: We install the toolchain for the RTOS SDK in parallel in the first
|
|
# step and remove the old version as soon as the RIOT port for the ESP8266
|
|
# RTOS SDK has been merged.
|
|
echo 'Installing ESP8266 toolchain' >&2 && \
|
|
mkdir -p /opt/esp && \
|
|
cd /opt/esp && \
|
|
git clone https://github.com/gschorcht/xtensa-esp8266-elf && \
|
|
cd xtensa-esp8266-elf && \
|
|
git checkout -q 696257c2b43e2a107d3108b2c1ca6d5df3fb1a6f && \
|
|
rm -rf .git
|
|
|
|
echo "export PATH=\$PATH:/opt/esp/xtensa-esp8266-elf/bin" >> /home/${SSH_USERNAME}/.bashrc
|