pynrfprog v19.0 modem update

Hi,

As part of our end of line test for our product we are updating the modem to a more recent version. We are using the pynrfprog library for this.

Previously we were running v17.3 of the pynrfprog and noticed an issue where repetive programming sessions would cause the following error.

NrfApplication.py", line 165, in flash_application
api.write(segment.address, segment.data, True)
File "C:\Users\Spike\AppData\Local\Programs\Python\Python311\Lib\site-packages\pynrfjprog\LowLevel.py", line 879, in write
raise APIError(result, error_data=self.get_errors())
pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -93 NOT_AVAILABLE_BECAUSE_TRUST_ZONE.

This would occur every other time (So it works correctly the first time, then would fail the next, then would work again etc.)

After updating to v19.0 it seemed to have fixed this issue but in the new software the modem updates no longer seem to work. We are using the following code: 

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(".\provisioning-python-script\mfw_nrf9160_1.3.3.zip")
    probe.verify(".\provisioning-python-script\mfw_nrf9160_1.3.3.zip")
    probe.close()
    print("Done")
api.close()

This results in the following error:

probe.program(".\provisioning-python-script\mfw_nrf9160_1.3.3.zip")
File "C:\Users\Spike\AppData\Local\Programs\Python\Python311\Lib\site-packages\pynrfjprog\HighLevel.py", line 388, in program
raise APIError(result, error_data=self.get_errors(), log=self._logger.error)
pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -220 TIME_OUT.
[Probes.51025440] [SeggerBackend] JLinkARM.dll reported "-261", "Could not find supported CPU.".
extra: [Probes.51025440] [SeggerBackend] JLinkARM.dll reported "-261", "Could not find supported CPU.".
extra: [Probes.51025440] [SeggerBackend] JLinkARM.dll reported "-261", "Could not find supported CPU.".
extra: [Probes.51025440] [SeggerBackend] JLinkARM.dll reported "-261", "Could not find supported CPU.".
extra: [Probes.51025440] [SeggerBackend] JLinkARM.dll reported "-261", "Could not find supported CPU.".
extra: [Probes.51025440] [DebugProbe] Failed while programming device.
extra: [HighLevel] Failed programming the device.
extra: [Probes.51025440] [nRF91] Timeout, operation used more than 10 sec
extra: [Probes.51025440] [nRF91] Failed in wait for ack
extra: [Probes.51025440] [nRF91] Failed while waiting for program operation to finish.
extra: [Probes.51025440] [nRF91] Failed to upload file
extra: [Probes.51025440] [nRF91] Failed while programming package .\provisioning-python-script\mfw_nrf9160_1.3.3.zip.

The exact same script works fine on version 17.3.

Is there anything changed in the latest version which could cause this problem?

Kind regards,

Sebastiaan

Parents
  • Hi Sebastiann,

    Please install nRF Command Line Tools - Downloads - nordicsemi.com so JLink could also be updated.

    I just with python 3.8.10. Everything looks fine.

    PS C:\NCS\nrf9160_modem_update_script> pip uninstall pynrfjprog
    Found existing installation: pynrfjprog 10.17.3
    Uninstalling pynrfjprog-10.17.3:
      Would remove:
        c:\users\chs1\appdata\local\programs\python\python38\lib\site-packages\pynrfjprog-10.17.3.dist-info\*
        c:\users\chs1\appdata\local\programs\python\python38\lib\site-packages\pynrfjprog\*
    Proceed (y/n)? y
      Successfully uninstalled pynrfjprog-10.17.3
    PS C:\NCS\nrf9160_modem_update_script> pip install pynrfjprog
    Collecting pynrfjprog
      Using cached pynrfjprog-10.19.0.tar.gz (45.3 MB)
    Requirement already satisfied: future in c:\users\chs1\appdata\local\programs\python\python38\lib\site-packages (from pynrfjprog) (0.18.2)
    Requirement already satisfied: tomli-w in c:\users\chs1\appdata\roaming\python\python38\site-packages (from pynrfjprog) (1.0.0)
    Using legacy 'setup.py install' for pynrfjprog, since package 'wheel' is not installed.
    Installing collected packages: pynrfjprog
        Running setup.py install for pynrfjprog ... done
    Successfully installed pynrfjprog-10.19.0
    WARNING: You are using pip version 21.1.3; however, version 23.0 is available.
    You should consider upgrading via the 'c:\users\chs1\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip' command.
    PS C:\NCS\nrf9160_modem_update_script> python .\nrf9160_modem_update.py
    snr:%s 960061675
    programming...
    verifying...
    Done
    PS C:\NCS\nrf9160_modem_update_script> python --version
    Python 3.8.10
    PS C:\NCS\nrf9160_modem_update_script>

    #!/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:
        print("snr:%s",s)
        probe = HighLevel.IPCDFUProbe(api, s, HighLevel.CoProcessor.CP_MODEM)
        print("programming...")
        probe.program("mfw_nrf9160_1.3.4.zip")
        print("verifying...")
        probe.verify("mfw_nrf9160_1.3.4.zip")
        print("Done")
     
    api.close()

    Best regards,

    Charlie

Reply
  • Hi Sebastiann,

    Please install nRF Command Line Tools - Downloads - nordicsemi.com so JLink could also be updated.

    I just with python 3.8.10. Everything looks fine.

    PS C:\NCS\nrf9160_modem_update_script> pip uninstall pynrfjprog
    Found existing installation: pynrfjprog 10.17.3
    Uninstalling pynrfjprog-10.17.3:
      Would remove:
        c:\users\chs1\appdata\local\programs\python\python38\lib\site-packages\pynrfjprog-10.17.3.dist-info\*
        c:\users\chs1\appdata\local\programs\python\python38\lib\site-packages\pynrfjprog\*
    Proceed (y/n)? y
      Successfully uninstalled pynrfjprog-10.17.3
    PS C:\NCS\nrf9160_modem_update_script> pip install pynrfjprog
    Collecting pynrfjprog
      Using cached pynrfjprog-10.19.0.tar.gz (45.3 MB)
    Requirement already satisfied: future in c:\users\chs1\appdata\local\programs\python\python38\lib\site-packages (from pynrfjprog) (0.18.2)
    Requirement already satisfied: tomli-w in c:\users\chs1\appdata\roaming\python\python38\site-packages (from pynrfjprog) (1.0.0)
    Using legacy 'setup.py install' for pynrfjprog, since package 'wheel' is not installed.
    Installing collected packages: pynrfjprog
        Running setup.py install for pynrfjprog ... done
    Successfully installed pynrfjprog-10.19.0
    WARNING: You are using pip version 21.1.3; however, version 23.0 is available.
    You should consider upgrading via the 'c:\users\chs1\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip' command.
    PS C:\NCS\nrf9160_modem_update_script> python .\nrf9160_modem_update.py
    snr:%s 960061675
    programming...
    verifying...
    Done
    PS C:\NCS\nrf9160_modem_update_script> python --version
    Python 3.8.10
    PS C:\NCS\nrf9160_modem_update_script>

    #!/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:
        print("snr:%s",s)
        probe = HighLevel.IPCDFUProbe(api, s, HighLevel.CoProcessor.CP_MODEM)
        print("programming...")
        probe.program("mfw_nrf9160_1.3.4.zip")
        print("verifying...")
        probe.verify("mfw_nrf9160_1.3.4.zip")
        print("Done")
     
    api.close()

    Best regards,

    Charlie

Children
No Data
Related