Skip to content

MichaelLT38/RISC-V-Metal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programming SiFive RISC-V and Red-V boards

The code here is a very simple low-level look at the two SiFive HiFive and Red-V boards which are long out of production now. I did incorperate QEMU for those without these now rare hard to find boards. So not all is lost.

##Project requires QEMU and RISC-V Toolchain

sudo apt update && sudo apt upgrade -y
apt install qemu-system

#RISC-V Toolchain

sudo apt install git-all
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
mkdir risc-v
cd risc-v
git clone https://github.com/riscv/riscv-gnu-toolchain.git
mkdir /opt/riscv
./configure --prefix=/opt/riscv --enable-multilib
make

#Adding to path:

echo 'export PATH=/opt/riscv/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

#Verify

riscv64-unknown-elf-gcc --version

#run

make

If this is successful in QEMU, you will see instruction for compiling for hardware(make hardware). It does require a different linker script which is provided. Simply drag and drop the hex in the file directory that represent your board. It will simply print hello world to the terminal.

About

Low-level sample with QEMU testing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published