Menu

#429 How to Select Daisy Chain Chip Devices

0.10.0
new
nobody
2024-04-12
2024-04-11
KooLee
No

I'm having problems programming FPGAs with FT2232H+OpenOCD, I don't know how to solve it, I hope enthusiastic people in the community can help me out.

According to Xilinx UG470 manual, FPGA supports JTAG daisy chaining.

Xilinx Vivado Hardware Managers

Please tell me how to select the specified FPGA device in openocd.

The programmer device I am using is FT2232H.

ft2232h.cfg

interface ftdi
ftdi_vid_pid 0x0403 0x6011
ftdi_channel 0
ftdi_layout_init 0x0098 0x008b
reset_config none

source [find cpld/xilinx-xc7.cfg]
source [find cpld/jtagspi.cfg]
adapter_khz 10000

proc fpga_program {} {
        global _CHIPNAME
        xc7_program $_CHIPNAME.tap
}

init
jtagspi_init 0 bscan_spi_xc7a50t.bit
jtagspi_program bin.bin 0x0
fpga_program
shutdown

Discussion

  • KooLee

    KooLee - 2024-04-11

    Try to connect using the JLink programmer

    jtag
    xc7_program
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Warn : Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
    Info : J-Link V9 compiled May  7 2021 16:26:12
    Info : Hardware version: 9.60
    Info : VTarget = 3.303 V
    Info : clock speed 15000 kHz
    Info : JTAG tap: xc7.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
    Info : JTAG tap: auto0.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
    Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x13631093"
    Error: IR capture error at bit 8, saw 0x0FFFFFFFFFFFFFFD75 not 0x...3
    Warn : Bypassing JTAG setup events due to errors
    Warn : gdb services need one or more targets defined
    

    2 JTGA Taps appear, follow the prompts and add " jtag newtap auto0 tap -irlen 2 -expected-id 0x13631093 " to the cfg.

    xc7_program
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Warn : Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
    Info : J-Link V9 compiled May  7 2021 16:26:12
    Info : Hardware version: 9.60
    Info : VTarget = 3.316 V
    Info : clock speed 15000 kHz
    Info : JTAG tap: auto0.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
    Info : JTAG tap: xc7.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
    Error: IR capture error at bit 8, saw 0x0175 not 0x...3
    Warn : Bypassing JTAG setup events due to errors
    Warn : gdb services need one or more targets defined
    

    The pcb has 2 pieces of the same model FPGA type on it.

     
  • KooLee

    KooLee - 2024-04-12

    J-link.cfg

    adapter driver jlink
    adapter speed 15000
    transport select jtag
    

    xc7.cfg add

    jtag newtap xc7_2 tap -irlen 2 -expected-id 0x13631093
    


    scan_chain

    openocd 0.10.0 log

    jtag
    xc7_program
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Warn : Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
    Info : J-Link V9 compiled May  7 2021 16:26:12
    Info : Hardware version: 9.60
    Info : VTarget = 3.314 V
    Info : clock speed 15000 kHz
    Info : JTAG tap: xc7.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
    Info : JTAG tap: xc7_2.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
    Error: IR capture error at bit 8, saw 0x0175 not 0x...3
    Warn : Bypassing JTAG setup events due to errors
    Warn : gdb services need one or more targets defined
    Info : accepting 'telnet' connection on tcp/4444
    
     
    • KooLee

      KooLee - 2024-04-12

      FPGA info for Vivado

      Name    Fpag_0_Value    Fpag_1_Value
      REGISTER.IR 010101  110101
      REGISTER.IR.BIT0_ALWAYS_ONE 1   1
      REGISTER.IR.BIT1_ALWAYS_ZERO    0   0
      REGISTER.IR.BIT2_ISC_DONE   1   1
      REGISTER.IR.BIT3_ISC_ENABLED    0   0
      REGISTER.IR.BIT4_INIT_COMPLETE  1   1
      

      openocd 0.10.0 debug logs

      User : 13 2 options.c:63 configuration_output_handler(): debug_level: 3
      User : 14 4 options.c:63 configuration_output_handler():
      Debug: 15 5 options.c:187 add_default_dirs(): bindir=/usr/local/bin
      Debug: 16 7 options.c:188 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
      Debug: 17 10 options.c:189 add_default_dirs(): exepath=C:/Users/**/Desktop/OpenOCD-0.10.0/src
      Debug: 18 13 options.c:190 add_default_dirs(): bin2data=../share/openocd
      Debug: 19 15 configuration.c:42 add_script_search_dir(): adding C:\Users\**\AppData\Roaming/OpenOCD
      Debug: 20 37 configuration.c:42 add_script_search_dir(): adding C:/Users/**/Desktop/OpenOCD-0.10.0/src/../share/openocd/site
      Debug: 21 40 configuration.c:42 add_script_search_dir(): adding C:/Users/**/Desktop/OpenOCD-0.10.0/src/../share/openocd/scripts
      Debug: 22 44 configuration.c:97 find_file(): found ../tcl/interface/jlink.cfg
      Debug: 23 48 command.c:143 script_debug(): command - adapter adapter driver jlink
      Debug: 25 51 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 26 53 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 27 54 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 28 55 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 29 56 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 30 58 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 31 59 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 32 60 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 33 62 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 34 63 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 35 64 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 36 65 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 37 67 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 38 68 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 39 69 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 40 70 command.c:354 register_command_handler(): registering 'jlink'...
      Debug: 41 71 command.c:143 script_debug(): command - adapter adapter speed 15000
      Debug: 43 73 core.c:1830 jtag_config_khz(): handle jtag khz
      Debug: 44 74 core.c:1793 adapter_khz_to_speed(): convert khz to interface specific speed value
      Debug: 45 75 core.c:1793 adapter_khz_to_speed(): convert khz to interface specific speed value
      Debug: 46 77 command.c:143 script_debug(): command - transport transport select jtag
      Debug: 47 79 command.c:354 register_command_handler(): registering 'jtag_flush_queue_sleep'...
      Debug: 48 80 command.c:354 register_command_handler(): registering 'jtag_rclk'...
      Debug: 49 82 command.c:354 register_command_handler(): registering 'jtag_ntrst_delay'...
      Debug: 50 84 command.c:354 register_command_handler(): registering 'jtag_ntrst_assert_width'...
      Debug: 51 85 command.c:354 register_command_handler(): registering 'scan_chain'...
      Debug: 52 87 command.c:354 register_command_handler(): registering 'runtest'...
      Debug: 53 88 command.c:354 register_command_handler(): registering 'irscan'...
      Debug: 54 89 command.c:354 register_command_handler(): registering 'verify_ircapture'...
      Debug: 55 90 command.c:354 register_command_handler(): registering 'verify_jtag'...
      Debug: 56 92 command.c:354 register_command_handler(): registering 'tms_sequence'...
      Debug: 57 93 command.c:354 register_command_handler(): registering 'wait_srst_deassert'...
      Debug: 58 95 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 59 96 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 60 97 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 61 98 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 62 99 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 63 101 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 64 102 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 65 103 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 66 104 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 67 105 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 68 106 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 69 107 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 70 110 command.c:354 register_command_handler(): registering 'jtag'...
      Debug: 71 112 command.c:354 register_command_handler(): registering 'svf'...
      Debug: 72 117 command.c:354 register_command_handler(): registering 'xsvf'...
      User : 73 118 options.c:63 configuration_output_handler(): jtagUser : 74 120 options.c:63 configuration_output_handler():
      Debug: 75 121 configuration.c:97 find_file(): found ../tcl/cpld/xilinx-xc7.cfg
      Debug: 76 122 command.c:143 script_debug(): command - jtag jtag newtap xc7 tap -irlen 6 -ignore-version -expected-id 0x03622093 -expected-id 0x03620093 -expected-id 0x037C4093 -expected-id 0x0362F093 -expected-id 0x037C8093 -expected-id 0x037C7093 -expected-id 0x037C3093 -expected-id 0x0362E093 -expected-id 0x037C2093 -expected-id 0x0362D093 -expected-id 0x0362C093 -expected-id 0x03632093 -expected-id 0x03631093 -expected-id 0x03636093 -expected-id 0x03647093 -expected-id 0x0364C093 -expected-id 0x03651093 -expected-id 0x03747093 -expected-id 0x03656093 -expected-id 0x03752093 -expected-id 0x03751093 -expected-id 0x03671093 -expected-id 0x036B3093 -expected-id 0x036B7093 -expected-id 0x036BB093 -expected-id 0x036BF093 -expected-id 0x03667093 -expected-id 0x03682093 -expected-id 0x03687093 -expected-id 0x03692093 -expected-id 0x03691093 -expected-id 0x03696093 -expected-id 0x036D5093 -expected-id 0x036D9093 -expected-id 0x036DB093
      Debug: 77 138 tcl.c:566 jim_newtap_cmd(): Creating New Tap, Chip: xc7, Tap: tap, Dotted: xc7.tap, 73 params
      Debug: 78 141 tcl.c:591 jim_newtap_cmd(): Processing option: -irlen
      Debug: 79 142 tcl.c:591 jim_newtap_cmd(): Processing option: -ignore-version
      Debug: 80 148 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 81 153 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 82 154 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 83 157 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 84 158 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 85 161 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 86 162 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 87 163 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 88 165 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 89 166 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 90 167 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 91 168 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 92 171 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 93 172 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 94 175 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 95 176 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 96 178 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 97 180 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 98 185 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 99 187 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 100 188 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 101 191 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 102 193 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 103 194 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 104 195 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 105 197 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 106 198 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 107 199 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 108 201 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 109 203 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 110 206 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 111 207 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 112 208 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 113 209 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 114 212 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 115 213 core.c:1492 jtag_tap_init(): Created Tap: xc7.tap @ abs position 0, irlen 6, capture: 0x1 mask: 0x3
      Debug: 116 219 command.c:143 script_debug(): command - jtag jtag newtap xc7_2 tap -irlen 2 -expected-id 0x13631093
      Debug: 117 221 tcl.c:566 jim_newtap_cmd(): Creating New Tap, Chip: xc7_2, Tap: tap, Dotted: xc7_2.tap, 4 params
      Debug: 118 224 tcl.c:591 jim_newtap_cmd(): Processing option: -irlen
      Debug: 119 225 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
      Debug: 120 227 core.c:1492 jtag_tap_init(): Created Tap: xc7_2.tap @ abs position 1, irlen 2, capture: 0x1 mask: 0x3
      Debug: 121 229 command.c:143 script_debug(): command - pld pld device virtex2 xc7.tap 1
      Debug: 123 230 command.c:354 register_command_handler(): registering 'virtex2'...
      Debug: 124 232 command.c:354 register_command_handler(): registering 'virtex2'...
      Debug: 125 234 command.c:354 register_command_handler(): registering 'virtex2'...
      User : 126 238 options.c:63 configuration_output_handler(): xc7_programUser : 127 240 options.c:63 configuration_output_handler():
      Info : 128 241 server.c:332 add_service(): Listening on port 6666 for tcl connections
      Info : 129 242 server.c:332 add_service(): Listening on port 4444 for telnet connections
      Debug: 130 245 command.c:143 script_debug(): command - init init
      Debug: 132 247 command.c:143 script_debug(): command - target target init
      Debug: 134 250 command.c:143 script_debug(): command - target target names
      Debug: 135 253 target.c:1440 handle_target_init_command(): Initializing targets...
      Debug: 136 255 jlink.c:571 jlink_init(): Using libjaylink 0.2.0-git-f73ad5e (compiled with 0.2.0-git-f73ad5e).
      Debug: 137 263 jlink.c:526 jaylink_log_handler(): Found device (VID:PID = 1366:0105, bus:address = 001:008).
      Warn : 138 265 jlink.c:526 jaylink_log_handler(): Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
      Debug: 139 267 jlink.c:526 jaylink_log_handler(): Found device (VID:PID = 1366:0105, bus:address = 001:008).
      Debug: 140 272 jlink.c:526 jaylink_log_handler(): Device: USB address = 0.
      Debug: 141 273 jlink.c:526 jaylink_log_handler(): Device: Serial number = 63630854.
      Debug: 142 275 jlink.c:526 jaylink_log_handler(): Allocating new device instance.
      Debug: 143 276 jlink.c:526 jaylink_log_handler(): Found 1 USB device(s).
      Debug: 144 280 jlink.c:526 jaylink_log_handler(): Trying to open device (bus:address = 001:008).
      Debug: 145 282 jlink.c:526 jaylink_log_handler(): Using endpoint 83 (IN) and 03 (OUT).
      Debug: 146 286 jlink.c:526 jaylink_log_handler(): Device opened successfully.
      Info : 154 288 jlink.c:696 jlink_init(): J-Link V9 compiled May  7 2021 16:26:12
      Info : 167 291 jlink.c:737 jlink_init(): Hardware version: 9.60
      Info : 176 292 jlink.c:778 jlink_init(): VTarget = 3.322 V
      Debug: 182 293 jlink.c:526 jaylink_log_handler(): Last read operation left 16 bytes in the buffer.
      Debug: 192 296 jlink.c:931 jlink_reset(): TRST: 0, SRST: 0.
      Debug: 212 313 core.c:1793 adapter_khz_to_speed(): convert khz to interface specific speed value
      Debug: 213 319 core.c:1797 adapter_khz_to_speed(): have interface set up
      Debug: 220 321 core.c:1793 adapter_khz_to_speed(): convert khz to interface specific speed value
      Debug: 221 323 core.c:1797 adapter_khz_to_speed(): have interface set up
      Info : 222 324 core.c:1573 adapter_init(): clock speed 15000 kHz
      Debug: 223 326 openocd.c:143 handle_init_command(): Debug Adapter init complete
      Debug: 224 328 command.c:143 script_debug(): command - transport transport init
      Debug: 226 329 transport.c:239 handle_transport_init(): handle_transport_init
      Debug: 227 332 jlink.c:931 jlink_reset(): TRST: 0, SRST: 0.
      Debug: 232 334 core.c:830 jtag_add_reset(): SRST line released
      Debug: 233 334 core.c:855 jtag_add_reset(): TRST line released
      Debug: 234 336 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
      Debug: 235 337 command.c:143 script_debug(): command - jtag jtag arp_init
      Debug: 236 338 core.c:1586 jtag_init_inner(): Init JTAG chain
      Debug: 237 339 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
      Debug: 247 341 core.c:1243 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
      Debug: 248 344 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
      Info : 258 346 core.c:1142 jtag_examine_chain_display(): JTAG tap: xc7.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
      Info : 259 353 core.c:1142 jtag_examine_chain_display(): JTAG tap: xc7_2.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
      Debug: 260 355 core.c:1367 jtag_validate_ircapture(): 10 # Debugging code I added myself
      Error: 261 356 core.c:1369 jtag_validate_ircapture(): 255 # Debugging code I added myself
      Error: 262 358 core.c:1369 jtag_validate_ircapture(): 3 # Debugging code I added myself
      Debug: 263 359 core.c:1377 jtag_validate_ircapture(): IR capture validation scan
      Debug: 273 363 core.c:1434 jtag_validate_ircapture(): xc7.tap: IR capture 0x35
      Debug: 274 364 core.c:1438 jtag_validate_ircapture(): 6 # Debugging code I added myself
      Debug: 275 365 core.c:1434 jtag_validate_ircapture(): xc7_2.tap: IR capture 0x0001
      Debug: 276 366 core.c:1438 jtag_validate_ircapture(): 8 # Debugging code I added myself
      Error: 277 367 core.c:1444 jtag_validate_ircapture(): 117 # Debugging code I added myself
      Error: 278 368 core.c:1444 jtag_validate_ircapture(): 1 # Debugging code I added myself
      Error: 279 369 core.c:1449 jtag_validate_ircapture(): IR capture error at bit 8, saw 0x0175 not 0x...3
      Debug: 280 371 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
      Warn : 290 373 core.c:1654 jtag_init_inner(): Bypassing JTAG setup events due to errors
      Debug: 291 375 command.c:143 script_debug(): command - dap dap init
      Debug: 293 376 arm_dap.c:106 dap_init_all(): Initializing all DAPs ...
      Debug: 294 381 openocd.c:160 handle_init_command(): Examining targets...
      Debug: 295 386 command.c:143 script_debug(): command - flash flash init
      Debug: 297 388 tcl.c:1327 handle_flash_init_command(): Initializing flash devices...
      Debug: 298 390 command.c:143 script_debug(): command - nand nand init
      Debug: 300 391 tcl.c:498 handle_nand_init_command(): Initializing NAND devices...
      Debug: 301 394 command.c:143 script_debug(): command - pld pld init
      Debug: 303 395 pld.c:206 handle_pld_init_command(): Initializing PLDs...
      Debug: 304 397 command.c:354 register_command_handler(): registering 'pld'...
      Debug: 305 398 command.c:354 register_command_handler(): registering 'pld'...
      Warn : 306 399 gdb_server.c:3574 gdb_target_add_all(): gdb services need one or more targets defined
      

      The error seems to be related to the 2nd fpga IR read.

      Debug: 273 363 core.c:1434 jtag_validate_ircapture(): xc7.tap: IR capture 0x35
      Debug: 275 365 core.c:1434 jtag_validate_ircapture(): xc7_2.tap: IR capture 0x0001

       

      Last edit: KooLee 2024-04-12
    • Tommy Murphy

      Tommy Murphy - 2024-04-12

      openocd 0.10.0 log

      0.10.0 is very old and there have been significant development changes to its implementation since then.

      You should probably consider using a more recent build of OpenOCD either from your distro's software repositories or manually built from the latest OpenOCD 0.12.0+ sources.

      If you do this then you may need to make some small changes to your OpenOCD script(s).

       

Log in to post a comment.

MongoDB Logo MongoDB