This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Creating Bootloader with FreeRTOS

Hi,

We have 2 projects in pre-production stage that use nRF52840. We are also using FreeRTOS for both projects.

Now we need to create an OTA bootloader for both. There is a standard bootloader from Nordic that uses the power management module from SDK, and there is a standard demo for FreeRTOS, but without a bootloader. We also found that FreeRTOS uses its own power management functions, so there is a collision here.

Could you please advise what is the best way of merging those 2 demos?

  • Hi Andrew,

    If you are using FreeRTOS in your application only and you have a bootloader project without FreeRTOS, then i guess both can live together in the same device without any issues. This is because when the bootloader is started, application gives away control and application gets control only after the bootloader is done.

    Which examples exactly were in mind to merge? merging something with nrf_pwr_management and FreeRTOS power management is not very straightforward and needs some architectural considerations.

  • Hi,

    Thank you for your reply.

    Is there any way of merging "ble_app_hrs_freertos" and "ble_app_buttonless_dfu"?

    Maybe you have an example of FreeRTOS+DFU...

  • AndrewMospan said:
    Maybe you have an example of FreeRTOS+DFU...

     I have not experimented to do this merge yet. hopefully someone in this forum did.

  • Hi Andrew,

    David requested me to respond to you about this usecase.

     

    We also found that FreeRTOS uses its own power management functions, so there is a collision here.

    Which standard example are you referring to here? Why do you think there will be a collision? 

    • The bootloader has control during the DFU process and does not give control to the application before the bootloader has done what it is supposed to do.  In that sense, i do not see a problem that bootloader has a different power management system than the application. In this scenario, i think
      1. You can use the same mechanism of power management as the standard bootloader from the SDK have and let it have control over power management until it jumps to the application. After that, the application will have different (FreeRTOS) based power management, but that should be OK as the bootloader relinquished the control.
      2. disable the power management in bootloader
      3. port the power management function in the bootloader to use FreeRTOS API
  • We do not have any example for this, but i am quite confident you can use the standard bootloader for FreeRTOS based application. If you want to merge bootloader and application as one binary, then it is a different story. then it is the matter of making your project compilable.

    Have you tried using the standard bootloader in SDK with your FreeRTOs based application?

Related