Freedom Studio - QEMU [solved]

Is there any Eclipse MCU plugin that supports RISC-V QEMU? The one that ships with Freedom Studio doesn’t work with the version of qemu-riscvXX in the tool chain - i.e. https://github.com/riscv/riscv-qemu.git.

~/riscv-qemu/build/riscv32-linux-user/qemu-riscv32 -version
qemu-riscv32 version 2.12.50 (v2.12.0-169-g4c510a3f5e-dirty)

Any suggestions? Any other RISC-V emulators that may work with the Eclipse MCU plugin? Any spike plugins?

Thanks!

Cesare

I tried to get the MCU plugin to work with the latest QEMU release (2.12) but the plug complains about launching qemu. So I got it to work by launching qemu separately and have it wait for a GDB connection

  1. Compile your program in Eclipse to create an ELF (the MCU test apps for SiFive for example)

  2. Launch qemu

qemu-system-riscv32 -S -gdb tcp::1234 -nographic -machine sifive_e -kernel C:\Save\eclipse-workspace\Test1\Debug\Test1.elf

  1. Setup a GDB QEMU Debugging config
    Uncheck "Start QEMU locally"
    For the GDB Client Setup

    Commands:
    set mem inaccessible-by-default off
    set arch riscv:rv32
    set riscv use_compressed_breakpoints no

     Host: localhost
     Port: 1234
    

    Load symbols
    Don’t load executable

  2. Debug with the config and GDB will attach to QEMU and be stopped at address 0x00001000. You can run, break, single step, etc… within Eclipse.

Hi Ken, Thank you for your help!

I couldn’t get your QEMU settings to work but your note pointed me in the right direction.

Here is what is working for me:

~/riscv-qemu/build/riscv32-linux-user/qemu-riscv32 -g 1234 -cpu sifive-e31 $ECLIPSE_WORKSPACE/test/Debug/test.elf

Cesare

Glad it worked for you. Those differences might be the deltas between the Windows version of qemu (which I’m using) and the Linux version.

Possible. I am on Debian 4.9.88-1 (2018-04-29) x86_64 GNU/Linux.