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
  • Add your custom mcuboot_status_change() implementation in a file under child_image/mcuboot/ in your app (CMakeLists will pick it up without modifying NCS), and yes, that will let you blink an LED during slot copy; on the application side there are no hooks for the DFU transfer itself—you can only monitor mcumgr upload progress in your app if you handle the smp server, but the actual slot-to-slot swap is only visible in mcuboot.

    geometry dash

  • Hi politiclesson,

    I've try to do what you said bu it's didn' work. I added a file mcuboot_hook.c in my child_image/mcuboot folder, add CONFIG_MCUBOOT_ACTION_HOOKS=y in mcuboot.conf, but when I'm trying to build I got an error

    /opt/nordic/ncs/v2.5.0/bootloader/mcuboot/boot/bootutil/src/loader.c:2368: undefined reference to `mcuboot_status_change' look like npthing taking by cmakelist.txt

Reply
  • Hi politiclesson,

    I've try to do what you said bu it's didn' work. I added a file mcuboot_hook.c in my child_image/mcuboot folder, add CONFIG_MCUBOOT_ACTION_HOOKS=y in mcuboot.conf, but when I'm trying to build I got an error

    /opt/nordic/ncs/v2.5.0/bootloader/mcuboot/boot/bootutil/src/loader.c:2368: undefined reference to `mcuboot_status_change' look like npthing taking by cmakelist.txt

Children
No Data
Related