This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Uploading application + external app firmwares in a single shot

Hello,

I have a Nordic connected to a STM32. The DFU procedure on the Nordic works fine and I am able to upload and run a new firmware in buttonless mode. The Nordic also works as server in the ST fw update procedure, the ST firmware being transferred to the Nordic in "external app" mode and filling the flash space above the application. Looking at Nordic documentation it seems that this is in principle a 2-step process (i.e. the application and external-app firmware should be updated in two steps). I am wondering if there is an easy way to update the two fws in a single access, For example by creating a unique .hex where the second fw always starts at a predefined address (because the Nordic must know where to start when transferring to the ST) and the space between application and external app is empty. Not sure that some internal checks on the firmware will prevent me from being able to do this though. Also I believe that I should resort to single bank update (instead of dual) for space reasons.

Thanks!

Regards,

Stefano

  • Hi Stefano

    There is nothing stopping you from putting more data after the application in the application image, be it another application for your external MCU, or anything else. Then you can update both applications through the normal application DFU process, and once your application boots you can run some code in the application to write the second image into the external MCU. 

    The only thing you have to be aware is that if you have CRC checking enabled in the bootloader, and you later remove the secondary image from flash, the CRC check will fail and your application will not boot. In other words you will need to disable the CRC checking if you are planning to alter or move the part of flash used for the secondary image. 

    Whether or not to use single bank or dual bank depends on the size of the two images, but I agree it is probably a better idea to use single bank and leave some room for future increases in the application sizes, rather than try to squeeze everything into a dual bank update. 

    The only drawback of using single bank is that you lose the ability to revert to an old application, and if something fails during the DFU process you need to repeat the process until it is successful. You don't have the option of aborting the DFU process half way and restore the old application. 

    Best regards
    Torbjørn

  • Thank you Torbjorn, I managed to do as you said and found no drawbacks to the process. We should also be able to use dual bank update as after optimization the cumulative image fits well in half the 864k available space (and there is room for future improvements).

    Regards,

    Stefano

  • Hi Stefano

    It's great to hear that you were able to get it working. I will consider this case closed then Slight smile

    Best regards
    Torbjørn

Related