This page contains details about cross-compiling for the RISC-V architecture called riscv32.

The RISC-V architecture provides 32-bit, 64-bit, and 128-bit variants.

While theoretically possible to run Debian on a 32-bit RISC-V architecture, most available 32-bit CPUs are limited to microcontrollers or low-memory systems.

Available devices

Description and website

Docs

SeeedStudio GD32

Soft core on Fomu FPGA

docs

PineCone BL602

docs

Compilers and libraries

gcc-9-riscv64-linux-gnu

C compiler

Emulators

QEMU

Install:

apt install qemu-system-misc opensbi

Run:

qemu-system-riscv32 \
   -M virt -nographic -m 500M \
   -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
   -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
   -device virtio-blk-device,drive=hd0 \
   -netdev user,id=net0 -device virtio-net-device,netdev=net0