# Cannot build RISC-V\_RV32\_SiFive\_HiFive1-RevB\_FreedomStudio

**URL:** https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275
**Category:** RISC-V
**Created:** [January 27, 2020, 8:53pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275 "2020-01-27T20:53:23Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![brandonbutler-dw](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/brandonbutler-dw/32/795_2.png) [@brandonbutler-dw](https://forums.sifive.com/u/brandonbutler-dw)
#### Post date: [January 27, 2020, 8:53pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/1 "2020-01-27T20:53:23Z")

</div>

Hello,

I’m trying to build the freeRTOS demo in Freedom Studio on macOS. I am getting build errors. The instructions I am following are listed here.

One of the errors I’m getting is this.  
`/bin/sh: riscv64-unknown-elf-gcc.exe: command not found`

The `.exe` makes me think that this demo is configured for Windows instead of macOS?

Can anyone help me to get this to build? Thanks

---

<div class="post-metadata">

### Author: ![cgsfv](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@cgsfv](https://forums.sifive.com/u/cgsfv)
#### Post date: [January 27, 2020, 10:48pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/2 "2020-01-27T22:48:36Z")

</div>

Which freeRTOS demo are you referring to?

---

<div class="post-metadata">

### Author: ![brandonbutler-dw](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/brandonbutler-dw/32/795_2.png) [@brandonbutler-dw](https://forums.sifive.com/u/brandonbutler-dw)
#### Post date: [January 28, 2020, 1:21pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/3 "2020-01-28T13:21:01Z")

</div>

I wanted to use this one:

> **[FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC)**
>
> Git clone of FreeRTOS svn repo. SVN found at: https://sourceforge.net/projects/freertos/ - FreeRTOS/FreeRTOS

But this one also does the same thing:

> **[FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio)**
>
> Git clone of FreeRTOS svn repo. SVN found at: https://sourceforge.net/projects/freertos/ - FreeRTOS/FreeRTOS

---

<div class="post-metadata">

### Author: ![brandonbutler-dw](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/brandonbutler-dw/32/795_2.png) [@brandonbutler-dw](https://forums.sifive.com/u/brandonbutler-dw)
#### Post date: [January 28, 2020, 3:23pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/4 "2020-01-28T15:23:26Z")

</div>

I got it working!

I had to go to the project properties and make a couple of changes.

`C/C++ Build / Environment`  
I had to change PATH to be `/Applications/FreedomStudio.app/Contents/Eclipse/SiFive/sdk-utilities-0.0.0-2019.08.0:/Applications/FreedomStudio.app/Contents/Eclipse/SiFive/msys64-1.0.0-2019.05.2/usr/bin:/Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv64-unknown-elf-gcc-8.3.0-2019.08.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin`

Then under `C/C++ Build / Settings`  
I had to change the `Cross GCC Compiler`, `Cross GCC Linker`, and `Cross GCC Assembler` to use `riscv64-unknown-elf-gcc` instead of `riscv64-unknown-elf-gcc.exe`

---

<div class="post-metadata">

### Author: ![brandonbutler-dw](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/brandonbutler-dw/32/795_2.png) [@brandonbutler-dw](https://forums.sifive.com/u/brandonbutler-dw)
#### Post date: [January 28, 2020, 3:36pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/5 "2020-01-28T15:36:07Z")

</div>

I also needed to modify the Hardware\_Qemu.launch file.

`PROGRAM_NAME` needed the backslash changed to the forward slash. So it is now:

```auto
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/RTOSDemo.elf"/>

```

`DEBUG_NAME` needed a `.exe` removed. It now reads:

```auto
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="riscv64-unknown-elf-gdb -iex &quot;set mem inaccessible-by-default off&quot; -iex &quot;set arch riscv:rv32&quot; -iex &quot;set riscv use_compressed_breakpoint off&quot;"/>

```

---

<div class="post-metadata">

### Author: ![dodsonmg](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@dodsonmg](https://forums.sifive.com/u/dodsonmg)
#### Post date: [February 6, 2020, 9:28pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/6 "2020-02-06T21:28:45Z")

</div>

Thanks for this. I had the same problem and this fixed it for me.

Took me a few minutes to find the project-specific settings, since it’s not in the normal preference settings.

For future travellers… You have to select your project name in the ‘project explorer’ pane, and then go to Project -\> Preferences

Is this an issue with the project files (e.g., specifying \*.exe) or with the global settings of FreedomStudio?

---

<div class="post-metadata">

### Author: ![brandonbutler-dw](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/brandonbutler-dw/32/795_2.png) [@brandonbutler-dw](https://forums.sifive.com/u/brandonbutler-dw)
#### Post date: [February 6, 2020, 9:39pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/7 "2020-02-06T21:39:58Z")

</div>

Pretty sure it’s a project setting. I have to change it every time I import it.

---

<div class="post-metadata">

### Author: ![lfolkerts](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@lfolkerts](https://forums.sifive.com/u/lfolkerts)
#### Post date: [June 12, 2020, 2:43pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/8 "2020-06-12T14:43:13Z")

</div>

Change Debug-\>DebugConfigurations-\>GDB Hardware Debugging-\>Hardware Qemu-\>Main-\>C/C++ Application from “Debug\RTOSDemo.elf” to “Debug/RTOSDemo.elf”.  
Then in the next tab (Hardware Qemu-\>Debugger) Change GDB Command to remove .exe:  
iscv64-unknown-elf-gdb **.exe** -iex “set mem inaccessible-by-default off” -iex “set arch riscv:rv32” -iex “set riscv use\_compressed\_breakpoint off”

---

<div class="post-metadata">

### Author: ![lfolkerts](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@lfolkerts](https://forums.sifive.com/u/lfolkerts)
#### Post date: [June 12, 2020, 2:46pm UTC](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275/9 "2020-06-12T14:46:04Z")

</div>

For Ubuntu, I did not need to delete the .exe under build, but needed to remove it from the gdb binary path under Debug Configurations (See Below). I also needed to update PATH as mentioned.
