Skip to content
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

Checkout freedom-metal to another branch #7

Open
m3x1m0m opened this issue Apr 21, 2020 · 7 comments
Open

Checkout freedom-metal to another branch #7

m3x1m0m opened this issue Apr 21, 2020 · 7 comments

Comments

@m3x1m0m
Copy link

m3x1m0m commented Apr 21, 2020

Just tried out to get a newer version of freedom-metal running. I switched to the master branch in the freedom-metal submodule.

Compilation works, but it cannot find the correct library file (apparently). I am sure this is possible. I did not find any documentation on that subject.

cp /home/tux/freedom-e-sdk/bsp/lofive-r1/install/lib/debug/libriscv__mmachine__lofive-r1.a /home/tux/freedom-e-sdk/bsp/lofive-r1/install/lib/debug/libmetal.a
cp: cannot stat '/home/tux/freedom-e-sdk/bsp/lofive-r1/install/lib/debug/libriscv__mmachine__lofive-r1.a': No such file or directory
make: *** [scripts/libmetal.mk:88: /home/tux/freedom-e-sdk/bsp/lofive-r1/install/lib/debug/libmetal.a] Error 1
@mwelling
Copy link
Owner

In the BSP directory there is an update-targets.sh script that may need to be run.

I have not looked at the recent updates on the freedom SDK so I would have to perform the updates to try and replicate.

What are the exact steps that you performed?

@m3x1m0m
Copy link
Author

m3x1m0m commented Apr 22, 2020

Thanks for the comment.

cd freedom-metal
git checkout master 
cd ..
make PROGRAM=sifive-welcome TARGET=lofive-r1 software

This is what I have done before. I also ran

bash update-targets.sh

as you suggested and ...

update-targets.sh: line 107: dtc: command not found
update-targets.sh: Failed to compile freedom-e310-arty//design.dts to dtb
...

Seems like my toolchain is not setup correctly.

@mwelling
Copy link
Owner

You will need the devicetree compiler. Also notice that even the mainline freedom-e-sdk doesn't use the master branch.

Maybe it is about time to attempt merging lofive to the upstream repository.

@Layke
Copy link

Layke commented Dec 4, 2021

Plus one for merging the lofive to the upstream repository. I'm currently trying to program my first LoFive board and running into issues. Would love to contribute as I do this.

@mwelling
Copy link
Owner

mwelling commented Dec 7, 2021

@Layke heads up!

When SiFive switched silicon revision they depracated openocd support.

It works but only after the very first programming of the flash.
If you are one of the unlucky people that didn't get the flash programmed this will effect you

Switching to JLINK is the easy way out:
#5 (comment)

I have not updated the SDK in years so maybe they fixed it by now but I doubt it.

Contributions are always welcome so if you get something working, document it
and upstream where possible.

For collaboration I have a channel on discord:
https://discord.gg/n6CnKFFg

@hubbsvtgc
Copy link

@mwelling I just got couple of lofive boards today. would like to know if the FE310-G002 in the lofive has the same init code in OTP and jumps into flash as it happens in Hifive1-rev B board? What is the best way to quickly bringup the board with gdb & load the code into ram and execute? I assume the openocd script that works on hifive1-revb Board should work for this as well.

@psherman42
Copy link

OTP and Mask ROM are the same in all -G002 versions. After brief checks to confirm presence of an external xSPI memory device, execution will go to 0x20000000.

Perhaps the easiest and quickest way to load into and run from RAM is as follows:
make -f myprog.mk ramload
make -f myprog.mk ramrun
riscv-project-toolchain.pdf

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

No branches or pull requests

5 participants