unable to debug nrf52840 USB CDC ACM built on BLE client application

I'm facing an issue to debug nrf52840 using usb cdc acm application on top of ble client application . Same result when using Fanstel based on nrf52840 connected via usb to the host as well.

  1. In most cases resetting the target force a recovery after flashing the application. - Why the target needs recovery ?
  2. When running the debugger it returns with exception, 

Core registers:

Disassembly viewer:

Using Cortex-Debug extension for vscode. launch.jason as follows:

{
    "version": "0.2.0",
    "configurations": [


        {
            "name": "Cortex Debug",
            "cwd": "${workspaceRoot}",
            "executable": "${workspaceRoot}/_build/nrf52840_xxaa.out",
            "request": "launch",
            "type": "cortex-debug",
            "servertype": "jlink",
            "device": "nrf52",
            "interface": "swd",
            "serialNumber": "",
            "armToolchainPath": "/usr/local/gcc-arm-none-eabi-6-2017-q2-update/bin",
            "svdFile": "${workspaceRoot}/modules/nrfx/mdk/nrf52840.svd",
        }
    ]
}

When I use BLE client application or USB CDC ACM application, the debugger runs without any problems



Please help !
Parents
  • Hi 

    The issue requiring a recover before flashing the application again must be because APPROTECT is enabled, and to disable APPROTECT you must first erase the UICR entirely. which can only be done by an erase all (ERASEALL in the Control access port). In practice that is most easily done using "nrfjprog --recover". Note that this will erase entire flash content. There is (intentionally) no way around that.

    As to why the COM port doesn't work while debugging the Dongle I don't have any good ideas I'm afraid, but I have asked around internally to see if someone here has any good reasoning as to why this happens.

    Best regards,

    Simon

Reply
  • Hi 

    The issue requiring a recover before flashing the application again must be because APPROTECT is enabled, and to disable APPROTECT you must first erase the UICR entirely. which can only be done by an erase all (ERASEALL in the Control access port). In practice that is most easily done using "nrfjprog --recover". Note that this will erase entire flash content. There is (intentionally) no way around that.

    As to why the COM port doesn't work while debugging the Dongle I don't have any good ideas I'm afraid, but I have asked around internally to see if someone here has any good reasoning as to why this happens.

    Best regards,

    Simon

Children
Related