How to prevent FOTA from starting if battery is low?

Hi,

I have a battery powered design that uses the nRF9160.  I understand FOTA will start automatically at bootup if the firmware version number is different.  But this can be dangerous if the battery is running low.  I can read the battery voltage first at bootup.  But how do I stop FOTA from starting if I know it is not a good time to do so?  Thank you.

Floyd

Parents
  • Hi Floyd,

    Are you referring to the image swapping/FW activation in the bootloader, or are you asking about a way to prevent the app from retrieving the update from the DFU server when the battery is low? If it's the latter, could you please specify which sample or DFU library your implementation is based on?

    The bootloader does not have any hooks or similar mechanisms to skip the activation process. It will automatically swap to the new firmware image if it detects a newer version in the secondary slot upon booting. However, this process is designed to be fail-safe. Therefore, even if there is a sudden power loss during the swap, it should be able to resume and continue the process when powered up again.

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/design.html#resumed-swaps 

    Thanks,

    Vidar

  • Hi Vidar,

    Thank you for your reply.  Yes, I am referring to the application from the DFU server.  I am building my application based on the AWS_IOT example.  To my understanding, there is a APP_VERSION setting in the Kconfig file.  If the default value is differed, FOTA will begin automatically.  Should I be worried about the battery dies in the middle of a download?  Thanks again.

    Floyd 

Reply
  • Hi Vidar,

    Thank you for your reply.  Yes, I am referring to the application from the DFU server.  I am building my application based on the AWS_IOT example.  To my understanding, there is a APP_VERSION setting in the Kconfig file.  If the default value is differed, FOTA will begin automatically.  Should I be worried about the battery dies in the middle of a download?  Thanks again.

    Floyd 

Children
Related