pynrfjprog cannot update modem of nrf9160

Hi Nordic

   I had used pynrfjprog to update modem of nrf9160 for a long time. Everything ran well and smoothly.

But, yesterday, I found it failed to update modem. I have no idea what I happened. The python script was same. The hardware was same.

What I did between was to upgrade pynrfjprog and nrf command line. 

Please help me. Thanks.

1. my software

python: v3.8

pynrfjprog: v10.24.0

nrf command line: lates 10.24.0. 

2.

LOG after run "python update_modem.py .\mfw_nrf9160_1.3.4.zip". It logged NOT_AVAILABLE_BECAUSE_PROTECTION

3. update_modem.py

#!/usr/bin/env python3
#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic

import argparse
from pynrfjprog import HighLevel

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("modem_pkg", default=None, help="Path to nrf9160 modem firmware zip folder")
    args = parser.parse_args()
    print("Modem firmware upgrade")
    api = HighLevel.API()
    api.open()
    snr = api.get_connected_probes()
    for s in snr:
      print("snr:%s",s)
      probe = HighLevel.IPCDFUProbe(api, s, HighLevel.CoProcessor.CP_MODEM)
      print("programming...")
      probe.program(args.modem_pkg)
      print("verifying...")
      probe.verify(args.modem_pkg)
      print("Done")
    api.close()

if __name__ == '__main__':
    main()

Parents Reply
  • Hi Jeff,

    Jeffery said:

    1.

    Since this issue found after upgrading tools, I forgot the previous versions both.

    I also tried to downgrade pynrfjprog and nrf command line. However, it was no use.

    It still failed to update modem at same reason. It was weird.

    Knowing working versions of the tools could potentially help in finding out the cause of your issue. Which versions of the tools did you try downgrading to?

    Jeffery said:
    2. Could you try my "up_modem.py" at your side?

    I have tested your script and managed to reproduce the error. 

    EDIT: I have tested using CP_APPLICATION instead of CP_MODEM in your update_modem.py script and I did not see the error anymore. Can you test yourself?

    Best regards,
    Dejan

Children
Related