J-Link Base not showing anything and debug not working VS Code

Hi,

I am currently developing a software for a custom board with nRF9160 chip.

The code is tested and works on nrf9160DK. The debugging works and the device is showing all information from logs.

The problem comes when I move to my custom board and I try to upload code from my J-Link Base.

There the code uploads but you cannot see any log information on the port of the J-Link.

Also when I try to debug the code I get the following message:

and I cannot seem to fix it.

For trying to see the log I go to NRF Terminal, select the COM port that the device is on and choose 115200 8n1.

Also tried with putty with 9600 but still the connection is established but nothing comes on the screen,

Any suggestions on why the J-Link is not functioning as intended?

Parents
  • Hi,

     

    when debugging with the nordic vscode plugin, you should be able to link the specific build with a debugger/programmer using this:

    Does your debugger serialnumber now pop up?

    Are you able to use nrfjprog to program manually?

      

    Kind regards,

    Håkon

  • The debugger serial number pops up. 

    And I also tried this and get the same results.

    Are you able to use nrfjprog to program manually?

    I am not completely sure what this is. But the programming of the device works fine. The debugging doesn't.

  • Yes, here is the picture of the connection between the two devices.

  • The red wire on the cable indicates pin 1, and it is connected correctly on the nRF9160 dk. Have you tried turning it 180 degrees on your custom board to see if this could be the issue?

     

    Also, could you verify that the IO voltage is indeed 1.8V on your external board, by measuring pin 1 on the 10-pin SWD connector (on your custom board)?

     

    Kind regards,

    Håkon

  • The cable cannot be flipped because of the connector. But I am sure this is correct because the connector is shared between nRD91 and nRF52 on the custom board and for nRF52 there is no problem debugging and uploading code. for the nRF91 only uploading is possible.

    I just measured the pin and it is giving 1.8V.

  • Hi,

     

    Could you try to connect with J-Link Commander?

     

    To connect there, you can issue:

    device nrf9160_xxaa
    si 1
    speed 500
    connect

     

    And please share the output.

     

    Kind regards,

    Håkon

  • This is the output:

    Device "NRF9160_XXAA" selected.
    
    
    Connecting to target via SWD
    ConfigTargetSettings() start
    ---Setting ROM table---
    ConfigTargetSettings() end
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[7]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x84770001)
    AP[1]: AHB-AP (IDR: 0x24770011)
    AP[2]: JTAG-AP (IDR: 0x12880000)
    AP[3]: APB-AP (IDR: 0x54770002)
    AP[4]: JTAG-AP (IDR: 0x12880000)
    AP[5]: JTAG-AP (IDR: 0x12880000)
    AP[6]: MEM-AP (IDR: 0x128800A1)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FD212. Implementer code: 0x41 (ARM)
    Feature set: Mainline
    Found Cortex-M33 r0p2, Little endian.
    FPUnit: 8 code (BP) slots and 0 literal slots
    Security extension: implemented
    Secure debug: enabled
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID B105900D PID 000BBD21 DEVARCH 47702A04 DEVTYPE 00 Cortex-M33
    [0][1]: E0001000 CID B105900D PID 000BBD21 DEVARCH 47701A02 DEVTYPE 00 DWT
    [0][2]: E0002000 CID B105900D PID 000BBD21 DEVARCH 47701A03 DEVTYPE 00 FPB
    [0][3]: E0000000 CID B105900D PID 000BBD21 DEVARCH 47701A01 DEVTYPE 43 ITM
    [0][5]: E0041000 CID B105900D PID 002BBD21 DEVARCH 47724A13 DEVTYPE 13 ETM
    [0][6]: E0042000 CID B105900D PID 000BBD21 DEVARCH 47701A14 DEVTYPE 14 CSS600-CTI
    Cortex-M33 identified.

Reply
  • This is the output:

    Device "NRF9160_XXAA" selected.
    
    
    Connecting to target via SWD
    ConfigTargetSettings() start
    ---Setting ROM table---
    ConfigTargetSettings() end
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[7]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x84770001)
    AP[1]: AHB-AP (IDR: 0x24770011)
    AP[2]: JTAG-AP (IDR: 0x12880000)
    AP[3]: APB-AP (IDR: 0x54770002)
    AP[4]: JTAG-AP (IDR: 0x12880000)
    AP[5]: JTAG-AP (IDR: 0x12880000)
    AP[6]: MEM-AP (IDR: 0x128800A1)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FD212. Implementer code: 0x41 (ARM)
    Feature set: Mainline
    Found Cortex-M33 r0p2, Little endian.
    FPUnit: 8 code (BP) slots and 0 literal slots
    Security extension: implemented
    Secure debug: enabled
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID B105900D PID 000BBD21 DEVARCH 47702A04 DEVTYPE 00 Cortex-M33
    [0][1]: E0001000 CID B105900D PID 000BBD21 DEVARCH 47701A02 DEVTYPE 00 DWT
    [0][2]: E0002000 CID B105900D PID 000BBD21 DEVARCH 47701A03 DEVTYPE 00 FPB
    [0][3]: E0000000 CID B105900D PID 000BBD21 DEVARCH 47701A01 DEVTYPE 43 ITM
    [0][5]: E0041000 CID B105900D PID 002BBD21 DEVARCH 47724A13 DEVTYPE 13 ETM
    [0][6]: E0042000 CID B105900D PID 000BBD21 DEVARCH 47701A14 DEVTYPE 14 CSS600-CTI
    Cortex-M33 identified.

Children
  • Good, that means that it found the device, so programming and similar should not be a problem.

    Note that the "speed 500" now reduced the SWDCLK speed from 2MHz to 0.5 MHz, so there might be a problem with the drive-strength. Is there any resistors or capacitors in the SWDCLK/SWDIO path to the nRF9160 on your custom board?

     

    To change the default clock speed of nrfjprog, you can edit the "nrfjprog.ini" file?

    The default location for this is:

    C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\share\nrfjprog.ini

     

    And change the parameter:

    Clockspeed = 500

     

    And then try to program?

     

    Kind regards,

    Håkon

  • To change the default clock speed of nrfjprog, you can edit the "nrfjprog.ini" file?

    The parameter there was still 200 so there is nothing to change.

    And then try to program?

    I can program the device without any issues. That has always been the case. When I try to debug, then I get problems.

    Is there any resistors or capacitors in the SWDCLK/SWDIO path to the nRF9160 on your custom board?

    No, there are no resistors in the path of these two pins.

  • Hi,

     

    Svetlio141 said:
    The parameter there was still 200 so there is nothing to change.

    Change it from 2000 to 500 to lower the clock speed when using the nRF9160-DK as the debugger/programmer with your custom board.

    Svetlio141 said:
    I can program the device without any issues. That has always been the case. When I try to debug, then I get problems.

    Even with the nRF9160-DK as the programmer? You mentioned earlier that programming using the nRF9160-DK did not work:

    Svetlio141 said:

    I have tried this before also. With the DK debugger I can't even upload code to the device. 

    These are the errors that I get in Terminal:

     

    Kind regards,

    Håkon

  • Greetings, my colleague Svelio141 is no longer working on this issue, so I will have to take over.
    I will quickly go over the things that were done in this thread, to make sure I haven't missed anything.

    Flashing the custom board with a JLink base works (e.g. the blinky sample), but the error from the post pops up when I click `debug` from the Actions tab in VScode. As a result it's impossible to set breakpoints in order to develop effectively.

    I have an M1 mac instead of windows, ncs V2.1.3 installed through the toolchain manager. A Jlink Base V11.0 (different unit, but same version), the custom board that I have is from the same batch but a different unit.

    - When I click `debug` in the actions tab, I also do not get any information printed in the `debug output` tab of vscode

    - Programming the board manually through `nrfjprog` works as expected, i.e. the blinky sample starts blinking the led.

    - In my `launch.json` I have 2 configurations, both automatically generated by the nrf-connect plugin

    - I don't have a nrf9160dk, so I cannot test programming the board through the DK.

    - Editing nrfjprog.ini to reduce the clock speed did not solve the issue.

    - Running the commands you suggested through the JLink commander shows a similar output, i.e. device is recognized. I tried the same commands using speed 2000 instead of 500, and the device was once again recognized.

    - Our custom board has a switch similar to the nrf9160dk that switches the debug port between an nrf52833 and a nrf91. Programming the nrf9160 and the nrf52833 works fine through nrfjprog and vscode, trying to "debug" the application throws the error.

    - I downloaded v2.2.0 of ncs through the toolchain manager, I tried debugging the board through VSCode using v2.2.0 sdk and corresponding toolchain. The problem persisted.

    - I have a separate workspace that's setup with the upstream (i.e. not ncs) zephyr v2.7.3 and zephyr-sdk 0.15.0. Using CLion I can program the nrf9160 on our custom board and also debug it, i.e. use breakpoints as expected. Unfortunately the pure zephyr version does not have the LTE functionality that we need, so we want to use NCS.

    This makes me think that the issue is somewhere in my configuration of vscode, the ncs plugin or NCS.

    My end goal would be to be to use CLion for development, but as far as I know it's not oficially supported by NCS, so fixing the problem with debugging within VScode is also an acceptable solution.

    Best regards,

    Mihail

  • Hi Mihail,

     

    If you can flash, there should not be a hardware-wise restriction to enter debug mode. It can be a dependency (i.e. on some sort of python library or similar).

      

    Could you try to navigate to the ncs project that you have built and flashed, go into the build-folder and write:

    cd path/to/my_project/build
    ninja debug

     

    And see if it enters debug mode successfully? 

    Mihail M said:
    - Our custom board has a switch similar to the nrf9160dk that switches the debug port between an nrf52833 and a nrf91. Programming the nrf9160 and the nrf52833 works fine through nrfjprog and vscode, trying to "debug" the application throws the error.

    Is there any details around the error message that you can share? Is it similar to the original message, where it is "file not found"?

    Mihail M said:

    My end goal would be to be to use CLion for development, but as far as I know it's not oficially supported by NCS, so fixing the problem with debugging within VScode is also an acceptable solution.

    NCS (and zephyr for that matter) is quite versatile when it comes to which IDE/editor you use. The idea is that you can integrate it into your favorite editor or IDE, as long as you use the same toolchain (ie. zephyr-sdk toolchain.

     

    Kind regards,

    Håkon

Related