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

[CW340] Hello World Demo on CW340 returns SPI connection error, despite successful build and bitstream load. #26603

Open
AlexStoyanov1 opened this issue Mar 12, 2025 · 0 comments

Comments

@AlexStoyanov1
Copy link

Description

I am trying to run the hello world demo test following the FPGA build guide: https://opentitan.org/book/doc/getting_started/setup_fpga.html#flash-the-bitstream-onto-the-fpga-and-bootstrap-software-into-flash. I am able to load the bitstream with:

./bazelisk.sh run //sw/host/opentitantool -- fpga load-bitstream /tmp/bitstream-latest/chip_earlgrey_cw340/lowrisc_systems_chip_earlgrey_cw340_0.1.bit

which returns:

opentitan@bxqp8b3-ub22:~/Documents/opentitan$ ./bazelisk.sh run //sw/host/opentitantool -- fpga load-bitstream /tmp/bitstream-latest/chip_earlgrey_cw340/lowrisc_systems_chip_earlgrey_cw340_0.1.bit
INFO: Analyzed target //sw/host/opentitantool:opentitantool (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
INFO: Elapsed time: 0.207s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/sw/host/opentitantool/opentitantool
[00:00:20] [██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 34.18 MiB/34.18 MiB (0s)

Then the build command runs successfully:

opentitan@bxqp8b3-ub22:~/Documents/opentitan$ bazel build //sw/device/examples/hello_world
DEBUG: /home/opentitan/Documents/opentitan/rules/autogen.bzl:452:14: NOTE: stamping is disabled, the chip_info section will use a fixed version string
INFO: Analyzed target //sw/device/examples/hello_world:hello_world (0 packages loaded, 1414 targets configured).
INFO: Found 1 target...
Target //sw/device/examples/hello_world:hello_world up-to-date:
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw310.bin
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw310.elf
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw310.dis
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw310.map
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw340.bin
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw340.elf
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw340.dis
bazel-bin/sw/device/examples/hello_world/hello_world_fpga_cw340.map
bazel-bin/sw/device/examples/hello_world/hello_world_sim_dv.64.scr.vmem
bazel-bin/sw/device/examples/hello_world/hello_world_sim_dv.elf
bazel-bin/sw/device/examples/hello_world/hello_world_sim_dv.dis
bazel-bin/sw/device/examples/hello_world/hello_world_sim_dv.map
bazel-bin/sw/device/examples/hello_world/hello_world_sim_dv.logs.txt
bazel-bin/sw/device/examples/hello_world/hello_world_sim_dv.rodata.txt
bazel-bin/sw/device/examples/hello_world/hello_world_sim_dv.64.vmem
bazel-bin/sw/device/examples/hello_world/hello_world_sim_verilator.64.vmem
bazel-bin/sw/device/examples/hello_world/hello_world_sim_verilator.elf
bazel-bin/sw/device/examples/hello_world/hello_world_sim_verilator.dis
bazel-bin/sw/device/examples/hello_world/hello_world_sim_verilator.map
INFO: Elapsed time: 0.576s, Critical Path: 0.06s
INFO: 1 process: 1040 action cache hit, 1 internal.
INFO: Build completed successfully, 1 total action

Then when attempting hello world demo:

opentitan@bxqp8b3-ub22:~/Documents/opentitan$ bazel run //sw/host/opentitantool -- bootstrap "$(ci/scripts/target-location.sh //sw/device/examples/hello_world | grep fpga_${BOARD}.bin)"
INFO: Analyzed target //sw/host/opentitantool:opentitantool (0 packages loaded, 1281 targets configured).
INFO: Found 1 target...
INFO: Elapsed time: 0.406s, Critical Path: 0.04s
INFO: 1 process: 986 action cache hit, 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/sw/host/opentitantool/opentitantool
Error: SFDP header contains incorrect signature: 0xffffffff

This is after applying the change in location-target.sh:
From: REL_PATH=$(${REPO_TOP}/bazelisk.sh outquery "$@" 2>$REDIR)
To: REL_PATH=$(${REPO_TOP}/bazelisk.sh cquery --output=files "$@" 2>$REDIR)

Any advice or help to resolve the SPI issue and get the hello world test up and running?

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

1 participant