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

Commit 90e14e7c authored by Alfredo Herrera's avatar Alfredo Herrera
Browse files

added steps to install NXP SDK

parent 4ec7efd1
......@@ -35,41 +35,54 @@ fi
# Show commands being used and error out on unexpected situations
set -eux
if [ -f 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
fi
if [ -f 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
fi
cd /home/${USERNAME}
mkdir vega
mkdir toolchain
#---
# Install rv32m1 SDK tools
#---
echo "Installing rv32m1 tools"; echo""
cd /home/$USERNAME
mkdir /home/$USERNAME/vega
curl -L https://github.com/open-isa-org/open-isa.org/releases/download/1.0.0/rv32m1_sdk_riscv_installer.sh > rv32m1_sdk_riscv_installer.sh
# Convert SDK shell script into the tar file -- this implictly accepts the license and extracts to /home/user/vega
ARCHIVE=$(awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' "rv32m1_sdk_riscv_installer.sh")
tail -n+${ARCHIVE} "rv32m1_sdk_riscv_installer.sh" | tar -xz > /dev/null 2>&1 || true
pushd /home/$USERNAME/vega
tar xf /home/$USERNAME/rv32m1_sdk_riscv.tar.gz
pushd /home/${USERNAME}/vega
${BINDIR}/rv32m1_sdk_riscv_installer.sh
popd
#---
# Extract toolchain, takes two steps as there are archives in Toolchain_Linux.tar.gz)
mkdir /home/$USERNAME/toolchain
curl -L https://github.com/open-isa-org/open-isa.org/releases/download/1.0.0/Toolchain_Linux.tar.gz > Toolchain_Linux.tar.gz
pushd toolchain
tar xf /home/user/Toolchain_Linux.tar.gz # this makes tar files for next lines
#---
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
# Set the toolchain defaults for GNU MCU plug-ins to what we just "installed"
mkdir -p /home/$USERNAME/eclipse/configuration/.settings/
# openocd location
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 GNU MCU plug-ins
#---
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
# gcc & friends location
echo "eclipse.preferences.version=1" > /home/$USERNAME/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.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
echo "toolchain.path.512258282=/home/${USERNAME}/toolchain/riscv32-unknown-elf-gcc/bin" >> /home/${USERNAME}/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.prefs
rm rv32m1_sdk_riscv.tar.gz rv32m1_sdk_riscv_installer.sh Toolchain_Linux.tar.gz toolchain/riscv32-unknown-elf-gcc.tar.gz toolchain/openocd.tar.gz
rm toolchain/riscv32-unknown-elf-gcc.tar.gz toolchain/openocd.tar.gz
......@@ -50,12 +50,13 @@ apt-get install -y openssh-server xauth git-core lsb-core xorg vim-gtk3 dos2unix
apt-get upgrade
apt-get clean
apt-get autoremove --purge
cd "$(dirname "$0")"
export BINDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${BINDIR}
#---
# Install PULP-Platform GNU toolchain
#---
sudo -u $USERNAME pulp_install.sh
sudo -u ${USERNAME} pulp_install.sh
#---
# Install Verilator tool
......@@ -64,7 +65,14 @@ verilator_install.sh
#---
# Install Elipse-IDE and MCU plugins
sudo -u $USERNAME eclipse-mcu_install.sh
#---
sudo -u ${USERNAME} eclipse-mcu_install.sh
#---
# Install NXP VEGA board SDK
#---
sudo -u ${USERNAME} rv32m1_install.sh
#---
# Install SEGGER J-Link drivers
......@@ -76,12 +84,12 @@ apt-get install -f ./JLink_Linux_V650a_x86_64.deb
#---
# append to ~/.bashrc
#---
if [ -f /home/$USERNAME/LICENSE ]
if [ -f /home/${USERNAME}/LICENSE ]
then
cp ../LICENSE /home/$USERNAME/Apache_license_v2.0.txt
cp ../LICENSE /home/${USERNAME}/Apache_license_v2.0.txt
fi
cat > /home/$USERNAME/.BTADS_welcom.txt <<EOF
cat > /home/${USERNAME}/.BTADS_welcom.txt <<EOF
#-----------------------------------------------------------------------------
# Copyright (c) 2019 BTA Design Services Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
......@@ -100,14 +108,14 @@ cat > /home/$USERNAME/.BTADS_welcom.txt <<EOF
#------------------------------------------------------------------------------
EOF
cat >> /home/$USERNAME/.bashrc <<EOF
cat >> /home/${USERNAME}/.bashrc <<EOF
#------------------------------------------------------------------------------
# Additional settings
#------------------------------------------------------------------------------
if [ -f /home/$USERNAME/.editor ]
if [ -f /home/${USERNAME}/.editor ]
then
EDITOR=`cat /home/$USERNAME/.editor`
EDITOR=`cat /home/${USERNAME}/.editor`
fi
export LD_LIBRARY_PATH=/usr/local/lib
......@@ -116,9 +124,10 @@ export PATH=$PATH:$JAVA_HOME/bin:/home/user/eclipse:/home/user/riscv-ovpsim/bin
export RISCV32GCC_DIR="/home/user/pulp"
#export PULP_RISCV_GCC_TOOLCHAIN="/home/user/pulp"
cat /home/$USERNAME/.BTADS_welcome.txt
cat /home/${USERNAME}/.BTADS_welcome.txt
EOF
echo "The installation is done"
echo "Note: use 'evince' to open PDF documents from the command-line prompt"
echo "Note1: use 'evince' to open PDF documents from the command-line prompt"
echo "Note2: you may use 'link2 -g <<http:...>>' for web browsing"
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