OTA update in mesh

I am working on OTA update .

Right now i am working simple 

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v5.0.0%2Fmd_doc_user_guide_modules_dfu_configuring_performing.html

using this link to configure DFU 

I know this is simple one but i think i am just messing up something 

Traceback (most recent call last):
  File "C:\Python27\Scripts\nrfutilmesh-script.py", line 11, in <module>
    load_entry_point('nrfutil==0.3.0.0', 'console_scripts', 'nrfutil')()
  File "C:\Python27\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python27\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "C:\Python27\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python27\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python27\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python27\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\python27\lib\site-packages\nrfutil-0.3.0.0-py2.7.egg\nordicsemi\__main__.py", line 276, in genpkg
    package.generate_package(zipfile_path)
  File "c:\python27\lib\site-packages\nrfutil-0.3.0.0-py2.7.egg\nordicsemi\dfu\package.py", line 212, in generate_package
    Package.normalize_firmware_to_bin(work_directory, firmware[FirmwareKeys.FIRMWARE_FILENAME])
  File "c:\python27\lib\site-packages\nrfutil-0.3.0.0-py2.7.egg\nordicsemi\dfu\package.py", line 366, in normalize_firmware_to_bin
    temp.tobinfile(new_filepath)
  File "c:\python27\lib\site-packages\nrfutil-0.3.0.0-py2.7.egg\nordicsemi\dfu\nrfhex.py", line 162, in tobinfile
    super(nRFHex, self).tobinfile(fobj, start=start_address, size=size)
  File "c:\python27\lib\site-packages\nrfutil-0.3.0.0-py2.7.egg\nordicsemi\dfu\intelhex\__init__.py", line 401, in tobinfile
    fobj.write(self._tobinstr_really(start, end, pad, size))
  File "c:\python27\lib\site-packages\nrfutil-0.3.0.0-py2.7.egg\nordicsemi\dfu\intelhex\__init__.py", line 373, in _tobinstr_really
    return asstr(self._tobinarray_really(start, end, pad, size).tostring())
  File "c:\python27\lib\site-packages\nrfutil-0.3.0.0-py2.7.egg\nordicsemi\dfu\intelhex\__init__.py", line 342, in _tobinarray_really
    raise ValueError("tobinarray: wrong value for size")
ValueError: tobinarray: wrong value for size

So i have tried again and again but failed now i am getting this error .

Please help me to get out of this .

At first i was trying to do with latest version of nrfutil but when i try to run the package it was giving me error .

  • Hello 

    I want to clear one thing i have successfully done DFU with development kit but i want to do this with nrf52840 eval kit waveshare but when i try to do on that its giving me same error which i have showed you . Can you please tell me steps to follow to do DFU on waveshare eval kit of NRF52840 . I am attaching some pictures to show you my board . And tell me one more thing when we are trying to do on eval board so we have to program from jlink or USB board . 

  • Hi, 

    Mohsin khan said:
    Can you please tell me steps to follow to do DFU on waveshare eval kit of NRF52840 .

    The waveshare eval kit of NRF52840 is not developed by Nordic, and I don't have their board to reproduce it. The RTT log from the DFU firmware might help provide clues. Please create a new support case. The latest issue is away from the original scope. 

    Mohsin khan said:
    tell me one more thing when we are trying to do on eval board so we have to program from jlink or USB board . 

    Not sure the waveshare eval kit has the onboard debugger or not, but I guess not. On the NRF52840 Eval Kit User Manual page.6, there is a 4PIN SWD debugging interface: for connecting ARM Debugger to program/debug. Seems you need an ARM Debugger (Jlink) to program. 

    -Amanda

  • It takes too much time to respond to new questions i want to solve problem immediately .

    The RTT log from the DFU firmware might help provide clues

    How to check RTT log from DFU firmware .

  • You would need to connect with Jlink and get RTT log via Jlink Viewer. Also, see my previous reply. 

    Please try testing without using any key. Just to simplify the testing.
    Please make sure COM7 is the correct comport and in your code NRF_MESH_SERIAL_ENABLE is set to 1. 
    Please print out RTT log from the DFU firmware, and check if mesh_evt_handler() is called for any DFU event.  

    -Amanda

  • These are logs from my cmd and rtt 

    D:\nrf mesh>nrfjprog --program s140_nrf52_7.2.0_softdevice.hex --chiperase
    Parsing image file.
    Applying system reset.
    Verified OK.
    
    D:\nrf mesh>nrfjprog --program mesh_bootloader_serial_gccarmemb_nrf52840_xxAA.hex
    Parsing image file.
    Applying system reset.
    Verified OK.
    
    D:\nrf mesh>nrfjprog --program device_page_nrf52840_xxAA_s140_7.2.0.hex
    Parsing image file.
    Applying system reset.
    Verified OK.
    
    D:\nrf mesh>nrfjprog --program dfu_nrf52840_xxAA_s140_7.2.0.hex
    Parsing image file.
    Applying system reset.
    Verified OK.
    
    D:\nrf mesh>nrfjprog -r
    Applying system reset.
    Run.
    
    D:\nrf mesh>nrfutil --verbose dfu serial -pkg dfu_test.zip -p COM6 -b 115200 -fc --mesh
    Upgrading target on COM6 with DFU package D:\nrf mesh\dfu_test.zip. Flow control is enabled.
    Flushing com-port...
    Opened com-port
    Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 130832
    Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing.
    1: PC -> target: 0502aabbccdd
    2: PC -> target: 0502aabbccdd
    3: PC -> target: 0502aabbccdd
    4: PC -> target: 0502aabbccdd
    5: PC -> target: 0502aabbccdd
    6: PC -> target: 0502aabbccdd
    7: PC -> target: 0502aabbccdd
    8: PC -> target: 0502aabbccdd
    9: PC -> target: 0502aabbccdd
    10: PC -> target: 0502aabbccdd
    
    
    Failed to upgrade target. Error is: Failed to establish connection
    
    Possible causes:
    - bootloader, SoftDevice or application on target does not match the requirements in the DFU package.
    - baud rate or flow control is not the same as in the target bootloader.
    - target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.
    - if the error is ERROR_BUSY at the beginning of the DFU process,increase the value of PAGE_ERASE_TIME_MAX by few milliseconds.
    Closing serial port...

    ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 ....................................................................................................................................................
    ###RTT Client: Connected.
    
    SEGGER J-Link V7.58c - Real time terminal output
    SEGGER J-Link ARM V9.7, SN=59768885
    Process: jlinkarm_nrf_worker.exe
    
    ###RTT Client: Connection lost. Going to reconnect.
    ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 ...............................................
    ###RTT Client: Connected.
    
    SEGGER J-Link V7.58c - Real time terminal output
    SEGGER J-Link ARM V9.7, SN=59768885
    Process: jlinkarm_nrf_worker.exe
    
    ###RTT Client: Connection lost. Going to reconnect.
    ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 ................................
    ###RTT Client: Connected.
    
    SEGGER J-Link V7.58c - Real time terminal output
    SEGGER J-Link ARM V9.7, SN=59768885
    Process: jlinkarm_nrf_worker.exe
    
    ###RTT Client: Connection lost. Going to reconnect.
    ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 ..............................
    ###RTT Client: Connected.
    
    SEGGER J-Link V7.58c - Real time terminal output
    SEGGER J-Link ARM V9.7, SN=59768885
    Process: jlinkarm_nrf_worker.exe
    
    ###RTT Client: Connection lost. Going to reconnect.
    ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 ....................
    ###RTT Client: Connected.
    
    SEGGER J-Link V7.58c - Real time terminal output
    SEGGER J-Link ARM V9.7, SN=59768885
    Process: jlinkarm_nrf_worker.exe
    
    ###RTT Client: Connection lost. Going to reconnect.
    ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 .............................................................................................................................................................................................................................................

Related