Author Topic: Openocd with DE-10 nano (usb blaster 2) [Solved]  (Read 2046 times)

0 Members and 1 Guest are viewing this topic.

Offline fabiodlTopic starter

  • Frequent Contributor
  • **
  • Posts: 282
Openocd with DE-10 nano (usb blaster 2) [Solved]
« on: March 31, 2021, 12:33:21 am »
Has anyone managed to use openocd with the Terasic DE-10 nano board?
Quartus programmer works. I tried two boards, so I'd exclude hardware problems.

I correctly set the path of usb_blaster_firrmware in altera-usb-blaster2.cfg
I added the udev rules
I defined the chain as by attachment
I am using Open On-Chip Debugger 0.10.0 (but version 0.9 gives the same error
With the following command
Code: [Select]
openocd -f altera-usb-blaster2.cfg -f chain.cfg -c init -c "svf -quiet /tmp/jfpgaIo.svf" -c shutdown
I get the following output

Code: [Select]
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Warn : Adapter driver 'usb_blaster' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
cycv_dbginit
Info : Altera USB-Blaster II found (Firm. rev. = 1.36)
Info : This adapter doesn't support configurable speed
Info : JTAG tap: fpgasoc.fpga.tap tap/device found: 0x02d020dd (mfg: 0x06e (Altera), part: 0x2d02, ver: 0x0)
Info : JTAG tap: fpgasoc.dap tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : DAP transaction stalled (WAIT) - slowing down
Info : DAP transaction stalled (WAIT) - slowing down
Info : DAP transaction stalled (WAIT) - slowing down
Info : fpgasoc.cpu.0: hardware has 6 breakpoints, 4 watchpoints
Info : DAP transaction stalled (WAIT) - slowing down
Info : DAP transaction stalled (WAIT) - slowing down
Info : DAP transaction stalled (WAIT) - slowing down
Info : fpgasoc.cpu.1: hardware has 6 breakpoints, 4 watchpoints
svf processing file: "/tmp/jfpgaIo.svf"
Error: Translation from khz to jtag_speed not implemented
in procedure 'svf'
in procedure 'ocd_bouncer'
Error: tdo check error at line 55217
Error:     READ = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Error:     WANT = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000
Error:     MASK = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000

Time used: 0m4s849ms
svf file programmed failed

« Last Edit: March 31, 2021, 02:02:50 am by fabiodl »
 

Offline SMB784

  • Frequent Contributor
  • **
  • Posts: 421
  • Country: us
    • Tequity Surplus
Re: Openocd with DE-10 nano (usb blaster 2)
« Reply #1 on: March 31, 2021, 12:54:41 am »
Quote
Error: Translation from khz to jtag_speed not implemented

You are improperly specifying your JTAG speed.  Which version of OpenOCD are you using? Check the config file, and compare how you specify the JTAG speed to the examples in the OpenOCD documentation.

Offline fabiodlTopic starter

  • Frequent Contributor
  • **
  • Posts: 282
Re: Openocd with DE-10 nano (usb blaster 2)
« Reply #2 on: March 31, 2021, 01:15:25 am »
I  was using 0.10 (as shown in the log).
I tried using the latest git version, but the error is the same.
I reduced the chain to the following minimal file

Code: [Select]
jtag newtap fpgasoc.fpga tap -irlen 10 -ircapture 0x01 -irmask 0x3 -expected-id 0x02d020dd
jtag newtap fpgasoc cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id 0x4ba00477

and the other configuration file is the interface/altera-usb-blaster2.cfg that comes with the latest git installation.
That file reads

Code: [Select]
#
# Altera USB-Blaster II
#

adapter driver usb_blaster
usb_blaster_vid_pid 0x09fb 0x6010 0x09fb 0x6810
usb_blaster_lowlevel_driver ublast2
usb_blaster_firmware /path/to/quartus/blaster_6810.hex

where the path was adjusted to the correct one
The output is the following
Code: [Select]
Open On-Chip Debugger 0.11.0+dev-00062-g6405d35f3-dirty (2021-03-31-10:01)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter driver' not 'interface'
Info : only one transport option; autoselect 'jtag'
Info : Altera USB-Blaster II found (Firm. rev. = 1.36)
Info : This adapter doesn't support configurable speed
Info : JTAG tap: fpgasoc.fpga.tap tap/device found: 0x02d020dd (mfg: 0x06e (Altera), part: 0x2d02, ver: 0x0)
Info : JTAG tap: fpgasoc.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
Warn : gdb services need one or more targets defined
svf processing file: "/tmp/jfpgaIo.svf"
FREQUENCY 3.30E+07 HZ;
Error: Translation from khz to jtag_speed not implemented

TRST ABSENT;
ENDDR IDLE;
ENDIR IRPAUSE;
STATE IDLE;
SIR 10 TDI (002);
RUNTEST IDLE 33000 TCK ENDSTATE IDLE;
FFFFFFFFFFFFFFFFFFFFFFFFFF);
SIR 10 TDI (004);
RUNTEST 165 TCK;
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000);
SIR 10 TDI (003);
RUNTEST 135168 TCK;
RUNTEST 512 TCK;
SIR 10 TDI (3FF);
RUNTEST 33000 TCK;
STATE IDLE;
Error: tdo check error at line 55217
Error:     READ = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Error:     WANT = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000
Error:     MASK = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000
Time used: 0m4s827ms
svf file programmed failed


« Last Edit: March 31, 2021, 01:17:02 am by fabiodl »
 

Offline SMB784

  • Frequent Contributor
  • **
  • Posts: 421
  • Country: us
    • Tequity Surplus
Re: Openocd with DE-10 nano (usb blaster 2)
« Reply #3 on: March 31, 2021, 01:29:50 am »
Quote
FREQUENCY 3.30E+07 HZ;

3.3x107 Hz is 33 MHz, which seems awfully fast for a JTAG interface.  Usually these communicate in the hundreds of kilohertz.  It is also saying you are having a translation error for the jtag speed.  I think there is still something wrong with how you are specifying JTAG, and I don't see that you are specifying the speed anywhere in your config file.  Also, openocd is now in version 0.11.  I recommend building it from the source: https://github.com/ntfreak/openocd

It has a slightly different way of specifying the JTAG speed, which might clear up your issue.  Check out how I specify the adapter speed in my OpenOCD implementation for programming a xilinx part using an FT232H adapter: https://github.com/SMB784/SQRL/blob/master/SQRL.program_scripts/xilinx-artix7.cfg
« Last Edit: March 31, 2021, 01:32:02 am by SMB784 »
 
The following users thanked this post: fabiodl

Offline fabiodlTopic starter

  • Frequent Contributor
  • **
  • Posts: 282
Re: Openocd with DE-10 nano (usb blaster 2)
« Reply #4 on: March 31, 2021, 02:02:32 am »
The speed is the default in quartus.I tried reducing it down to 100Khz and it made no difference.
For posterity, I found a solution

I do not know why, but the svf generated by
Code: [Select]
quartus_sh   --flow compile pjname.qpf
is bad.
If I genetate it using
Code: [Select]
quartus_cpf -c -q 33Mhz -g 3.3 -n p Chain1.cdf /tmp/out.svf
then it works
« Last Edit: March 31, 2021, 02:20:17 am by fabiodl »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf