Debugging the nRF52840 does not always work

I have been trying to develop a project, my custom board has a nRF52840 chip and I have a nRF52840 DK too.

My problem is when I try to debug any example from any SDK. If I debug the example "Hello world" in the DK it runs correctly but if I try it in my custom board, it works sometimes. 

I tried the next environments:

1º) IDE Segger embbeded studio + SDK 4.2.0

2º) IDE Visual Studio COde + SDK 2.1.2 (Currently trying this)

Im debugging my custom board with a j-link Base (I tried with more j-link devices and more custom boards, and the error persists). When I try to debug my custom board, there are 3 possibilities:

1º) It debugs correctly

2º) The debug image is flashed and I can press "Step in" or whatever buttom from the debug menu, but it never stop in a breakpoint.

3º) A flash error appear when it tries to flash the debug firmware into the board.

SWD pins are correctly routed in the board cause I can show traces from RTT Viewer when it debugs correctly. 

Thanks!

Parents
  • Hello,

    1º) IDE Segger embbeded studio + SDK 4.2.0

    What is SDK 4.2.0?

    Does it happen on all applications, or only some? Did you e.g. try both examples that are not using Bluetooth Low Energy (BLE) and examples that are using BLE?

    3º) A flash error appear when it tries to flash the debug firmware into the board.

    Does that only occur when you are trying to debug? Or does it also happen if you try to flash your application without debugging, e.g. using nrfjprog (nRF Command Line Tools)? and the command:

    nrfjprog --program <path_to_hex_file>.hex --verify --sectorerase --reset

    And on your custom board, do you have an external LFXTAL? And if not, did you set up the application to use the internal RC Oscillator?

    Best regards,

    Edvin

  • Hello Edvin,

    What is SDK 4.2.0?

    SDK 4.2.0 is this one

    Does it happen on all applications, or only some? Did you e.g. try both examples that are not using Bluetooth Low Energy (BLE) and examples that are using BLE?

    Yes, it happens always, with "Hello world" example too.

    oes that only occur when you are trying to debug? Or does it also happen if you try to flash your application without debugging, e.g. using nrfjprog (nRF Command Line Tools)? and the command:

    nrfjprog --program <path_to_hex_file>.hex --verify --sectorerase --reset

    Yes, it happens to me sometimes when I try to debug, and the first step is to flash the board. I attach a picture with 2 attempts in a row, only 3-4 seconds between attempts. 

    And on your custom board, do you have an external LFXTAL? And if not, did you set up the application to use the internal RC Oscillator?

    My custom board has a module nRF52840 with an internal 32MHz clock and an external 32kHz clock. Do I need to change something? Why do the option of changing this settings is not available in the kconfig menu? I cant check any box.

Reply
  • Hello Edvin,

    What is SDK 4.2.0?

    SDK 4.2.0 is this one

    Does it happen on all applications, or only some? Did you e.g. try both examples that are not using Bluetooth Low Energy (BLE) and examples that are using BLE?

    Yes, it happens always, with "Hello world" example too.

    oes that only occur when you are trying to debug? Or does it also happen if you try to flash your application without debugging, e.g. using nrfjprog (nRF Command Line Tools)? and the command:

    nrfjprog --program <path_to_hex_file>.hex --verify --sectorerase --reset

    Yes, it happens to me sometimes when I try to debug, and the first step is to flash the board. I attach a picture with 2 attempts in a row, only 3-4 seconds between attempts. 

    And on your custom board, do you have an external LFXTAL? And if not, did you set up the application to use the internal RC Oscillator?

    My custom board has a module nRF52840 with an internal 32MHz clock and an external 32kHz clock. Do I need to change something? Why do the option of changing this settings is not available in the kconfig menu? I cant check any box.

Children
Related