Hi everyone,
I am trying to program the FE310 target board through OpenOCD. Unfortunately I have only been able to do so two times (randomly). All my other attempts have resulted in errors. I am using the Chipwhisperer Lite with the CW308 UFO Target board and the FE310 victim board. I have followed the instructions from the following tutorial. Furthermore, I have tried supplying power to the victim from both the capture board and an external DC source. I have also tried multiple different OpenOCD versions.
An example of an error occuring when I run run_openocd.sh
script with the “fe310.cfg” file:
Setting up MPSSE mode... Done
running /usr/local/bin/openocd -s /home/jelle/openocd -f cw_openocd.cfg -c 'ftdi vid_pid 0x2b3e 0xace2' -c 'transport select jtag' -f fe310.cfg -c 'init; targets; halt; program /home/jelle/KyberSCA/remote/firmware.elf verify reset exit'
Open On-Chip Debugger 0.11.0+dev-02443-gb337b0cfb (2022-12-14-15:01)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
Warn : Transport "jtag" was already selected
jtag
Info : clock speed 500 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive Inc), part: 0x0000, ver: 0x2)
Error: [riscv.cpu.0] DMSTATUS read didn't complete in 4 seconds. The target is either really slow or broken. You could increase the timeout with `riscv set_command_timeout_sec`.
Warn : target riscv.cpu.0 examination failed
Error: [riscv.cpu.0] DMI operation didn't complete in 4 seconds. The target is either really slow or broken. You could increase the timeout with riscv set_command_timeout_sec.
Error: [riscv.cpu.0] DMI operation didn't complete in 4 seconds. The target is either really slow or broken. You could increase the timeout with riscv set_command_timeout_sec.
Error: [riscv.cpu.0] DMI operation didn't complete in 4 seconds. The target is either really slow or broken. You could increase the timeout with riscv set_command_timeout_sec.
Error: libusb_handle_events() failed with LIBUSB_ERROR_INTERRUPTED
openocd: src/jtag/drivers/mpsse.c:850: mpsse_flush: Assertion `ctx->write_count == 0 && ctx->read_count == 0' failed.
./run_openocd.sh: line 120: 3453 Aborted bash -c "$cmd"
Disabling MPSSE mode... Done
I get this output for both of my FE310 victims.
My target board is configured as follows:
I wish I could add more pictures, but I can’t since I am a new user of the forum. I hope that the JTAG wiring is clear from the picture.
The switches have been set to deliver 1.8V and 3.3V from the External DC source to the Victim Board.
Here is also a snippet of the output of OpenOCD with the debug flag enabled:
Debug: 976 6800 riscv-013.c:414 scan(): -> allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 977 6800 riscv.c:1262 riscv_flush_registers(): [riscv.cpu.0]
Debug: 978 6801 riscv.c:2435 riscv_openocd_poll(): should_remain_halted=0, should_resume=0
Debug: 979 6801 target.c:3072 handle_target(): [riscv.cpu.0] target_poll() -> 0, next attempt in 100ms
Debug: 980 6899 riscv.c:2379 riscv_openocd_poll(): polling all harts
Debug: 981 6899 riscv.c:2216 riscv_poll_hart(): [riscv.cpu.0] polling, target->state=2
Debug: 982 6900 riscv-013.c:404 scan(): 41b r 00000000 @11 -> + 00000000 @00; 3i
Debug: 983 6900 riscv-013.c:404 scan(): 41b - 00000000 @11 -> + 00030382 @11; 3i
Debug: 984 6900 riscv-013.c:414 scan(): -> allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 985 6900 riscv.c:1262 riscv_flush_registers(): [riscv.cpu.0]
Debug: 986 6901 riscv.c:2435 riscv_openocd_poll(): should_remain_halted=0, should_resume=0
Debug: 987 6901 target.c:3072 handle_target(): [riscv.cpu.0] target_poll() -> 0, next attempt in 100ms
^CDebug: 988 6974 server.c:616 sig_handler(): Terminating on Signal 2
Debug: 989 6975 command.c:166 script_debug(): command - shutdown
Debug: 990 6975 riscv.c:2379 riscv_openocd_poll(): polling all harts
Debug: 991 6975 riscv.c:2216 riscv_poll_hart(): [riscv.cpu.0] polling, target->state=2
Debug: 992 6975 riscv-013.c:404 scan(): 41b r 00000000 @11 -> + 00000000 @00; 3i
Debug: 993 6976 riscv-013.c:404 scan(): 41b - 00000000 @11 -> + 00030382 @11; 3i
Debug: 994 6976 riscv-013.c:414 scan(): -> allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 995 6976 riscv.c:1262 riscv_flush_registers(): [riscv.cpu.0]
Debug: 996 6976 riscv.c:2435 riscv_openocd_poll(): should_remain_halted=0, should_resume=0
Debug: 997 6976 target.c:3072 handle_target(): [riscv.cpu.0] target_poll() -> 0, next attempt in 100ms
User : 998 6976 server.c:762 handle_shutdown_command(): shutdown command invoked
Debug: 999 6976 riscv.c:422 riscv_deinit_target(): riscv_deinit_target()
Debug: 1000 6976 riscv.c:1262 riscv_flush_registers(): [riscv.cpu.0]
Debug: 1001 6976 riscv-013.c:1516 deinit_target(): riscv_deinit_target()
Debug: 1002 6977 target.c:2214 target_free_all_working_areas_restore(): freeing all working areas
I am guessing that the issue is related to hardware and not software. Maybe I am doing something wrong with the wiring or the issue lies elsewhere. I hope that maybe one of you can aid me in figuring out what exactly is causing this issue.
Thanks in advance!