Automating FOTA Flashing for 20 boards of nRF52840 DK using BLE

I am working on automating the FOTA flashing process for 50 PCA10056 (nRF52840 DK) boards using a Python script. The goal is to efficiently flash firmware onto multiple boards simultaneously while ensuring reliability.

I have already tried using nrfutil, but I encounter the same error as described in Case ID: 256309. Additionally, mcumgr has never worked for me.

I would like guidance on:

  1. Best practices for automating FOTA updates on multiple nRF52840 DKs.
  2. Recommended tools and libraries (nrfutil,or other alternatives).
  3. The best command to use for this operation.
  4. Handling potential issues such as connection stability and flashing failures.
  5. Any existing scripts or references that could help streamline this process.
  • Hi,

    I assume you are using the nRF5 SDK as you are using nrfutil for this?

    Are you using nrfutil from here? That is the only currently supported version. And to update it you use "nrfutil self-upgrade" and subsequently "nrfutil pgrade" to install various commands. Note that you must install nrf5sdk-tools in order to perform nRF5 SDK DFU. If this still fails, can you show the the command you use and the log with the error?

    Regarding the specific questions, we do not have any guidance on automated FOTA testing. nrfutil is the only command line tool we provide for nRF5 SDK secure DFU, so it makes sense to call that from your python test scripts.

  • ok I installed nrfutil.  My code snip, 

      cmd = f"nrfutil dfu ble -ic NRF52 -f {firmware_file} -a {mac_address} --timeout 600"
     
                   result = subprocess.run(cmd, shell=True, capture_output=True, text=True)

          if result.returncode == 0:
                print(f"[SUCCESS] FOTA update sent to {mac_address}")
      
    output prints as SUCCESS but the device is not actually flashed. 
    since I am using the nrf52 SDK , I zipped all the bin and hex files from path  src\build\zephyr  and used a firmware_file here.
    Please let me know why the flashing didnt take place. 
  • Hi,

    I am a bit confused here. Y ou write nRF52 SDK, which I would assume point to the nRF5 SDK. But you write src\build\zephyr. If that is the case, you can use mcumgr on a Linux computer do perform DFU over the air. (The nrfutil dfu command is only relevant for the old nRF5 SDK bootloaer)

  • Actually I need to work on windows computer and found that nrfutil was the alternative way to use . Yes its a v2.7.0  nRF5 SDK. Is there a trusted library for mcumgr for windows something  like this page www.nordicsemi.com/.../ 

  • I see. But if you are using the nRF Connect SDK (as it seems), nrfutil is the only solution I am aware of, and that only works with Bluetooth on Linux.

Related