Cannot build RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio


(Brandon Butler) #1

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


(Carsten Gosvig) #2

Which freeRTOS demo are you referring to?


(Brandon Butler) #3

I wanted to use this one:

But this one also does the same thing:


(Brandon Butler) #4

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


(Brandon Butler) #5

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

#6

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?


(Brandon Butler) #7

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