Azure Sphere: Debugging two RTApps at once fails with OpenOCD error

Michal Žůrek 136 Reputation points
2021-03-14T16:03:57.757+00:00

I want to make application consisting of two RTApps on AVNET Azure Sphere Starter Kit (rev1) platform with MT3620. I want to debug both applications at the same time using Visual Studio. I opened two Visual Studios and started debugging of one app. It worked. Then I started debuging of second app in second Visual Studio but folowing error occured:

77503-obrazek.png

after confirming dialog a new dialog appeared:

77400-obrazek.png

At the same time OpenOCD output was printed to Output window to "Device Update" output pane with following content:

Copying application to the device  
Device update succeeded.  
Launching On-Chip Debugger: "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\8\tools\openocd\openocd.exe" -s "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\8\tools\openocd" -f "mt3620-rdb-ftdi.cfg" -f "mt3620-io1.cfg" -c "gdb_port" -c "targets"  
Open On-Chip Debugger 0.10.0+dev-01288-g5a79481d3-dirty (2021-01-04-20:24)  
Licensed under GNU GPL v2  
For bug reports, read  
 http://openocd.org/doc/doxygen/bugs.html  
DEPRECATED! use 'adapter driver' not 'interface'  
Info : FTDI SWD mode enabled  
DEPRECATED! use 'adapter speed' not 'adapter_khz'  
force hard breakpoints  
4444  
  
    TargetName         Type       Endian TapName            State         
--  ------------------ ---------- ------ ------------------ ------------  
 0* io1                cortex_m   little mt3620.cpu         unknown  
  
Info : Listening on port 6666 for tcl connections  
Info : telnet server disabled  
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS  
Error: no device found  
Error: unable to open ftdi device with vid 0403, pid 6011, description 'MSFT MT3620 Std Interface', serial '*' at bus location '*'  
  
Open On-Chip Debugger 0.10.0+dev-01288-g5a79481d3-dirty (2021-01-04-20:24)  
Licensed under GNU GPL v2  
For bug reports, read  
 http://openocd.org/doc/doxygen/bugs.html  
DEPRECATED! use 'adapter driver' not 'interface'  
Info : FTDI SWD mode enabled  
DEPRECATED! use 'adapter speed' not 'adapter_khz'  
force hard breakpoints  
4444  
  
    TargetName         Type       Endian TapName            State         
--  ------------------ ---------- ------ ------------------ ------------  
 0* io1                cortex_m   little mt3620.cpu         unknown  
  
Info : Listening on port 6666 for tcl connections  
Info : telnet server disabled  
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS  
Error: no device found  
Error: unable to open ftdi device with vid 0403, pid 6011, description 'MSFT MT3620 Std Interface', serial '*' at bus location '*'  
  
"C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\8\tools\openocd\openocd.exe" -s "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\8\tools\openocd" -f "mt3620-rdb-ftdi.cfg" -f "mt3620-io1.cfg" -c "gdb_port" -c "targets" has exited with code '1'.  
"C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\8\tools\openocd\openocd.exe" -s "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\8\tools\openocd" -f "mt3620-rdb-ftdi.cfg" -f "mt3620-io1.cfg" -c "gdb_port" -c "targets" has exited with code '1'. (Exception)  
  

The most interesting part of output is

Error: libusb_open() failed with LIBUSB_ERROR_ACCESS  
Error: no device found  
Error: unable to open ftdi device with vid 0403, pid 6011, description 'MSFT MT3620 Std Interface', serial '*' at bus location '*'  

I tried switchng order of starting apps and I always can debug first app and second app crashes with error. From outputs I see that Visual Studio correctly attemped to use io0 config and io1 when starting second app. I also tried start both Visual Stduios as Administrator but nothing changed. Have you any idea how to resolve this libsub issue to be able debug both apps at once?

Azure Sphere
Azure Sphere
An Azure internet of things security solution including hardware, operating system, and cloud components.
157 questions
{count} vote

Accepted answer
  1. Chandranmsft 856 Reputation points
    2021-03-26T21:44:17.58+00:00

    @Michal Žůrek - Debugging 2 RTApps is not supported due to Visual Studio dependencies. To debug multiple RT cores, you will need to start and stop from the same IDE.

    We appreciate you sharing the use-case scenario. We are looking into how this scenario can be enabled in the upcoming releases. Thank you!


1 additional answer

Sort by: Most helpful
  1. Brian Willess 91 Reputation points
    2021-05-20T19:32:25.803+00:00

    @Michal Žůrek , have you tried to use debug output from the real-time application(s) over the dedicated M4 UART TX signals? This is not as nice as having a gdb debugger, but it's better than working in the dark.

    The dedicated M4 UART TX signals are exposed on the Avnet Starter Kits at location J11.