Cannot build RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio


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

Which freeRTOS demo are you referring to?

I wanted to use this one:

But this one also does the same thing:

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/

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

I also needed to modify the Hardware_Qemu.launch file.

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

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

DEBUG_NAME needed a .exe removed. It now reads:

<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;"/>

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?

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

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”

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.