Skip to content

HiFive1 rev B support #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2019
Merged

HiFive1 rev B support #392

merged 2 commits into from
Jul 7, 2019

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Jun 4, 2019

@aykevl
Copy link
Member Author

aykevl commented Jun 4, 2019

Things that are needed for this to be mergeable:

There are more things (like time.Sleep/time.Now support, GPIO, other peripherals) that have not yet been implemented but they can happen at a later time.

@deadprogram
Copy link
Member

Regarding the SVD file, I think we should run off our own fork of the cmsis-svd repo anyhow. We should also continue to submit upstream PRs as both you and I have been doing, but this allows us to not have to wait for the other maintainer, who seems somewhat busy.

Regarding the interrupts, and changes to the generator, we need to work on that part.

#184 you know I really want that anyhow. But we can incorporate that later, and continue to use the clang toolchain for now, right?

@aykevl
Copy link
Member Author

aykevl commented Jun 19, 2019

#184 you know I really want that anyhow. But we can incorporate that later, and continue to use the clang toolchain for now, right?

Unfortunately, no. RISC-V is not included in most LLVM builds so people wouldn't be able to use an external clang, unless they compile LLVM manually.

@aykevl
Copy link
Member Author

aykevl commented Jun 19, 2019

The upstream SVD file hangs on the fact that the license situation isn't entirely clear and that SiFive doesn't provide SVD files. I have posted here on the forum in the hope that it will help: https://forums.sifive.com/t/svd-file-for-e310-g000/731/11

@aykevl aykevl force-pushed the hifive1 branch 8 times, most recently from fe7230b to 57237c5 Compare July 6, 2019 14:10
@aykevl
Copy link
Member Author

aykevl commented Jul 6, 2019

  • switched to our own fork of cmsis-svd
  • rebased on top of Add support for newer SVD files in cmsis-svd repository #439 to avoid problems parsing SVD files
  • changed the compiler and linker to be from the riscv64-unknown-elf-* toolchain (provided by SiFive). This should be changed in the future, but is likely easier for users than requiring them to build Clang with RISC-V support.

@aykevl aykevl force-pushed the hifive1 branch 15 times, most recently from 007892f to 32418b6 Compare July 6, 2019 20:14
@aykevl aykevl changed the title WIP: HiFive1 HiFive1 rev B support Jul 6, 2019
@aykevl
Copy link
Member Author

aykevl commented Jul 6, 2019

This pull request is now ready to merge.

This page has been a big help in adding support for this new chip:
https://wiki.osdev.org/HiFive-1_Bare_Bones
@deadprogram
Copy link
Member

deadprogram commented Jul 7, 2019

I started to test this.

First, I obtained the SiFive GNU tools. Then updated the submodule to get the latest SVD files, and re-ran the generator. also used go install to rebuild tinygo itself. So far, so good.

I then ran into compilation problem:

$ tinygo build -size short -o test.elf -target=hifive1b            examples/blinky1
error: No available targets are compatible with triple "riscv32--none"

I think that indicates that my LLVM installation lacks the needed risc-v support, right?

EDITED to have better grammar and explanation.

@aykevl
Copy link
Member Author

aykevl commented Jul 7, 2019

You need to rebuild LLVM, and then build it using make. This error indicates that you built without RISC-V support. I'm not aware of a LLVM build that includes RISC-V by default.

@deadprogram
Copy link
Member

Can I just run our own make llvm-source; make llvm-build task to achieve this?

@aykevl
Copy link
Member Author

aykevl commented Jul 7, 2019

Yes, just make llvm-build should be enough. But you probably need to remove (or move, to be safe) that directory first.

@deadprogram
Copy link
Member

Added page at https://github.com/tinygo-org/tinygo/wiki/RISC-V to help anyone who want to experiement with this.

Now merging, great work @aykevl this is a massive step into the future.

@deadprogram deadprogram merged commit ffa38b1 into dev Jul 7, 2019
@aykevl aykevl deleted the hifive1 branch July 7, 2019 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants