Raymond Yang
05/08/2023, 8:43 AMmake flash
for caravel_board/stanford/blink
. I realized I needed a .c file to configure the GPIOs since they were all configured to be outputs in the blink.c
file, and currently the blink firmware is the one on my dev board.
What I did to install the toolchain:
git clone <https://github.com/riscv/riscv-gnu-toolchain>
cd riscv-gnu-toolchain
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build
mkdir build && cd build
../configure --prefix=/home/rhyang/chip/riscv-tools-install --with-arch=rv32imc --enable-multilib
make
Upon successful installation, I cd'ed into ../stanford/blink
and edited the TOOLCHAIN_PATH
to /home/rhyang/chip/riscv-tools-install
.
Am I going in the right path? Thanks.Tim Edwards
05/08/2023, 12:48 PMRaymond Yang
05/08/2023, 3:25 PMTOOLCHAIN_PREFIX
to riscv32-unknown-elf-gcc
, currently the error I am seeing is:
(chip) rhyang@rhyang-ThinkPad-P1:~/chip/caravel_board/stanford/blink$ make flash
#/home/rhyang/chip/riscv-tools-install/bin/riscv32-unknown-elf-gcc -O0 -march=rv32i -Wl,-Bstatic,-T,../sections.lds,--strip-debug -ffreestanding -nostdlib -o blink.elf ../start.s ../print_io.c blink.c
/home/rhyang/chip/riscv-tools-install/bin/riscv32-unknown-elf-gcc -I../ -I../generated/ -O0 -mabi=ilp32 -march=rv32i -D__vexriscv__ -Wl,-Bstatic,-T,../sections.lds,--strip-debug -ffreestanding -nostdlib -o blink.elf ../crt0_vex.S ../isr.c ../stub.c blink.c
../crt0_vex.S: Assembler messages:
../crt0_vex.S:59: Error: unrecognized opcode `csrw mtvec,a0', extension `zicsr' required
../crt0_vex.S:87: Error: unrecognized opcode `csrw mie,a0', extension `zicsr' required
../irq_vex.h: Assembler messages:
../irq_vex.h:31: Error: unrecognized opcode `csrw 3008,a5', extension `zicsr' required
make: *** [Makefile:22: blink.elf] Error 1
Tim Edwards
05/08/2023, 9:03 PMRaymond Yang
05/09/2023, 2:35 AMRaymond Yang
05/09/2023, 2:38 AMRaymond Yang
05/09/2023, 2:45 AMRaymond Yang
05/09/2023, 2:48 AMTim Edwards
05/10/2023, 12:41 AMRaymond Yang
05/11/2023, 3:47 AMRaymond Yang
05/11/2023, 3:48 AM