MCUBoot: How to execute code only before fw upgrade starts

Hi,

i am using MCUBOOT + nrF5340 and i am using the nRF Connect Device Manager to upload firmware and perform the upgrade.

I would like to know if it is possible to execute code before the upgrade of the firmware starts. In the specific case, i would like have a led blinking ONLY when the firmware upgrade is on going (that is, a new image has been detected, validated and being then swapped with the actual one).

I know that there is the SYS_INIT(_init_fn, _level, _prio).

Are there other options `?

Thanks in advance !

Kind regards

Riccardo Gaiati

Parents
  • i would like have a led blinking ONLY when the firmware upgrade is on going (that is, a new image has been detected, validated and being then swapped with the actual one)

    Hello,

    I believe there exists some events that you can hook onto from the application. However,  during the actual swap, that would not be possible, as the applications are actually being moved, so your appliication will not be running to control your LEDs.

    So would these DFU events be something that you could use, even though you can't use them during the swap?

    I know that there is the SYS_INIT(_init_fn, _level, _prio).

    What is this used for, exactly?

    Best regards,

    Edvin

  • Hi Edvin,

    Thanks so much for your feedback and apologize for my late reply.

    SYS_INIT(_init_fn, _level, _prio). is explained here.

Reply Children
No Data
Related