mcuboot CONFIG_MCUBOOT_ACTION_HOOKS

Hello!

I'm working on some project using Fanstel BM832 module. I'm using the configuration based on board nrf52dk_nrf52832, with some minor modifications (led's and button pinouts are changed using nrf52dk_nrf52832.overlay). I'm trying to use the bluetooth bootloader. I enabled the bootloader by adding the:
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
into my prj.conf file.
I also created the child_image/mcuboot.conf file with those entries:
CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
CONFIG_BOOT_SIGNATURE_KEY_FILE=.....

For now everything works fine, except that I would like to indicate that "bootloading" (copying from 2nd slot in flash to the 1st slot) is in progress, by blinking one of my LEDs.
I know that I can enable the bootloader action hooks by enabling the option:
CONFIG_MCUBOOT_ACTION_HOOKS=y
in my child_image/mcuboot.conf file.
I need to add a c file containing the mcuboot_status_change to the mcuboot child image build. How can I do this without modifying the nrf connect sdk (just by adding my own files in my project folder).

I have also another question: How can I detect the bootloading process (when the firmware is uploading by the bluetooth to the flash 2nd slot) in my application. Are there any hooks also on the application side?

Best regards,
Krzysztof Szewczyk

Parents Reply
  • Yes, I am successfully using MCUMgr callbacks to get the events of a new image being uploaded to slot 1. However, when the device gets restarted, my understanding is that MCUBoot swaps the new image from slot 1 to slot 0. At this point the application has not started yet, so I cannot get callbacks, but I still would like to inform the user that something is happening.

    The method described in the post I mentioned is working for me, I was just wondering if this is the preferred way of doing this kind of things ?

Children
Related