ARM-software/vscode-embedded-debug

embedded-debug.flash not working (ERROR: Sequence 'DebugPortSetup' failed) (RDDI-ERROR 13)

kubichris opened this issue · 20 comments

Type: Bug Report

Describe the bug

  • VS Code Version: 1.77.3 (user setup)
    Electron: 19.1.11
    Chromium: 102.0.5005.196
    Node.js: 16.14.2
    V8: 10.2.154.26-electron.0
    OS: Win11, Windows_NT x64 10.0.22621
  • Extension Version: 0.9.0
  • Target Device: J-Link, CMSIS-DAP, ST-LINK progrmmers

task.json:

{
            "label": "embedded-debug.flash: Flash Device",
            "type": "embedded-debug.flash",
            "serialNumber": "${command:device-manager.getSerialNumber}",
            "program": "${workspaceFolder}/Release/reader.axf",
            "cmsisPack": "${workspaceFolder}/Pack/NXP.PN7xxxxx.0.9.0.pack",
            "processorName": "cm0",
            "deviceName": "PN7462AU-C3-00",
            "problemMatcher": [],
            "group": {
                "kind": "build",
                "isDefault": true
              }
          }

Terminal output with J-Link:

*  Executing task: embedded-debug.flash: Flash Device 

Device Selected: Vxx9xCSE
Parse debug description...
Create system description...
Connect to debug unit (CMSIS-DAP)...
Configure debug unit (SWD @ 2000000 Hz)...
Create device map...
Add Flash Algorithm...
        'PN7xxxxx PF (Jun 15 2016)' (0x00203000 - 0x0022c5ff)
Add Flash Algorithm...
        'PN7xxxxx EE (Jun 15 2016)' (0x00201200 - 0x00201fff)
Connect ('haltOnConnect') to device PN7462AU-C3-00...
ERROR: Cannot connect to USB device, it may be already in use, need a firmware update, or need reconnecting (RDDI-ERROR 13)
ERROR: Sequence 'DebugPortSetup' failed
Disconnect from device...
Disconnect from debug unit...
Debug connection failed
Flash failed

 *  The terminal process terminated with exit code: 1. 

Same effect with other programmers
In extension settings, I modified the Embedded-debug: Logging Verbosity to debug, but it seems to have no effect.

Hi @kubichris

Thanks for the feedback.

We only support CMSIS-DAP and ST-Link enabled boards, could you tell us what board you are using?

It would also be helpful if you could share the pack you are using, is it one available on https://www.keil.arm.com/?

cc @jreineckearm

Hi! @jreineckearm

Thanks for fast reply.

I miswrote the adapter, we are using uLink2 CMSIS-DAP mode (intead of J-Link).
But we try with CMSIS-DAP adapter ( stm32F103CBT6 with DAP-Link firmware)
Target MCU: NXP PN7642AU
Pack made by NXP, and I used successfully in uVision V5

Another project with uLink2:

  • Target MCU: STM32F030K6
  • Pack: Keil.STM32F0xx_DFP.1.0.1.pack
 * Executing task: embedded-debug.flash: Flash Device 

Device Selected: V2xx9xCSE
Parse debug description...
Create system description...
Connect to debug unit (CMSIS-DAP)...
Configure debug unit (SWD @ 10000000 Hz)...
Create device map...
Add Flash Algorithm...
First argument to DataView constructor must be an ArrayBuffer
Flash failed

 *  The terminal process terminated with exit code: 1. 

Same on ST-Link V3

br.

Update:

I replaced the pack to latest one (Keil.STM32F0xx_DFP.2.1.1.pack), and it works with ST-Link, but with uLink2 have the same error as before:

*  Executing task: embedded-debug.flash: Flash Device 

Device Selected: 0001A0000000
Parse debug description...
Create system description...
Connect to debug unit (CMSIS-DAP)...
Configure debug unit (SWD @ 10000000 Hz)...
Create device map...
Add Flash Algorithm...
       'STM32F0xx 32kB Flash' (0x08000000 - 0x08007fff)
Connect ('haltOnConnect') to device STM32F030K6Tx...
ERROR: Cannot connect to USB device, it may be already in use, need a firmware update, or need reconnecting (RDDI-ERROR 13)
ERROR: Sequence 'DebugPortSetup' failed
Disconnect from device...
Disconnect from debug unit...
Debug connection failed
Flash failed

*  The terminal process terminated with exit code: 1. 

@kubichris sorry for the late reply, this issue can occur if something else is using your USB device. Can you confirm if its still an issue?

@thegecko No, the USB is not used by anything else. Only for debugger, and still an issue, when we using uLink2

OK, one issue may be that ULINK2 is a HID device which we don't currently support. Let us investigate this further.

I also get the exact same issue. I am wondering just what the error code indicates.
I almost suspect sometimes the port is still active even though the previous session has ended or something like that.
I too am using the ULINK2 it seems to happen when going back and forth between flash task and debugging. I occasionally can get both to work individually but it does not like when I switch.