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

Nrf52840 DFU Over thread uses single or dual bank update ??

Hi There,

I just want to confirm which method is being used to perform DFU over thread (Single bank update or dual bank update), and can I perform DFU on Sleepy end device as well.? ( do you have any estimate how much overhead in power consumption will be added if DFU client runs on the Sleepy End Device).

Parents
  • Hi,
    I tried to update the firmware of thread end devices. I have built OTBR on RPi 3B. 
    Also I have commented the code which flash firmware in NCP.
    When I execute the python nordicsemi/__main__.py dfu thread -pkg app_dfu_package.zip -p /dev/ttyACM0 command, below are the logs: 
    pi@raspberrypi:~/sources/pc-nrfutil $ python nordicsemi/__main__.py dfu thread -pkg app_dfu_package.zip -p /dev/ttyACM0
    Address not specified. Using ff03::1 (all Thread nodes)
    Using connectivity board at serial port: /dev/ttyACM0
    2018-09-17 17:12:50,133 Couldn't open /dev/ttyACM0
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/spinel/stream.py", line 57, in __init__
        self.serial = serial.Serial(dev, baudrate)
      File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 240, in __init__
        self.open()
      File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open
        raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
    SerialException: [Errno 16] could not open port /dev/ttyACM0: [Errno 16] Device or resource busy: '/dev/ttyACM0'
    2018-09-17 17:12:50,149 'StreamSerial' object has no attribute 'serial'
    Traceback (most recent call last):
      File "nordicsemi/__main__.py", line 976, in thread
        transport.open()
      File "/home/pi/sources/pc-nrfutil/nordicsemi/thread/tncp.py", line 219, in open
        if (self._config[NCPTransport.CFG_KEY_RESET]) and not self._wpan.cmd_reset():
      File "/usr/local/lib/python2.7/dist-packages/spinel/codec.py", line 1015, in cmd_reset
        self.transact(SPINEL.CMD_RESET, "", SPINEL.HEADER_DEFAULT)
      File "/usr/local/lib/python2.7/dist-packages/spinel/codec.py", line 891, in transact
        self.stream_tx(pkt)
      File "/usr/local/lib/python2.7/dist-packages/spinel/codec.py", line 929, in stream_tx
        self.stream.write(pkt)
      File "/usr/local/lib/python2.7/dist-packages/spinel/stream.py", line 63, in write
        self.serial.write(data)
    AttributeError: 'StreamSerial' object has no attribute 'serial'
    Traceback (most recent call last):
      File "nordicsemi/__main__.py", line 991, in <module>
        cli()
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
        return self.main(*args, **kwargs)
    Exception in thread Thread-2:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
        self.run()
      File "/usr/lib/python2.7/threading.py", line 754, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/usr/local/lib/python2.7/dist-packages/spinel/codec.py", line 935, in stream_rx
        self.rx_pkt = self.hdlc.collect()
      File "/usr/local/lib/python2.7/dist-packages/spinel/hdlc.py", line 79, in collect
        byte = self.stream.read()
      File "/usr/local/lib/python2.7/dist-packages/spinel/stream.py", line 68, in read
        pkt = self.serial.read(size)
    AttributeError: 'StreamSerial' object has no attribute 'serial'
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
     
        rv = self.invoke(ctx)
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "nordicsemi/__main__.py", line 988, in thread
        transport.close()
      File "/home/pi/sources/pc-nrfutil/nordicsemi/thread/tncp.py", line 236, in close
        self._wpan.cmd_reset()
      File "/usr/local/lib/python2.7/dist-packages/spinel/codec.py", line 1015, in cmd_reset
        self.transact(SPINEL.CMD_RESET, "", SPINEL.HEADER_DEFAULT)
      File "/usr/local/lib/python2.7/dist-packages/spinel/codec.py", line 891, in transact
        self.stream_tx(pkt)
      File "/usr/local/lib/python2.7/dist-packages/spinel/codec.py", line 929, in stream_tx
        self.stream.write(pkt)
      File "/usr/local/lib/python2.7/dist-packages/spinel/stream.py", line 63, in write
        self.serial.write(data)
    AttributeError: 'StreamSerial' object has no attribute 'serial'
    As the wpantund service is using the serial port /dev/ttyACM0, I stop the wpantund service manually. Then I executed the python nordicsemi/__main__.py dfu thread -pkg app_dfu_package.zip -p /dev/ttyACM0 command again, below are the logs:
    pi@raspberrypi:~/sources/pc-nrfutil $ python nordicsemi/__main__.py dfu thread -pkg app_dfu_package.zip -p /dev/ttyACM0
    Address not specified. Using ff03::1 (all Thread nodes)
    Using connectivity board at serial port: /dev/ttyACM0
    2018-09-17 17:19:32,988 Failed to set property PROP_NET_STACK_UP
    Traceback (most recent call last):
      File "nordicsemi/__main__.py", line 976, in thread
        transport.open()
      File "/home/pi/sources/pc-nrfutil/nordicsemi/thread/tncp.py", line 223, in open
        if (not self._attach_to_network()):
      File "/home/pi/sources/pc-nrfutil/nordicsemi/thread/tncp.py", line 104, in _attach_to_network
        self._set_property(*props)
      File "/home/pi/sources/pc-nrfutil/nordicsemi/thread/tncp.py", line 88, in _set_property
        raise Exception("Failed to set property {}".format(self.__class__._propid_to_str(propid)))
    Exception: Failed to set property PROP_NET_STACK_UP
  • It seems like the RPi can't open the serial port. 

    Can you try to add -f to your nrfutil command? That is:

    python nordicsemi/__main__.py dfu thread -f -pkg app_dfu_package.zip -p /dev/ttyACM0

    Best regards,

    Edvin

  • currently I am stuck in performing dfu over thread form PC itself. I had successfully performed the DFUfew months ago..but I am not able to reproduce it. I have created new issue https://devzone.nordicsemi.com/support/214105

    Any help will be appreciated.. 

Reply Children
No Data
Related