Could you help me fix this cross-compiling error with the QEMU for risc-v?

529 Views Asked by At

I'm trying to execute simple code in C. when I run the executable with this command : /opt/riscv32i/bin/riscv32-unknown-elf-run code.elf then I got the result. but when I ran it with qemu /opt/qemu-riscv/bin/qemu-system-riscv32 -kernel code.elf I got this error : qemu-system-riscv32: Unable to load the RISC-V firmware "opensbi-riscv32-spike-fw_jump.elf"

1

There are 1 best solutions below

0
dizzylay On

I solved this problem by adding the parameter -bios none.

/opt/qemu-riscv/bin/qemu-system-riscv32 -kernel code.elf -bios none