# Freedom Studio - QEMU \[solved\]

**URL:** <https://forums.sifive.com/t/freedom-studio-qemu-solved/1204>\
**Category:** General\
**Created:** [May 2, 2018, 3:57pm UTC](https://forums.sifive.com/t/freedom-studio-qemu-solved/1204 "2018-05-02T15:57:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cesare.Garlati](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/cesare.garlati/32/465_2.png) [@Cesare.Garlati](https://forums.sifive.com/u/Cesare.Garlati)\
**Post date:** [May 2, 2018, 3:57pm UTC](https://forums.sifive.com/t/freedom-studio-qemu-solved/1204/1 "2018-05-02T15:57:42Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![kenrabold](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kenrabold](https://forums.sifive.com/u/kenrabold)\
**Post date:** [May 2, 2018, 4:49pm UTC](https://forums.sifive.com/t/freedom-studio-qemu-solved/1204/2 "2018-05-02T16:49:44Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![Cesare.Garlati](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/cesare.garlati/32/465_2.png) [@Cesare.Garlati](https://forums.sifive.com/u/Cesare.Garlati)\
**Post date:** [May 2, 2018, 11:08pm UTC](https://forums.sifive.com/t/freedom-studio-qemu-solved/1204/3 "2018-05-02T23:08:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kenrabold](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kenrabold](https://forums.sifive.com/u/kenrabold)\
**Post date:** [May 3, 2018, 12:46am UTC](https://forums.sifive.com/t/freedom-studio-qemu-solved/1204/4 "2018-05-03T00:46:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cesare.Garlati](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/cesare.garlati/32/465_2.png) [@Cesare.Garlati](https://forums.sifive.com/u/Cesare.Garlati)\
**Post date:** [May 3, 2018, 12:50am UTC](https://forums.sifive.com/t/freedom-studio-qemu-solved/1204/5 "2018-05-03T00:50:06Z")

</div>

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