-
Notifications
You must be signed in to change notification settings - Fork 176
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
how to build and create opensbi.bin and image files as in Pre-built Bitstreams and Linux/OpenSBI images #282
Comments
Hi @zoro269, here is some code I used recently and that will probably be integrated soon in the repository: def opensbi_build():
# Be sure third_party dir is present and switch to it.
create_third_party_dir()
os.chdir("third_party")
# Get OpenSBI.
if not os.path.exists("opensbi"):
os.system("git clone https://github.com/litex-hub/opensbi --branch 0.8-linux-on-litex-vexriscv")
os.chdir("opensbi")
# Configure / Build OpenSBI.
os.system("make CROSS_COMPILE=riscv64-unknown-elf- PLATFORM=litex/vexriscv")
# Copy Linux Images.
os.system("cp build/platform/litex/vexriscv/firmware/fw_payload.bin ../../images/opensbi.bin") Please let me know if you still have troubles building with this. |
Hi enjoy-digital
Can you guide me the running steps and order of running? I still don't
quite understand.
Many thanks
Vào Th 3, 7 thg 6, 2022 vào lúc 14:05 enjoy-digital <
***@***.***> đã viết:
… Hi @zoro269 <https://github.com/zoro269>,
here is some code I used recently and that will probably be integrated
soon in the repository:
def opensbi_build():
# Be sure third_party dir is present and switch to it.
create_third_party_dir()
os.chdir("third_party")
# Get OpenSBI.
if not os.path.exists("opensbi"):
os.system("git clone https://github.com/litex-hub/opensbi --branch 0.8-linux-on-litex-vexriscv")
os.chdir("opensbi")
# Configure / Build OpenSBI.
os.system("make CROSS_COMPILE=riscv64-unknown-elf- PLATFORM=litex/vexriscv")
# Copy Linux Images.
os.system("cp build/platform/litex/vexriscv/firmware/fw_payload.bin ../../images/opensbi.bin")
Please let me know if you still have troubles building with this.
—
Reply to this email directly, view it on GitHub
<#282 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZP7SWH5MXLTNUBUNLMAQG3VN3YD3ANCNFSM5X7VYLMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This should work:
The binary is then located at |
I followed the instructions and got some errors as follows:
ELF platform/litex/vexriscv/firmware/fw_dynamic.elf |
@zoro269: Can you test with the GCC toolchain provided by (https://github.com/enjoy-digital/litex/blob/master/litex_setup.py#L323-L345) |
@enjoy-digital I have installed and tried the toolchain and still have the error |
@enjoy-digital |
Thanks guys, I fixed it with the gcc toolchain that was shown and downloaded in the litex_setup.py file. But can you guys explain to me the difference between these two versions of gcc toolchain? |
Hi @zoro269, the OpenSBI build probably require a minimum GCC version to build correctly. We haven't analyzed this so just recommend using the version that has been used successfully. |
make CROSS_COMPILE=riscv64-unknown-elf- PLATFORM=litex/vexriscv How to fix it? |
Either you get a older version of gcc (11.x) either would need to fix the flow to add the _zicsr to the march |
After changed PLATFORM_RISCV_ISA from rv32ima to rv32ima_zicsr_zifencei, I successfully built 1.3.1-linux-on-litex-vexriscv branch opensbi binary and used it to run sim.py. I need to highlight two points that differ from enjoy-digital's description:
|
#164 (comment)
I have followed the steps but still not working.
The purpose I want is to be able to build an openSBI image file like in the instructions above
The text was updated successfully, but these errors were encountered: