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

nRF52840 dongle question

Hello,

I am trying to use IAR examples to debug some of the examples provided in the SDK.

I am only using examples that support the pca10059 dongle.

One example is the peripheral/Blinky.

The J-Link with IAR debugger is working. My problem is that I cannot flash the part and debug it because it is already programmed with USB bootloader.

What do I need to do please in order to be able to flash the dongle and debug it succefuly?

Thank you.

Mohammad Karaki

Parents Reply Children
  • Hi again.

    You just have to reprogram it with your IAR J-Link. However, if you do a full flash erase (which includes erasing the UICR), you will have problems unless you have a debugger which has a levelshifter.

    This is because in the UICR there is a register called REGOUT0, which sets the voltage (standard value 1.8 V). And you need to have 3.0V in order to program the chip.

    To avoid this:

     - Never delete the UICR, and if you do delete UICR you should need to make sure that you set REGOUT0 to 3.0V before you reset.

    - Or, use a debugger which supports level shifting (for example the J-Link Pro, but this debugger is expensive).

    That's why I asked which IAR J-Link you have.

    - Andreas

  • Hi AndreasF,

    Ok. Thanks.

    The SDK provides some examples to support the dongle using IAR.

    One example is:

     ......\nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac\examples\peripheral\blinky

     

    How can I debug such examples on the dongle using the JTAG or the USB  driver of the dongle itself?

    Can you walk me through such steps?

    Greatly appreciated.

    Regards,

    Mohammad

  • Hi.

    You need to solder a ARM Cortex JTAG SWD 10pin Connector onto footprint P1, and either connect that to a external debugger or a development kit, like this:

    Connected to a development kit it looks like this:

    And connect the Dongle to a USB port

    Note: it is really important that the voltage on the nRF52840 Dongle matches the nRF52832 DK if you do it this way.

    If you want to use an external debugger, you could connect it like this:

    And connected the Dongle to a USB port:

    And also connected it to a debugger (I'm using the J-Link BASE here)

    Then you just have to use the IDE you wish to use to debug.

    - Andreas

  • Hi Andreasf,

    I have done that already. I told you I was able to use IAR with Jlink to download an example to the dongle. The problem is that I had to erase the dongle program, retarget the example to address 0x0000000 instead of the 0x1000000 the dongle uses with its bootloader.

    What I need from you, again, is to try to use one of the examples provided and succefuly debug it with the IAR workbench and let me know how you did it.

    After downloading the code, the pointer should break at "main"

    Thank you.

    Mohammad

  • Hi.

    Which specific example are you looking at? Please give me the exact path in your SDK folder.

    The pca10059 examples have an offset, so if you have loaded a pca10059 example, you could have placed it in the wrong place.

    Note that the peripherals examples does not require a SoftDevice.

    - Andreas

Related