sifive / freedom-tools

Tools for SiFive's Freedom Platform
217 stars 52 forks source link

support Raspberry Pi? #54

Closed itmm closed 1 year ago

itmm commented 4 years ago

I know, this is not an issue but a feature request: I would love to use the freedom-tools to build for the HiFive1 Rev B01, but I only have a Raspberry Pi 4 available. Is it possible to build the toolchain on ARM 32 or 64 bit?

Until the tools are available, I try to build with LLVM Clang 9 (that supports RISC-V out of the box), but the correct initialization code is hard to get right without a working elf-binary to debug :-) I have some IO working, but it takes some seconds after reset until the UART stops sending surprising characters.

jim-wilson commented 4 years ago

Debian testing has an embedded riscv64 cross compiler package. I don't know how much this helps though. https://packages.debian.org/bullseye/gcc-riscv64-unknown-elf You need multiple packages binutils, gcc, and at least one library picolib or newlib-nano. I think the target library dependency might be missing so you might have to install that one separately.

itmm commented 4 years ago

Thank you for your fast reply.

I build the gcc compiler for RISC-V from scratch, but the freedom-e-sdk used some non-standard assembly language op-codes that were not supported. So I am afraid that I have to use the version provided with this project. It would be great, if the Makefile would allow to build the tools for more platforms.

amnesia13 commented 3 years ago

Hello,

I tried to compile it under Ubuntu 20 x86_64 on a HP Probook 650 G1 and got the following message:

make: *** [Makefile:527 : obj/x86_64-linux-ubuntu14/build/riscv-gnu-toolchain/build-gcc-newlib-stage1/stamp] Erreur 2

I am going to inquire about this but any help is welcomed.

Regards

jim-wilson commented 3 years ago

I thought that freedom-e-sdk had been fixed to not require the sifive toolchain, but if it hasn't or you have an older version before the fix, then yes you need freedom-tools to build it.

Giving the last error message isn't helpful. We need the first one. Try searching the build log for "error:". You might need to look at one of the build.log files in the build tree to find the first error message. I thinik it would be in the riscv-gnu-toolchain dir of the makefile error that you got. You might be missing one of the prerequisite packages needed for the build.