sipeed / platform-kendryte210

Kendryte K210: development platform for PlatformIO
https://platformio.org/platforms/kendryte210
Other
79 stars 31 forks source link

Maix Bit with Sipeed USB-JTAG/TTL RISC-V Debugger #24

Open dave-design opened 4 years ago

dave-design commented 4 years ago

I've a problem with debugging Maix Bit board using openocd. I'm using PlatformIO with Kendryte Standalone SDK.

OS: Ubuntu 18.04

k210 platform:Sipeed MaiX BiT with Mic https://docs.platformio.org/en/latest/boards/kendryte210/sipeed-maix-bit-mic.html#board-kendryte210-sipeed-maix-bit-mic

debugger:Sipeed USB-JTAG/TTL RISC-V Debugger

platformio.ini [env:sipeed-maix-bit-mic] platform = kendryte210 board = sipeed-maix-bit-mic framework = kendryte-standalone-sdk debug_tool = sipeed-rv-debugger upload_protocol = kflash

After "Started debugging": `Processing sipeed-maix-bit-mic (platform: kendryte210; board: sipeed-maix-bit-mic; framework: kendryte-standalone-sdk)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/kendryte210/sipeed-maix-bit-mic.html PLATFORM: Kendryte K210 1.2.1 > Sipeed MAIX BiT with Mic HARDWARE: K210 400MHz, 6MB RAM, 16MB Flash DEBUG: Current (sipeed-rv-debugger) External (iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, sipeed-rv-debugger, tumpa) PACKAGES:

  1. Hardware connections verified, debugger board <> Maix board using multimeter.
  2. Board is working. Tested with kflash tool.
  3. Additionally, compiled Kendryte Openocd independently, directly from the sources. The same issue. Detailed logs below.
  4. Tried to reduce speed by using "adapter_khz 1000", the same..

More detailed debug from point 3 with debug_level set to 3. `openocd -f ~/.platformio/packages/tool-openocd-kendryte/share/openocd/scripts/interface/ftdi/sipeed-rv-debugger.cfg -c "adapter_khz 1000" -d


| |/ / | |_ | |
| ' // \ ' \ / _` | '
| | | | / _ \ | . \ / | | | (| | | | || | || / ||_\|| ||_,|| _, |__| |/
Kendryte Open On-Chip Debugger For RISC-V v0.2.3 (2019-02-21) Licensed under GNU GPL v2 User : 13 1 command.c:544 command_print(): debug_level: 3 Debug: 14 1 options.c:188 add_default_dirs(): bindir=/usr/local/bin Debug: 15 1 options.c:189 add_default_dirs(): pkgdatadir=/usr/local/share/openocd Debug: 16 1 options.c:190 add_default_dirs(): exepath=/usr/local/bin Debug: 17 1 options.c:191 add_default_dirs(): bin2data=../share/openocd Debug: 18 1 configuration.c:42 add_script_search_dir(): adding /home/user/.openocd Debug: 19 1 configuration.c:42 add_script_search_dir(): adding /usr/local/bin/../share/openocd/site Debug: 20 1 configuration.c:42 add_script_search_dir(): adding /usr/local/bin/../share/openocd/scripts Debug: 21 1 configuration.c:82 find_file(): found /home/user/.platformio/packages/tool-openocd-kendryte/share/openocd/scripts/interface/ftdi/sipeed-rv-debugger.cfg Debug: 22 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface ftdi Debug: 23 1 command.c:143 script_debug(): command - interface ocd_interface ftdi Debug: 25 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_device_desc'... Debug: 26 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_serial'... Debug: 27 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_location'... Debug: 28 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_channel'... Debug: 29 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_layout_init'... Debug: 30 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_layout_signal'... Debug: 31 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_set_signal'... Debug: 32 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_get_signal'... Debug: 33 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_vid_pid'... Debug: 34 1 command.c:364 register_command_handler(): registering 'ocd_ftdi_tdo_sample_edge'... Debug: 35 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_vid_pid 0x0403 0x6010 Debug: 36 1 command.c:143 script_debug(): command - ftdi_vid_pid ocd_ftdi_vid_pid 0x0403 0x6010 Debug: 38 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_channel 0 Debug: 39 1 command.c:143 script_debug(): command - ftdi_channel ocd_ftdi_channel 0 Debug: 41 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_init 0x00e8 0x00eb Debug: 42 1 command.c:143 script_debug(): command - ftdi_layout_init ocd_ftdi_layout_init 0x00e8 0x00eb Debug: 44 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select jtag Debug: 45 1 command.c:143 script_debug(): command - ocd_transport ocd_transport select jtag Debug: 46 1 command.c:364 register_command_handler(): registering 'ocd_jtag_flush_queue_sleep'... Debug: 47 1 command.c:364 register_command_handler(): registering 'ocd_jtag_rclk'... Debug: 48 1 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'... Debug: 49 1 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_assert_width'... Debug: 50 1 command.c:364 register_command_handler(): registering 'ocd_scan_chain'... Debug: 51 1 command.c:364 register_command_handler(): registering 'ocd_jtag_reset'... Debug: 52 1 command.c:364 register_command_handler(): registering 'ocd_runtest'... Debug: 53 1 command.c:364 register_command_handler(): registering 'ocd_irscan'... Debug: 54 1 command.c:364 register_command_handler(): registering 'ocd_verify_ircapture'... Debug: 55 1 command.c:364 register_command_handler(): registering 'ocd_verify_jtag'... Debug: 56 1 command.c:364 register_command_handler(): registering 'ocd_tms_sequence'... Debug: 57 1 command.c:364 register_command_handler(): registering 'ocd_wait_srst_deassert'... Debug: 58 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 59 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 60 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 61 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 62 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 63 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 64 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 65 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 66 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 67 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 68 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 69 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 70 1 command.c:364 register_command_handler(): registering 'ocd_jtag'... Debug: 71 1 command.c:364 register_command_handler(): registering 'ocd_svf'... Debug: 72 1 command.c:364 register_command_handler(): registering 'ocd_xsvf'... Debug: 73 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_tdo_sample_edge falling Debug: 74 1 command.c:143 script_debug(): command - ftdi_tdo_sample_edge ocd_ftdi_tdo_sample_edge falling User : 76 1 command.c:544 command_print(): ftdi samples TDO on falling edge of TCK Debug: 77 1 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 1000 Debug: 78 2 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 1000 Debug: 80 2 core.c:1693 jtag_config_khz(): handle jtag khz Debug: 81 2 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 82 2 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value User : 83 2 command.c:544 command_print(): adapter speed: 1000 kHz Info : 84 2 server.c:307 add_service(): Listening on port 6666 for tcl connections Info : 85 2 server.c:307 add_service(): Listening on port 4444 for telnet connections Debug: 86 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init Debug: 87 2 command.c:143 script_debug(): command - init ocd_init Debug: 89 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init Debug: 90 2 command.c:143 script_debug(): command - ocd_target ocd_target init Debug: 92 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names Debug: 93 2 command.c:143 script_debug(): command - ocd_target ocd_target names Debug: 94 2 target.c:1334 handle_target_init_command(): Initializing targets... Debug: 95 2 ftdi.c:657 ftdi_initialize(): ftdi interface using shortest path jtag state transitions Debug: 96 11 mpsse.c:422 mpsse_purge(): - Debug: 97 11 mpsse.c:703 mpsse_loopback_config(): off Debug: 98 11 mpsse.c:748 mpsse_set_frequency(): target 1000000 Hz Debug: 99 11 mpsse.c:709 mpsse_set_divisor(): 5 Debug: 100 11 mpsse.c:772 mpsse_set_frequency(): actually 1000000 Hz Debug: 101 11 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 102 11 core.c:1663 adapter_khz_to_speed(): have interface set up Debug: 103 11 mpsse.c:748 mpsse_set_frequency(): target 1000000 Hz Debug: 104 11 mpsse.c:709 mpsse_set_divisor(): 5 Debug: 105 11 mpsse.c:772 mpsse_set_frequency(): actually 1000000 Hz Debug: 106 11 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 107 11 core.c:1663 adapter_khz_to_speed(): have interface set up Info : 108 11 core.c:1448 adapter_init(): clock speed 1000 kHz Debug: 109 11 openocd.c:149 handle_init_command(): Debug Adapter init complete Debug: 110 11 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init Debug: 111 11 command.c:143 script_debug(): command - ocd_transport ocd_transport init Debug: 113 11 transport.c:239 handle_transport_init(): handle_transport_init Debug: 114 12 core.c:729 jtag_add_reset(): SRST line released Debug: 115 12 core.c:753 jtag_add_reset(): TRST line released Debug: 116 12 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset Debug: 117 12 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init Debug: 118 12 command.c:143 script_debug(): command - ocd_jtag ocd_jtag arp_init Debug: 119 12 core.c:1461 jtag_init_inner(): Init JTAG chain Warn : 120 12 core.c:1477 jtag_init_inner(): There are no enabled taps. AUTO PROBING MIGHT NOT WORK!! Debug: 121 12 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset Debug: 122 12 core.c:1121 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS Debug: 123 12 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset Debug: 124 267 core.c:1366 jtag_tap_init(): Created Tap: auto0.tap @ abs position 0, irlen 0, capture: 0x1 mask: 0x3 Info : 125 267 core.c:1172 jtag_examine_chain(): TAP auto0.tap does not have valid IDCODE (idcode=0xa0d746c) Debug: 126 267 core.c:1366 jtag_tap_init(): Created Tap: auto1.tap @ abs position 1, irlen 0, capture: 0x1 mask: 0x3 Info : 127 267 core.c:1172 jtag_examine_chain(): TAP auto1.tap does not have valid IDCODE (idcode=0x506ba36) Debug: 128 267 core.c:1366 jtag_tap_init(): Created Tap: auto2.tap @ abs position 2, irlen 0, capture: 0x1 mask: 0x3 Info : 129 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto2.tap tap/device found: 0x02835d1b (mfg: 0x68d (), part: 0x2835, ver: 0x0) Debug: 130 267 core.c:1366 jtag_tap_init(): Created Tap: auto3.tap @ abs position 3, irlen 0, capture: 0x1 mask: 0x3 Info : 131 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto3.tap tap/device found: 0x1c1cda59 (mfg: 0x52c (), part: 0xc1cd, ver: 0x1) Debug: 132 267 core.c:1366 jtag_tap_init(): Created Tap: auto4.tap @ abs position 4, irlen 0, capture: 0x1 mask: 0x3 Info : 133 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto4.tap tap/device found: 0x881e585b (mfg: 0x42d (Nuvoton), part: 0x81e5, ver: 0x8) Debug: 134 267 core.c:1366 jtag_tap_init(): Created Tap: auto5.tap @ abs position 5, irlen 0, capture: 0x1 mask: 0x3 Info : 135 267 core.c:1172 jtag_examine_chain(): TAP auto5.tap does not have valid IDCODE (idcode=0x1d5cd95c) Debug: 136 267 core.c:1366 jtag_tap_init(): Created Tap: auto6.tap @ abs position 6, irlen 0, capture: 0x1 mask: 0x3 Info : 137 267 core.c:1172 jtag_examine_chain(): TAP auto6.tap does not have valid IDCODE (idcode=0x8eae6cae) Debug: 138 267 core.c:1366 jtag_tap_init(): Created Tap: auto7.tap @ abs position 7, irlen 0, capture: 0x1 mask: 0x3 Info : 139 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto7.tap tap/device found: 0xc7573657 (mfg: 0x32b (Solomon Systech Limited), part: 0x7573, ver: 0xc) Debug: 140 267 core.c:1366 jtag_tap_init(): Created Tap: auto8.tap @ abs position 8, irlen 0, capture: 0x1 mask: 0x3 Info : 141 267 core.c:1172 jtag_examine_chain(): TAP auto8.tap does not have valid IDCODE (idcode=0x40a0d746) Debug: 142 267 core.c:1366 jtag_tap_init(): Created Tap: auto9.tap @ abs position 9, irlen 0, capture: 0x1 mask: 0x3 Info : 143 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto9.tap tap/device found: 0x20506ba3 (mfg: 0x5d1 (), part: 0x0506, ver: 0x2) Debug: 144 267 core.c:1366 jtag_tap_init(): Created Tap: auto10.tap @ abs position 10, irlen 0, capture: 0x1 mask: 0x3 Info : 145 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto10.tap tap/device found: 0x63839b4b (mfg: 0x5a5 (), part: 0x3839, ver: 0x6) Debug: 146 267 core.c:1366 jtag_tap_init(): Created Tap: auto11.tap @ abs position 11, irlen 0, capture: 0x1 mask: 0x3 Info : 147 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto11.tap tap/device found: 0x9103cb0b (mfg: 0x585 (), part: 0x103c, ver: 0x9) Debug: 148 267 core.c:1366 jtag_tap_init(): Created Tap: auto12.tap @ abs position 12, irlen 0, capture: 0x1 mask: 0x3 Info : 149 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto12.tap tap/device found: 0x63ab9b2b (mfg: 0x595 (), part: 0x3ab9, ver: 0x6) Debug: 150 267 core.c:1366 jtag_tap_init(): Created Tap: auto13.tap @ abs position 13, irlen 0, capture: 0x1 mask: 0x3 Info : 151 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto13.tap tap/device found: 0x20506ba3 (mfg: 0x5d1 (), part: 0x0506, ver: 0x2) Debug: 152 267 core.c:1366 jtag_tap_init(): Created Tap: auto14.tap @ abs position 14, irlen 0, capture: 0x1 mask: 0x3 Info : 153 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto14.tap tap/device found: 0x63839b4b (mfg: 0x5a5 (), part: 0x3839, ver: 0x6) Debug: 154 267 core.c:1366 jtag_tap_init(): Created Tap: auto15.tap @ abs position 15, irlen 0, capture: 0x1 mask: 0x3 Info : 155 267 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto15.tap tap/device found: 0x9103cb0b (mfg: 0x585 (), part: 0x103c, ver: 0x9) Debug: 156 267 core.c:1366 jtag_tap_init(): Created Tap: auto16.tap @ abs position 16, irlen 0, capture: 0x1 mask: 0x3 Info : 157 268 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto16.tap tap/device found: 0x63ab9b2b (mfg: 0x595 (), part: 0x3ab9, ver: 0x6) Debug: 158 268 core.c:1366 jtag_tap_init(): Created Tap: auto17.tap @ abs position 17, irlen 0, capture: 0x1 mask: 0x3 Info : 159 268 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto17.tap tap/device found: 0x20506ba3 (mfg: 0x5d1 (), part: 0x0506, ver: 0x2) Debug: 160 268 core.c:1366 jtag_tap_init(): Created Tap: auto18.tap @ abs position 18, irlen 0, capture: 0x1 mask: 0x3 Info : 161 268 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto18.tap tap/device found: 0x63839b4b (mfg: 0x5a5 (), part: 0x3839, ver: 0x6) Debug: 162 268 core.c:1366 jtag_tap_init(): Created Tap: auto19.tap @ abs position 19, irlen 0, capture: 0x1 mask: 0x3 Info : 163 268 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto19.tap tap/device found: 0x9103cb0b (mfg: 0x585 (), part: 0x103c, ver: 0x9) Debug: 164 268 core.c:1366 jtag_tap_init(): Created Tap: auto20.tap @ abs position 20, irlen 0, capture: 0x1 mask: 0x3 Info : 165 268 core.c:1020 jtag_examine_chain_display(): JTAG tap: auto20.tap tap/device found: 0x63ab9b2b (mfg: 0x595 (), part: 0x3ab9, ver: 0x6) Warn : 166 268 core.c:1058 jtag_examine_chain_end(): Unexpected idcode after end of chain: 517 0x839b4b23 Warn : 167 268 core.c:1058 jtag_examine_chain_end(): Unexpected idcode after end of chain: 549 0x03cb0b63 Warn : 168 268 core.c:1058 jtag_examine_chain_end(): Unexpected idcode after end of chain: 581 0xab9b2b91 Warn : 169 268 core.c:1058 jtag_examine_chain_end(): Unexpected idcode after end of chain: 613 0x506ba363 Error: 170 268 core.c:1197 jtag_examine_chain(): double-check your JTAG setup (interface, speed, ...) Error: 171 268 core.c:1506 jtag_init_inner(): Trying to use configured scan chain anyway... Debug: 172 268 core.c:1252 jtag_validate_ircapture(): IR capture validation scan Warn : 175 1033 core.c:1289 jtag_validate_ircapture(): AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x00000000" Error: 176 1033 core.c:1304 jtag_validate_ircapture(): auto0.tap: IR capture error; saw 0x0000 not 0x0001 Debug: 177 1033 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset Warn : 178 1033 core.c:1529 jtag_init_inner(): Bypassing JTAG setup events due to errors Debug: 179 1033 openocd.c:162 handle_init_command(): Examining targets... Debug: 180 1033 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash init Debug: 181 1033 command.c:143 script_debug(): command - ocd_flash ocd_flash init Debug: 183 1033 tcl.c:1166 handle_flash_init_command(): Initializing flash devices... Debug: 184 1033 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_mflash init Debug: 185 1033 command.c:143 script_debug(): command - ocd_mflash ocd_mflash init Debug: 187 1033 mflash.c:1377 handle_mflash_init_command(): Initializing mflash devices... Debug: 188 1033 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nand init Debug: 189 1033 command.c:143 script_debug(): command - ocd_nand ocd_nand init Debug: 191 1033 tcl.c:497 handle_nand_init_command(): Initializing NAND devices... Debug: 192 1033 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_pld init Debug: 193 1033 command.c:143 script_debug(): command - ocd_pld ocd_pld init Debug: 195 1033 pld.c:205 handle_pld_init_command(): Initializing PLDs... Warn : 196 1033 gdb_server.c:3175 gdb_target_add_all(): gdb services need one or more targets defined `

I would be so grateful for your support.

robertlipe commented 3 years ago

I found this while looking for another bug report. I have no actual superpowers for your problem here. (sorry.) After over a year, I'm sure that's frustrating.

I think the meat of this report is: jtag_examine_chain_end(): Unexpected idcode after end of chain: 581 0xab9b2b91 Warn : 169 268 core.c:1058 jtag_examine_chain_end(): Unexpected idcode after end of chain: 613 0x506ba363 Error: 170 268 core.c:1197 jtag_examine_chain(): double-check your JTAG setup (interface, speed, ...) Error: 171 268 core.c:1506 jtag_init_inner(): Trying to use configured scan chain anyway... Debug: 172 268

I've not had great luck with the Sipeed Debuggers (I'm dumpster diving in search results for a reason) but it looks like the JTAG communication is bad. I'd double check the colored wires between the K210 and the SiPeed/FTDI board. Also check that any devices on the K210 aren't electrically interfering with the signals and that you don't have too much voltage sag. I'd start double checking the colored ones, then K210 attachment, then the USB cables.

After getting frustrating with this last year, I went to Team Segger and considered it money VERY well spent. Now I'm back, punishing myself with this debugger (on a different board, though K210 was my original pairing) and wondering why I do it.

Good luck. I know there's no really tangible help, but you have a shoulder to cry on. :-)