Tock Implementation for HiFive Inventor#3125
Closed
TeodoraMiu wants to merge 2 commits intotock:masterfrom
Closed
Conversation
Contributor
|
I would try moving the panic further along in If you aren't getting output, one trick is to disable all UART configuration in Tock (comment it out in We eventually need Tock to configure the UART, but for testing it can be useful to try that |
5 tasks
Contributor
|
Moved to #3225 |
bors Bot
added a commit
that referenced
this pull request
Sep 22, 2022
3225: BBC HiFive Inventor board ported to Tock r=bradjc a=mateibarbu19 ### Pull Request Overview This pull request aims to port Tock to the [BBC HiFive Inventor board](https://www.hifiveinventor.com/). The source is mostly copied from the SiFive HiFive1 Rev B board. I followed an earlier [attempt](#3125), made by `@TeodoraMiu,` who tried to: - increased ram size in `layout.ld` - decreased baudrate for the serial interface However the problems noticed with the UART speed were caused by a lack of configuration of the internal frequency. This was solved by [merge #3215](#3215). (The code is also commited here.) Still there were some bugs in the original `sifive` crate. When trying to clear all pending PL-interrupts a read-only register is [overwritten](https://github.com/tock/tock/blob/93d50be711b959d5dceeb17f8d4b60c6cee3e2b3/chips/sifive/src/plic.rs#L50). The manual states another way to clear interrupts, by reading the `claim` register and writing the (or a) value back. See this [commit](WyliodrinEmbeddedIoT@4dbafb6). The new HiFive board featured a different chip which didn't use the same indexing of interrupt numbers. So implementing a different `InterruptService` for each chip was necessary. So the `e310x` chip implementation was split in two, `e310_g002` and `e310_g003`, which handle each interrupt number differently. I also added the second UART peripheral in order to disable any unwanted interrupts from it. ### Testing Strategy This pull request was tested by checking the serial output of the `hifive_inventor` target and the `hifive1` qemu simulation. ### Help Wanted This pull request still needs to be physically tested on a hifive1 board. `@gemarcano` could you please do this? ### Documentation Updated - [x] boards/README.md - [x] boards/hifive_inventor/README.md - [x] chips/e310_g002/README.md - [x] chips/e310_g003/README.md ### Formatting - [x] Ran `make prepush`. Co-authored-by: Matei Barbu <matei.barbu1905@stud.acs.upb.ro>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This draft pull request is a first attempt at developing Tock compatibility with the HiFive Inventor board (https://www.hifiveinventor.com/user-guide/overview).
I have used the hifive1 board implementation as guidance and changed the memory layout to correspond to the Hifive Inventor's FE310-G003 processor. I also made some other changes, such as the baud rate of the serial port, to match the new board.
At the moment, I have successfully connected the board via JLink and flashed the kernel to the board. However, I am having some difficulties with the board's debugger. Debug messages are not shown, so I tried to display a panic and it seems to double panic in the panic handler. Here is the output I received (after the 'tockloader listen' command):
I am unsure why this is happening. @alistair23 I think you were the one to add the hifive1 board, any help from you would be greatly appreciated.