This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF52840 only works in JLINK debugger mode

Hi All

I have developed some code by modifying the 'ble_app_multiperipheral_pca10056_s140'. I have tested my code on the NRF52840 DK board (PCA10056) and everything seems to work well. I have then made the necessary code changes to use the NRF52840 dongle (PCA10059). The program  runs fine on the PCA10059 dongle whist connected to the jlink interface (using the NRF52840 DK board as a segger debugger) but fails to run once the dongle is programmed as a stand alone application. 

Any ideas as to why this may be??

Kind regards

Michael

Parents
  • Hi,

    Have you try using the nRF Connect app for PC to flash the segger compiled hex file? You will need to install the newest version (version 5) of the Programmer (experimental) app in nRF Connect. Open the programmer app, connect to the dongle, compile the program in Segger Embedded Studio (SES) & press "Add a hex file" in the Programmer app. Then, locate the built hex file in SES and locate the softdevice(nRF5_SDK_15.0.0_a53641a\components\softdevice\s140\hex\s140_nrf52_6.0.0_softdevice.hex) & press on button "Write".

    Best Regards,

    Marjeris

  • I think I have found my resolution.

    When running the unit on the debugger I always use the 'Build and Debug' option which resulted in a working execution whilst it was connected to the debugger (segger Jlink debug output from the NRF52840 board into my target (NRF52840 dongle))..

    If I used the alternative option which was to 'Build and Run' it works initially whilst connected to the JLINK debug interface, but as soon as I do a device reset or disconnect from the dongle it stops the code executing on the target.

    The way that seems to work for me is to use the other option to build the project - 'Rebuild the ble_app_multiperipheral_pca10056_s140' and then use the connect to target and program function

    After doing this the code runs fine on the target dongle and I can cycle the power without any problem / issue of the code not executing.

    Is the Build & run different to the rebuild in terms of compiling levels (e.g. the re-compile/inclusion of the soft device)??

    Cheers

    Michael

Reply
  • I think I have found my resolution.

    When running the unit on the debugger I always use the 'Build and Debug' option which resulted in a working execution whilst it was connected to the debugger (segger Jlink debug output from the NRF52840 board into my target (NRF52840 dongle))..

    If I used the alternative option which was to 'Build and Run' it works initially whilst connected to the JLINK debug interface, but as soon as I do a device reset or disconnect from the dongle it stops the code executing on the target.

    The way that seems to work for me is to use the other option to build the project - 'Rebuild the ble_app_multiperipheral_pca10056_s140' and then use the connect to target and program function

    After doing this the code runs fine on the target dongle and I can cycle the power without any problem / issue of the code not executing.

    Is the Build & run different to the rebuild in terms of compiling levels (e.g. the re-compile/inclusion of the soft device)??

    Cheers

    Michael

Children
  • Hi Michael,
    Great to hear! From the Segger Embedded webpage they explain:

    "When SEGGER Embedded Studio builds your application, it tries to avoid building files that have not changed since they were last built. It does this by comparing the modification dates of the generated files with the modification dates of the dependent files together with the modification dates of the project options that pertain to the build. But if you are copying files, sometimes the modification dates may not be updated when the file is copied—in this instance, it is wise to use the Rebuild command rather than the Build command."

    So if you have copied your project from one of the examples provided in the SDK it seems wise to use the Rebuild command when building your project for the first time.


    -Marjeris

Related