zephyr: Mcuboot fails to compile when using single image and usb dfu

Describe the bug I am not sure if this is a bug or a feature request, because I can’t find much information on my requirement.

I am writing an application which needs to be bootloadable over USB, and does not have physical access to a boot button. Because of this, I would prefer that the bootload process can be initiated from within the application context. My current idea is to use mcumgr with the mcuboot bootloader. I have done this before with success.

However, in this case my application is slightly too large and so I cannot fit the image into the image-0 location if there is an equally sized image-1. Instead, I have removed image-1 and the scratch partition and built mcuboot with CONFIG_SINGLE_IMAGE_DFU=y.

This compiles perfectly fine and I am able to flash it to my device with no problems. As far as I understand this is supported functionality in the zephyr fork of mcuboot.

Similarly, I can build the application perfectly fine with CONFIG_BOOTLOADER_MCUBOOT=y. However if I try to include an image manager with CONFIG_MCUMGR=y things no longer work because it is looking for the image-1 partition, even though it is not required in my case.

To Reproduce

  1. Remove image-1 partition from board dts
  2. Build mcuboot with CONFIG_SINGLE_IMAGE_DFU=y to confirm this is supported
  3. Build an application with CONFIG_MCUMGR=y and CONFIG_BOOTLOADER_MCUBOOT=y to find errors regarding image-1

Expected behavior mcumgr and dfu util in general should be aware of CONFIG_SINGLE_IMAGE_DFU=y

Impact Very difficult to proceed on my application if I must have two image slots

Environment (please complete the following information):

  • OS: Windows 10
  • Toolchain: gnuarmemb
  • latest master

Additional context I am also unable to build mcuboot with CONFIG_SINGLE_IMAGE_DFU=y and CONFIG_BOOT_WAIT_FOR_USB_DFU=y as this also causes errors looking for image-1.

Edit:

I have realized using mcumgr doesn’t really make sense for single image applications since it has to overwrite the application. However, mcuboot with usb dfu should work and it doesn’t. I’ve edited the title to reflect this.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

^^ No, zephyr is in code-freeze for 2.4 release. Only bug-fixes can go in.