Using flash_img.h in Zephyr boot

I want to include  #include <zephyr/dfu/flash_img.h> in boot/zephyr/main.c  (path: C:\ncs\v2.4.0\bootloader\mcuboot\boot\zephyr\main.c)
And header file path (C:\ncs\v2.4.0\zephyr\include\zephyr\dfu\flash_img.h).

But after adding flash_img.h I get a linker error: collect2.exe: error: ld returned 1 exit status

Also tried by adding path in CmakeList.txt file as "zephyr_include_directories(${ZEPHYR_BASE}/include/zephyr/dfu)"
Still does not solve the issue.

Please can you suggest what else needs to be done in order to use this header?

PS: using nRF52840dk

Thankyou

Parents
  • Hello

    What you are trying to do ?

    Bootloader, or Mcuboot are not the sample codes.

    You typically start with the sample code and then add your changes into it.

    So, what you are trying to build actually? are you using some example code and want to include the bootloader?

    If I search for mcuboot in the NCS VS Code extension, then I can see NSIB sample, also note that all samples are either in the nrf/samples or zephyr/samples.

    Please let me know what project / sample you want to build and then what changes you to incorporate.

    BR,

    Naeem

  •  I am trying to implement some changes in the MCUboot, where I can send image file over UART and then the files are written in the specified partition.

    In that case I want to use flash_img.h, where I can specify the slot where the image needs to be flashed.

Reply Children
Related