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

nrtutil error in __set_prn on RaspberryPi OS and nRF52840 Dongle

I try to DFU on RaspberryPi OS by usb-serial. I put nRF52840 dongle on USB port of RPI4. And press reset button of the dongle.

I got error on nrftuil.

$ nrfutil dfu usb-serial -pkg ~/nordic/nRF5_SDK_17.1.0_ddde560/examples/dfu/secure_dfu_test_images/ble/nrf52840/hrs_application_s140.zip -p /dev/ttyACM0 -b 115200

Traceback (most recent call last):

  File "/home/pi/.local/bin/nrfutil", line 8, in <module>

    sys.exit(cli())

  File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 829, in __call__

    return self.main(*args, **kwargs)

  File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 782, in main

    rv = self.invoke(ctx)

  File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke

    return ctx.invoke(self.callback, **ctx.params)

  File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke

    return callback(*args, **kwargs)

  File "/home/pi/.local/lib/python3.7/site-packages/nordicsemi/__main__.py", line 1001, in usb_serial

    timeout)

  File "/home/pi/.local/lib/python3.7/site-packages/nordicsemi/__main__.py", line 956, in do_serial

    dfu.dfu_send_images()

  File "/home/pi/.local/lib/python3.7/site-packages/nordicsemi/dfu/dfu.py", line 129, in dfu_send_images

    self._dfu_send_image(self.manifest.application)

  File "/home/pi/.local/lib/python3.7/site-packages/nordicsemi/dfu/dfu.py", line 90, in _dfu_send_image

    self.dfu_transport.open()

  File "/home/pi/.local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 216, in open

    self.__set_prn()

  File "/home/pi/.local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 359, in __set_prn

    + map(ord, struct.pack('<H', self.prn)))

TypeError: can only concatenate list (not "map") to list

Parents
  • Hello,

    nrfutil doesn't work on Raspberry Pi. Don't remember the details, but I believe it is because of some requirements not being supported for the Raspberry Pi processor. I believe you should see some warnings when you try to install it. 

    However, we have an unofficial build that you can test if you want to. It requires Python 3.7, but I see that this is what you are currently using. If you at some point update Python to another version, then this will probably not work anymore. 

    pc_ble_driver_py-0.16.2-cp37-cp37m-linux_armv7l.zip

    I have not tested it, but feel free to give it a go. 

    Best regards,

    Edvin

  • By installing pip, v5.2 is installed. I get v6.1.3 from git and replaced. Then nrfutil works on RPI4.

    I run these command for updating nordicsemi python lib.

    $ cd ~

    $ git clone https://github.com/NordicSemiconductor/pc-nrfutil.git

    $ cd /home/pi/.local/lib/python3.7/site-packages/

    $ mv nordicsemi nordicsemi.5.2

    $ cd ~/pc-nrfutil

    $ cp -r nordicsemi /home/pi/.local/lib/python3.7/site-packages/.

Reply Children
No Data
Related