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

NRF52840 Softdevice programming

I would like to program my NRF52840 device using the Keil Ulink2/pro JTAG device.  

I have been able to do a full chip erase using the Keil Ulink 2 device, but when I attempt to program it fails 

Load "..\\SoftDevice\\s140_nrf52_6.0.0_softdevice.hex"
Full Chip Erase Done.
Programming Failed!
Error: Flash Download failed - "Cortex-M4"

I found some references in the Q&A for setting up the nrf tools for a slightly different device to program the UICR registers, but I haven't been able to get that to work with this setup.  It seems to be aware of the UICR registers so I'm not sure if that is the hindrance now or not.

Any guidance would be great.  We do have a Segger Jlink at another office that I am getting sent to me, but in the meantime if I can get this to work with my existing toolset, would be preferred.

Thanks

  • I receive the following message.  But I have a Ulink connected to the device.  The Ulink detects the target and appears to be capable of erasing the part, but not the UICR registers on the device.

    nrfjprog --eraseall
    ERROR: There is no debugger connected to the PC.

    How do I determine the SDK version?

    s140_nrf52_6.0.0_API?

    I should have a JLink by the end of the day, but I would still like to resolve how to do this with a ULink if possible.

    Thanks

  • cyberzl1 said:
    nrfjprog --eraseall
    ERROR: There is no debugger connected to the PC.

     Thank you. This will help to find a solution with our nRF5x Command Line Tools team. 

    cyberzl1 said:
    How do I determine the SDK version?

    I assumed that you have an SDK that you are working with? If not,  what are you trying to program along with the SoftDevice? This is to replicate the issue.  

    cyberzl1 said:
    I would still like to resolve how to do this with a ULink if possible.

    Yes, we will find a solution to this.

    Kind regards,

    Øyvind

  • In regards to the SDK question, does the listed API help to answer that question?

    If not, as to what I am trying to program for an application after SoftDevice, our team (at another office) has developed an application that I am trying to help with testing on.  Their office has JLink devices, where I only have ULink at my disposal.  They did have a spare JLink that has been sent over but is still in our mail system at this time.

    This hex could be shared if that is needed, but not on this public forum.

  • In regards to the SDK question, does the listed API help to answer that question?

    No, not that I can see. But it does not matter. I have asked our team to test with a Ulink and see if there are any solutions. nRFJProg does only support Segger.

    This hex could be shared if that is needed, but not on this public forum.

    No need yet.

    I'll keep you posted.

    Kind regards,
    Øyvind

  • Hello again, 

    A colleague from our tools team tested Ulink in Keil and had no trouble with usage. 

    His solution was to add a preload.ini file under Configure Flash Menu Command. (Project --> Options for Target <Device> --> Utilities). This .ini file had the following:

    Load "<your path>\\s140_nrf52_6.0.0_softdevice.hex"

    Under programming algorithm, you must also add nRF52xxx SoftDevice Erase. This allows you to program or update the softdevice. 

    Please try this solution on your computer, and let me know how it went.

    Kind regards,
    Øyvind

Related