DFU update module generator script bug

@mirzak and @TheYoctoJester is am facing an additional issue as well . While executing the command to create a mender artifact using the dfu-artifact-gen tool I am getting the following error:


It says that the ./dfu-artifact-gen: 47: 6: not found
I have downloaded it in my Downloads folder. Also I have the mender-artifact tool installed as per the given steps at : Downloads | Mender documentation

What is going off track here?

@Utsav_Shah standard shell syntax applied. Either put everything in one command, or use export for variables. You can check the content of a variable by echoing it or looking at the environment. Examples:

env
ARTIFACT_NAME="myartifact" echo "my artifact name is $ARTIFACT_NAME"

Greetz,
Josef

@TheYoctoJester I had tried to replace the name directly in the command but still the same issue occurs. I tried giving the names with and without quotes but that does not solve it as well.

@Utsav_Shah interesting, this is being caused by a hidden bashism. Change the shebang line in dfu-artifact-gen to

#!/bin/bash

to invoke it explicitly, then it should work.

Greetz,
Josef

@TheYoctoJester changing the shell to bash solved the problem of generating the mender artifact.Thank you!

Now I face another issue: The deployment from the mender was successful and the firmware was also uploaded on to the NRF board that I have connected with my main gateway system. However, upon successful completion of the firmware upload the board does not switch to the updated firmware. AS an example I had uploaded a blink program that toggles an LED. To run this program I have to completely restart my entire system and only then the programs switch and my blink program starts running. How do I make sure that whenever the mender deployment of the firmware is done, it automatically starts executing without having to restart my system? Do I need to make any changes or mention any parameters while making the artifact? Or some changes in the dfu-util is required?

@Utsav_Shah the Update Module has to be installed on the device. This is explained in the tutorial here: Device Firmware Update (DFU).

An Update Module is the client side handling for such artifacts. The upstream source is:

More details on Update Modules:
https://docs.mender.io/artifact-creation/create-a-custom-update-module

Greetz,
Josef

@TheYoctoJester the update module concept is now clear! Thanks. Currently I am facing an issue to automatically start the firmware on the NRF board once the mender articat has been successfully deployed. I have to restart the whole system in order for the uploaded firmware to run on the NRF5340. How do I do this automatically without a restart?

@Utsav_Shah to add operations concerning DFU, adapt the Update Module to your needs - it is just a script.

Greetz,
Josef

A post was merged into an existing topic: Enabling multiple firmware/application updates on NRF5340 DK board using DFU feature