hello,
I built RISC-V toolchain and QEMU as follows:
cd riscv-gnu-toolchain
./configure --prefix=/home/RISCV-installed-Tools --with-arch=rv32i_zicsr --with-abi=ilp32
make
make build-qemu
QEMU Version:
qemu-riscv32 version 7.1.0 (v7.1.0)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
i debug as follows:
riscv32-unknown-elf-gcc -g test.S -o test
qemu-riscv32 -g 3333 test
// in another terminal
riscv32-unknown-elf-gdb test -ex "target remote :3333"
but Qemu reports this error when I use CSR instructions:
Program received signal SIGILL, Illegal instruction. main () at main.S:2 2 main: csrw mepc, t0
how to resolve this error ?