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

Programming nRF9160 modem firmware with a stand-alone SEGGER J-Link

I have a PCB containing an nRF9160 using a SEGGER J-Link. I am able to update the application firmware at will using a variety of tools but if I use nRF Connect v3.2.0 to run Programmer v1.2.3 and select the J-Link device, the software hangs.

As far as I am aware, nRF Connect / Programmer is the only supported way to update the modem firmware, so how can I get new modem firmware on my PCB?

I have tried using an nRF9160-DK but I was unable to get the board to detect the external target.

I did also try nrf9160_mdm_dfu but that stopped working with the 1.0.0 release, giving a the error:

ERROR: Missing file: firmware.update.image.hex

Kind regards,

Jonathan

  • How are you connecting the PCA10090 to the custom device?

    Our custom boards have been able to update the modem firmware using the nRF Programmer App and the DK.

  • As MJD093 points out, it could be an issue with how you have connected the custom device to the programmer.

    As far as I am aware, nRF Connect / Programmer is the only supported way to update the modem firmware

    It's also possible to use a python script with pynrfjprog to flash the modem. 

    You might need to run pip3 install pynrfjprog -U before testing this.

    Simple example:

    #!/usr/bin/env python3
    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    
    
    from pynrfjprog import HighLevel
    api = HighLevel.API()
    api.open()
    snr = api.get_connected_probes()
    for s in snr:
        probe = HighLevel.IPCDFUProbe(api, s, HighLevel.CoProcessor.CP_MODEM)
        probe.program("mfw_nrf9160_1.0.1.zip")
        probe.verify("mfw_nrf9160_1.0.1.zip")
        print("Done")
     
    api.close()

    With threading[experimental]

    #!/usr/bin/env python3
    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    
    from pynrfjprog import HighLevel
    import threading
     
    class myThread (threading.Thread):
       def __init__(self, threadID, name, counter):
          threading.Thread.__init__(self)
          self.threadID = threadID
          self.name = name
          self.counter = counter
       def run(self):
          print ("Starting " + self.name)
          update_fw(self.name)
          print ("Exiting " + self.name)
     
    def update_fw(snr):
        print("updating FW in {}".format(snr))
        probe = HighLevel.IPCDFUProbe(api, int(snr), HighLevel.CoProcessor.CP_MODEM)
        print("{} probe initialized". format(snr))
        probe.program("mfw_nrf9160_1.0.1.zip")
        print("{} programmed".format(snr))
        probe.verify("mfw_nrf9160_1.0.1.zip")
        print("{} verified".format(snr))
     
    # Create new threads
    api = HighLevel.API()
    api.open()
    devices = api.get_connected_probes()
    threads = list()
    for idx, device in enumerate(devices):
        threads.append(myThread(idx, device, idx))
     
    # Start new Threads
    for thread in threads:
        thread.start()
     
    print("waiting for all threads to complete")
    #wait for threads to finish
    for t in threads:
        t.join()
     
    api.close()
    print("Exiting Main Thread")

  • > How are you connecting the PCA10090 to the custom device?

    With a custom cable assembly through to P15 on the PCA10090. Now that you have confirmed that this set-up should work, I will look again at that cable assembly. Thanks!

  • Which pins are you connecting? Is a voltage being supplied to VTG to detect a connected device on P15? If you device doesn't output a voltage back to the DK, then you can bridge VDD and VTG on P15 to fool the Interface MCU into thinking there is a device connected, this will allow you to direct SWD through P15.

  • All sorted. I had a bad ground between the programmer and the custom PCB. I can confirm that nRF Connect v3.2.0 / Programmer v1.2.3 work fine with a SEGGER J-Link Base for upgrading modem firmware.

Related