mwelling / lofive

RISC-V microcontroller board based on SiFive FE310.
Other
160 stars 11 forks source link

Checkout freedom-metal to another branch #7

Open m3x1m0m opened 4 years ago

m3x1m0m commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 2 years ago

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 commented 2 years ago

@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: https://github.com/mwelling/lofive/issues/5#issuecomment-565856885

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 commented 2 years ago

@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 commented 4 days ago

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