This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pynrfjprog not working on Raspberry Pi 4

Hi,

I come from here: https://devzone.nordicsemi.com/f/nordic-q-a/80874/nrfjprog-not-working-on-raspberry-pi-4/336129

But for me the nrfjprog comand works fine:

pi@raspberrypi:~/Desktop/repo/gateway-software/gateway $ nrfjprog -f NRF51 --program ./firm.hex --chiperase
Parsing image file.
Verified OK.

However when I try to upload an hex with the pynrjprog pip module I get the following error:

  File "/home/pi/Desktop/repo/gateway-software/gateway/OTA.py", line 116, in updateBin
    api.open()
  File "/home/pi/Desktop/repo/gateway-software/productionVenv/lib/python3.7/site-packages/pynrfjprog/LowLevel.py", line 177, in open
    raise APIError(result, error_data=self.get_errors())
pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -254 INTERNAL_ERROR.

This is the zone of the code at which it fails:

api = LowLevel.API(LowLevel.DeviceFamily.UNKNOWN)
api.open()

I'm runing pynrfjprog version 10.15.1

  • That makes more sense Slight smile

    It still throws an error:

    Traceback (most recent call last):
      File "/home/pi/Desktop/repo/gateway-software/__init__.py", line 4, in <module>
        main()
      File "/home/pi/Desktop/repo/gateway-software/gateway/mgateway.py", line 32, in main
        OTA.updateBin('','')
      File "/home/pi/Desktop/repo/gateway-software/gateway/OTA.py", line 115, in updateBin
        with HighLevel.API() as api:
      File "/home/pi/Desktop/repo/gateway-software/productionVenv/lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/HighLevel.py", line 70, in __init__
        raise APIError(NrfjprogdllErr.NRFJPROG_SUB_DLL_NOT_FOUND, highlevel_nrfjprog_dll_path, log=self._logger.error)
    pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -150 NRFJPROG_SUB_DLL_NOT_FOUND. /home/pi/Desktop/repo/gateway-software/productionVenv/lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/lib_armhf/libhighlevelnrfjprog.so

    But I think I'm going to try to repeat your steps on a fresh installation.

  • Hi,

    Looks like there may be a problem with the installation script. I noticed now that my /lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/lib_armhf/ directory is empty after the installation.

    Can you try to manually copy the libraries from /opt/nrf-command-line-tools/python/pynrfjprog/lib_armhf?

    E.g.

    $ cp -R /opt/nrf-command-line-tools/python/pynrfjprog/lib_armhf /home/pi/Desktop/repo/gateway-software/productionVenv/lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/lib_armhf

Related