Cannot debug Maix GO using platformio & vscode

Hi, when I try running a simple helloworld program using with platformio and vscode I get this error when trying to debug

Kendryte Open On-Chip Debugger For RISC-V v0.2.3 (2019-02-21)
Licensed under GNU GPL v2
none separate
adapter speed: 1000 kHz
Info : auto-selecting first available session transport “jtag”. To override use 'transport select '.
riscv.cpu
Info : tcl server disabled
Info : telnet server disabled
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6014, description ‘’, serial '’ at bus location ‘*’

.pioinit:13: Error in sourced command file:

When I update the file to have the correct pid to 6010 in .platformio/packages/tool-openocd-kendryte/share/openocd/scripts/interface/ftdi/iot-bus-jtag.cfg I see the following error:

Info : auto-selecting first available session transport “jtag”. To override use 'transport select ‘.
riscv.cpu
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 1000 kHz
Info : TAP riscv.cpu does not have valid IDCODE (idcode=0xfa82fa)
Info : JTAG tap: auto0.tap tap/device found: 0x007d417d (mfg: 0x0be (Seiko Epson), part: 0x07d4, ver: 0x0)
Info : JTAG tap: auto1.tap tap/device found: 0x02fd007d (mfg: 0x03e (Oracle Corporation), part: 0x2fd0, ver: 0x0)
Info : JTAG tap: auto2.tap tap/device found: 0x02fd007d (mfg: 0x03e (Oracle Corporation), part: 0x2fd0, ver: 0x0)
Info : JTAG tap: auto3.tap tap/device found: 0x3cb5807d (mfg: 0x03e (Oracle Corporation), part: 0xcb58, ver: 0x3)
Info : TAP auto4.tap does not have valid IDCODE (idcode=0xffff8272)
Info : JTAG tap: auto5.tap tap/device found: 0xffffc139 (mfg: 0x09c (Eon Silicon Devices), part: 0xfffc, ver: 0xf)
Warn : AUTO auto0.tap - use “jtag newtap auto0 tap -irlen 2 -expected-id 0x007d417d”
Error: auto0.tap: IR capture error; saw 0x0003 not 0x0001
Warn : Bypassing JTAG setup events due to errors
Error: dtmcontrol is 0. Check JTAG connectivity/board power.
Info : accepting ‘gdb’ connection from pipe
openocd: src/target/riscv/riscv.c:1496: riscv_xlen_of_hart: Assertion `r->xlen[hartid] != -1’ failed.
.pioinit:13: Error in sourced command file:
Remote connection closed

Can you please help, with getting gdb working with platformio

I’m having difficulties as well. Three days ago I saw some posts from btx000 and Ivan Kravets over at github about debugging with platformio and Maix GO, see here. It seems that some things are not OK yet.

1 Like

Thanks for the reply, will track that bug.

Does anyone know the steps to debug without platform.io on maix-go board?

Here are the detailed steps to debug a Maix board using PIO. See http://blog.sipeed.com/p/727.html.
On Linux systems, you need to install the rules file for udev. If you are debugging a Maix Go board, don’t forget to let the onboard debug it into DFU mode.
If you are using the Sipeed RV Debugger, wait for the update of the openocd package or go here to find the relevant configuration file and put it in the corresponding directory.

@MrAdi
I have been able to debug with a somewhat older (April 2019) versions of the kendryte standalone SDK and the kenderyte_openocd. Also note that I may not have a recent version of the STM firmware. So, your mileage may vary.

The command to run in the openocd folder is:

./bin/openocd -f ./tcl/openocd_cmsis_dap.cfg -m0

And the debugger was started with:

YOUR_PATH_TO/kendryte-toolchain/bin/riscv64-unknown-elf-gdb -ex ‘target remote localhost:3333’ YOUR_PATH_TO/kendryte-standalone-sdk/src/build/YOUR_PROJECT

The openocd_cmsis_dap.cfg file I used contains this:

interface cmsis-dap
transport select jtag
adapter_khz 1000
gdb_port 3333
telnet_port 4444
set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x04e4796b
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
init
halt

Thanks for the reply, will try this. But I think currently they also recommend using external debugger,like mentioned on the blog post from today.

http://blog.sipeed.com/p/727.html

@Bits, just to confirm, this requires an external debugger? The onboard open-ec firmware is not yet working for debugging. Correct? If I change my firmware to cmsis-dap, will that help?

My board came with the Open-EC firmware, but I would like to use the original CMSIS-DAP firmware for debugging on Linux, despite it being slower. Where can I get the source code for it, so I can recompile for the DFU bootloader?