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.

    If you look at the linker script for that project, you can see the following at the top of the file:

    (i looked at the file: nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac\examples\peripheral\blinky\pca10059\mbr\armgcc\blinky_gcc_nrf52.ld)

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1000, LENGTH = 0xff000
      RAM (rwx) :  ORIGIN = 0x20000008, LENGTH = 0x3fff8
    }

    As you see, ORGIN =0x1000, compaired to the pca10056 (for nRF52840 Development Kit):

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x100000
      RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x40000
    }

    Which has ORGIN = 0x0.

    So the application is placed in an area which is not run, because you have deleted the bootloader.

    You have to change this address to 0x0.

    A project which uses the SoftDevice have another origin, like this:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xda000
      RAM (rwx) :  ORIGIN = 0x200022e0, LENGTH = 0x3dd20
    }

    The SoftDevice knows that there is an offset and the origin of the application is at 0x2600, so it will start that application.

    If you wish to use a program which requires SoftDevice, you also have to load the SoftDevice .hex file (S140 v6.1.0 found in nRF5_SDK_15.2.0_9412b96\components\softdevice\s140\hex)

    - Andreas

  • Hi AndreasF,

    I am having same issue maybe. I am trying to set up the nrf52840 dongle on IAR using an I-jet for debugging. I have iar version 8.32.1. I am using example project ble_app_blinky from the ble_peripheral examples folder. My preprocessor shows ok I think. It is as follows: 

    BOARD_PCA10059
    CONFIG_GPIO_AS_PINRESET
    FLOAT_ABI_HARD
    NRF52840_XXAA
    NRF_SD_BLE_API_VERSION=6
    S140
    SOFTDEVICE_PRESENT
    SWI_DISABLE0

    I have the latest versions of s140 and the SDK because I have never worked with nordic semi and I have just downloaded everything in these last few days. I have used the P1 to connect the SWDIO, SWCLK, Vref, gnd lines as I usually do when I connect to the I-jet (although I use silabs blue geckos and not nRF52840). I also cut SB2 and soldered SB1.

    I compile, link and build fine. The issue is a warning when I try to download to the dongle. I get this:

    Fri Feb 01, 2019 11:56:52: Download error at 0x00026000: downloading into non-writable memory. 

    and then nothing happens where normally I get put at main(). I can send you the rest of the messages when I do the download but in truth they look fine. This was the only warning during the initialization of the debugging session. 

    My goal is to evaluate using the nRF52840 for a future project where it would be a ble peripheral and that is why I started with the example projects in that folder.

    Can you help? Thanks, Maria

  • Hi .

    Can you please create a new ticket for this question, so that other people who might have the same problem can see it? This ticket is 3 months old.

    Best regards,

    Andreas

Related