IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 64b87585 authored by Alfredo Herrera's avatar Alfredo Herrera
Browse files

modified rv32 installer for NXP SDK files now included

parent 90e14e7c
......@@ -33,41 +33,59 @@ if [ $(id -u) = 0 ]; then
exit 1
fi
# Show commands being used and error out on unexpected situations
set -eux
set -e #ux
if [ -f rv32m1_sdk_riscv_installer.sh ]; then
if [ -z "$USERNAME" ]; then
echo "setting \$USERNAME variable"
export USERNAME=$(logname)
else
echo "Variable already set"
fi
if [ -z "$BINDIR" ]; then
echo "setting \$BINDIR variable"
export BINDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
else
echo "Variable already set"
fi
if [ -f ${BINDIR}/rv32m1_sdk_riscv_installer.sh ]; then
echo "rv32m1_sdk_riscv_installer.sh already downloaded"
else
wget https://github.com/open-isa-org/open-isa.org/releases/download/1.0.0/rv32m1_sdk_riscv_installer.sh
wget https://github.com/open-isa-org/open-isa.org/releases/download/1.0.0/rv32m1_sdk_riscv_installer.sh -O ${BINDIR}/rv32m1_sdk_riscv_installer.sh
chmod 755 ${BINDIR}/rv32m1_sdk_riscv_installer.sh
fi
if [ -f Toolchain_Linux.tar.gz ]; then
if [ -f ${BINDIR}/Toolchain_Linux.tar.gz ]; then
echo "Toolchain_Linux.tar.gz already downloaded"
else
wget https://github.com/open-isa-org/open-isa.org/releases/download/1.0.0/Toolchain_Linux.tar.gz
wget https://github.com/open-isa-org/open-isa.org/releases/download/1.0.0/Toolchain_Linux.tar.gz -O ${BINDIR}/Toolchain_Linux.tar.gz
fi
cd /home/${USERNAME}
mkdir vega
mkdir toolchain
mkdir -p vega
mkdir -p toolchain
#---
# Install rv32m1 SDK tools
#---
echo "Installing rv32m1 tools"; echo""
pushd /home/${USERNAME}/vega
${BINDIR}/rv32m1_sdk_riscv_installer.sh
popd
if [ ! -d "/home/$USERNAME/vega/rv32m1_sdk_riscv" ]; then
echo "Installing rv32m1 tools"; echo""
cd /home/${USERNAME}/vega
(${BINDIR}/rv32m1_sdk_riscv_installer.sh && tar xf ./rv32m1_sdk_riscv.tar.gz)
fi
#---
# Extract toolchain, takes two steps as there are archives in Toolchain_Linux.tar.gz)
#---
echo "Installing GNU MCU toolchain"
pushd /home/${USERNAME}/toolchain
tar xf ${BINDIR}/Toolchain_Linux.tar.gz # this makes tar files for next lines
tar xf riscv32-unknown-elf-gcc.tar.gz
tar xf openocd.tar.gz
popd
if [ ! -d "/home/$USERNAME/toolchain/riscv32-unknown-elf-gcc" ]; then
echo "Installing GNU MCU toolchain"
cd /home/${USERNAME}/toolchain
tar xf ${BINDIR}/Toolchain_Linux.tar.gz # this makes tar files for next lines
tar xf riscv32-unknown-elf-gcc.tar.gz
tar xf openocd.tar.gz
fi
cd
#---
# Set the toolchain defaults for GNU MCU plug-ins
......@@ -75,14 +93,20 @@ popd
mkdir -p /home/${USERNAME}/eclipse/configuration/.settings/
echo "eclipse.preferences.version=1" > /home/${USERNAME}/eclipse/configuration/.settings/ilg.gnumcueclipse.debug.gdbjtag.openocd.prefs
echo "install.folder=/home/${USERNAME}/toolchain" >> /home/${USERNAME}/eclipse/configuration/.settings/ilg.gnumcueclipse.debug.gdbjtag.openocd.prefs
#
#---
# Set the toolchain defaults for g++
#---
echo "eclipse.preferences.version=1" > /home/${USERNAME}/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.prefs
# (magic number comes from https://github.com/gnu-mcu-eclipse/eclipse-plugins/blob/ce601cf2ec20cba90d9f2c2fbdb236b5fd7a6385/bundles/ilg.gnumcueclipse.managedbuild.cross.riscv/src/ilg/gnumcueclipse/managedbuild/cross/riscv/ToolchainDefinition.java#L30)
# Modified for pre-release version
echo "toolchain.path.512258282=/home/${USERNAME}/toolchain/riscv32-unknown-elf-gcc/bin" >> /home/${USERNAME}/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.prefs
rm toolchain/riscv32-unknown-elf-gcc.tar.gz toolchain/openocd.tar.gz
if [ -f "/home/$USERNAME/vega/rv32m1_sdk_riscv.tar.gz" ]; then
rm /home/${USERNAME}/vega/rv32m1_sdk_riscv.tar.gz
fi
if [ -f "/home/$USERNAME/toolchain/riscv32-unknown-elf-gcc.tar.gz" ]; then
rm /home/${USERNAME}/toolchain/riscv32-unknown-elf-gcc.tar.gz
fi
if [ -f "/home/$USERNAME/toolchain/openocd.tar.gz" ]; then
rm /home/${USERNAME}/toolchain/openocd.tar.gz
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment