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

nrf9160 modem firmware flashing using pynrfjprog

Hi,

We were trying to flash the nrf modem firmware using the 'pynrfjprog'.

When only one nrf9160dk is connected , the flashing is success and no error.

But when multiple nrf9160dk is connected, an error comes as shown below. But seems the flashing of modem to the each was successfull. 

Done
Done
Traceback (most recent call last):
File "E:\git\imSafeB\LTE_Bridge\Tools\nrf9160_production_programming\pynrfjprog_Simple_Modem_Updater.py", line 18, in <module>
api.close()
File "C:\Users\W!s!l!ca\AppData\Local\Programs\Python\Python38\lib\site-packages\pynrfjprog\HighLevel.py", line 113, in close
self.lib.NRFJPROG_dll_close()
OSError: exception: privileged instruction

When tried one more time with 2 nrf9160DK's ,

Done
Done
Traceback (most recent call last):
File "E:\git\imSafeB\LTE_Bridge\Tools\nrf9160_production_programming\pynrfjprog_Simple_Modem_Updater.py", line 18, in <module>
api.close()
File "C:\Users\W!s!l!ca\AppData\Local\Programs\Python\Python38\lib\site-packages\pynrfjprog\HighLevel.py", line 113, in close
self.lib.NRFJPROG_dll_close()
OSError: exception: access violation reading 0x0000000000000000

Modem firmware using : 'mfw_nrf9160_1.2.0.zip'

pynrfjprog version         : pynrfjprog-10.9.0

Programmer using        : nrf9160DK

The python file used to flash the modem image is attached. ( the file we got from this link : https://devzone.nordicsemi.com/f/nordic-q-a/53208/updating-nrf9160-modem-firmware-through-the-command-line )

nrf9160_production_programming.zip

Thanks and regards,

Aswin

Parents Reply Children
  • Hello again, 

    Ok, the issue is a small bug in the script itself. The probe itself is not closed correctly when done, which means that you should add probe.close() right before print("Done"). See attached script:

    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.2.0.zip")
        probe.verify("mfw_nrf9160_1.2.0.zip")
        probe.close()
        print("Done")
     
    api.close()

    This worked for me at least. Let me know how it works for you.

    Kind regards,
    Øyvind

Related