Hi everyone,
my goal is to measure the power consumption of some RISCV software that should be executed on a soft-core Ibex on an artix-7 FPGA.
I have looked through the Q&A section here before, but could not find an answer which solves my problem.
Some preliminaries regarding my setup:
- Running on Windows
- CW boards: Husky, CW313 support board, CW312T-XC7A35 target board
- Tigard programmer
I will closely follow the procedure from here so everyone can (hopefully) understand my thought process.
First, I compiled my software, where i closely follow the structure of other software i compiled before and which looks roughly like this:
uint8_t get_pt(uint8_t* pt, uint8_t len)
{
//...
trigger_high();
// code to measure
trigger_low();
// ...
simpleserial_put('r', 8, pt);
return 0x00;
}
int main(void)
{
platform_init();
init_uart();
trigger_setup();
simpleserial_init();
simpleserial_addcmd('i', 16, get_pt);
while(1)
simpleserial_get();
}
Using the riscv32-unknown-elf-gcc, I successfully generated my .elf file.
In the next step, I loaded the bitfile (lowrisc_ibex_demo_system.bit) using the setup script from here, with PLATFORM=CW312_IBEX.
The script tells me that the FPGA was successfully programmed. Which means the next step is to program the firware using the load_demo_system.sh command from the Ibex repository.
To program the firware I use Tigard as for example noted here.
To do so I used Self-powered mode as stated here.
I connected TDI/TDO/TCK/TMS from Tigard to the pins of the CW313 board and set the DIP switches 5-8 on the CW312-T to “on”. No JTAG programmer is connected to the CW312T-A35
The load_demo_system.sh script requires three parameters: run elf_file tcl_file
In my understanding is the elf_file the software i previously compiled.
For the tcl file I used this, which I will shown below:
adapter driver ftdi
transport select jtag
ftdi vid_pid 0x0403 0x6010
ftdi channel 0
ftdi layout_init 0x0088 0x008b
ftdi layout_signal nTRST -data 0x0010
ftdi layout_signal nSRST -data 0x0020
reset_config none
# Configure JTAG chain and the target processor
set _CHIPNAME riscv
# Configure JTAG expected ID
# arty-a7-35t
set _EXPECTED_ID 0x0362D093
# arty-a7-100t
# set _EXPECTED_ID 0x13631093
jtag newtap $_CHIPNAME cpu -irlen 6 -expected-id $_EXPECTED_ID -ignore-version
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
riscv set_ir idcode 0x09
riscv set_ir dtmcs 0x22
riscv set_ir dmi 0x23
adapter speed 10000
riscv set_mem_access sysbus
gdb_report_data_abort enable
gdb_report_register_access_error enable
gdb_breakpoint_override hard
reset_config none
init
halt
when running now in jupyter notebooks:
%%sh
./load_demo_system.sh run my_software.elf arty_a7_openocd_cfg.tcl
I get this output:
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2022-03-25-17:32)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
force hard breakpoints
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
And this is the point were I get stuck.
In my device manager I can see under Ports (COM&LPT) the USB Serial Port from Tigard, where vid and pid matches the one from the tcl file.
I already used Zadig to install WinUSB (libusb) drivers, however the error persists.
I played around with the ftdi channels but this does not change anything.
I also tried to connect the pins from Tigard to the JTAG TDI/TDO/TCK/TMS pins on the CW312T-A35 board, which I read from the schematic together with every combination of DIP switches (1-4, 5-8) to check if I made an error when connecting the pins, but I always get the same error.
Running other targets (e.g. STM32F405) using the husky and CW313 board works without any problems.
Is this a common problem, or has anyone encountered this problem before and knows how to fix this?
If more information is required (about other drivers, versions etc) I am happy to share them.
Any help is much appreciated.
Cheers