[CW340] Setup issues with new CW340 board
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
### Description
I have followed the [setup](https://opentitan.org/book/doc/getting_started/setup_fpga.html#cw340-board) process for a new CW340 card, however am unable to get any of the bazel tests to dispatch to the board.
Communication to the board appears to be working correctly:
```
./bazelisk.sh run //sw/host/opentitantool -- fpga set-pll
INFO: Analyzed target //sw/host/opentitantool:opentitantool (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
INFO: Elapsed time: 0.277s, 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 fpga set-pll
```
and I can program the FPGA:
```
./bazelisk.sh run //sw/host/opentitantool -- fpga load-bitstream /tmp/bitstream-latest/chip_earlgrey_cw340/lowrisc_syst
ems_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.202s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/sw/host/opentitantool/opentitantool fpga load-bitstream /tmp/bitstream-latest/chip_earlgrey_cw340/lowrisc_systems_chip_earlgrey_cw340_0.1.bit
[00:00:21] [██████████████████████████████████████] 34.18 MiB/34.18 MiB (0s)
```
which gives the expected boot-time console printing with `screen /dev/ttyUSB2 115200,cs8,-ixon,-ixoff`:
```
I00001 test_rom.c:158] kChipInfo: scm_revision=54697461
I00002 test_rom.c:184] TestROM:f2313587
I00003 test_rom.c:230] Test ROM complete, jumping to flash (addr: 20000000)!
```
However, trying to dispatch a test gives an `Error: Found no USB device`:
```
./bazelisk.sh test --test_output=streamed /
/sw/device/tests:uart_smoketest_fpga_${BOARD}_rom_with_fake_keys
WARNING: Streamed test output requested. All tests will be run locally, without sharding, one at a time
DEBUG: /home/admin-sqai/opentitan/rules/autogen.bzl:151:14: NOTE: stamping is disabled, the chip_info section will use a fixed version string
DEBUG: /home/admin-sqai/opentitan/rules/autogen.bzl:151:14: NOTE: stamping is disabled, the chip_info section will use a fixed version string
INFO: Analyzed target //sw/device/tests:uart_smoketest_fpga_cw340_rom_with_fake_keys (43 packages loaded, 11718 targets configured).
INFO: Found 1 test target...
Invoking test: sw/host/opentitantool/opentitantool --rcfile= --logging=info --interface=hyper340 --exec=transport init --exec=fpga load-bitstream hw/bitstream/universal/splice.bit --exec=bootstrap --clear-uart=true sw/device/tests/uart_smoketest_fpga_cw340_rom_with_fake_keys.test_key_0.signed.bin --exec=console --non-interactive --exit-success='PASS.*\n' --exit-failure='((FAIL|FAULT).*\n)|(BFV:[0-9a-f]{8})' no-op
Error: Found no USB device
Stack backtrace:
0: >::into
1: anyhow::kind::Trait::new
2: opentitanlib::util::usb::UsbBackend::new
3: opentitanlib::transport::hyperdebug::Hyperdebug::open
4: opentitanlib::backend::hyperdebug::create
5: opentitanlib::backend::create
6: opentitantool::main
7: core::ops::function::FnOnce::call_once
8: std::sys_common::backtrace::__rust_begin_short_backtrace
9: std::rt::lang_start::{{closure}}
10: core::ops::function::impls:: for &F>::call_once
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/core/src/ops/function.rs:284:13
std::panicking::try::do_call
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/panicking.rs:524:40
std::panicking::try
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/panicking.rs:488:19
std::panic::catch_unwind
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/panic.rs:142:14
std::rt::lang_start_internal::{{closure}}
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/rt.rs:148:48
std::panicking::try::do_call
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/panicking.rs:524:40
std::panicking::try
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/panicking.rs:488:19
std::panic::catch_unwind
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/panic.rs:142:14
std::rt::lang_start_internal
at /rustc/32303b219d4dffa447aa606bc11c7a648f44a862/library/std/src/rt.rs:148:20
11: std::rt::lang_start
12: main
13: __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
14: __libc_start_main_impl
at ./csu/../csu/libc-start.c:392:3
15: _start
cleanup:
FAIL: //sw/device/tests:uart_smoketest_fpga_cw340_rom_with_fake_keys (see /home/admin-sqai/.cache/bazel/_bazel_admin-sqai/a9589ee45fb4114764ac879aea12063a/execroot/lowrisc_opentitan/bazel-out/k8-fastbuild-ST-2cc462681f62/testlogs/sw/device/tests/uart_smoketest_fpga_cw340_rom_with_fake_keys/test.log)
INFO: Elapsed time: 5.298s, Critical Path: 1.15s
INFO: 2 processes: 2 local.
INFO: Build completed, 1 test FAILED, 2 total actions
//sw/device/tests:uart_smoketest_fpga_cw340_rom_with_fake_keys FAILED in 0.6s
/home/admin-sqai/.cache/bazel/_bazel_admin-sqai/a9589ee45fb4114764ac879aea12063a/execroot/lowrisc_opentitan/bazel-out/k8-fastbuild-ST-2cc462681f62/testlogs/sw/device/tests/uart_smoketest_fpga_cw340_rom_with_fake_keys/test.log
Executed 1 out of 1 test: 1 fails locally.
```
Is there a step missing in the setup guide? Is there supposed to be more than the one USB connection to J28?
Thanks,
Andy
Contributor guide
Assessment
This issue has not been assessed yet.