-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dfu: mcuboot: define boot_img_magic when FLASH_AREA_IMAGE_SECONDARY #30076
dfu: mcuboot: define boot_img_magic when FLASH_AREA_IMAGE_SECONDARY #30076
Conversation
boot_img_magic[] is needed for boot_magic_write() function, which is defined if FLASH_AREA_IMAGE_SECONDARY is defined as well. Make sure boot_img_magic[] is defined when FLASH_AREA_IMAGE_SECONDARY. Fixes: 5cfafb0 ("dfu/boot/mcuboot: made able to compile within MCUBoot") Signed-off-by: Marcin Niestroj <[email protected]>
Currently there are ifdefs using CONFIG_BOOTLOADER_MCUBOOT to prevent compilation errors when being built as mcuboot bootloader. This macro however is related to chain-loadable application image, instead of bootloader image. Convert this magic ifdeffery to use CONFIG_MCUBOOT macro instead, as a way to define whether sources are being built as mcuboot bootloader or Zephyr application. Fixes: 5cfafb0 ("dfu/boot/mcuboot: made able to compile within MCUBoot") Signed-off-by: Marcin Niestroj <[email protected]>
1036bcc
to
18b0293
Compare
According to the description of the problem (#30075), the desired result is to be able to use
Shouldn't then the solution be to make a compilation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We decided not to use not in zephyr tree defined Kconfig properties here.
Then fastest patch is to add || defined(CONFIG_IMG_MANAGER)
or && !defined(CONFIG_IMG_MANAGER)
where needed.
Also want to emphasize that I will work on #29963 soon
But still decided to make a logic based on "not in zephyr tree" code, its public functions etc. IMO it doesn't seem any better, because dependency is still there. The only thing is that Compliance check is satisfied, which is kind of artificial gain.
Unfortunately
Seems like a very good idea, we really need that! Any estimates on that already? What about adding a helper macro
|
|
I am not sure that adding a check around |
@mniestroj ^^ obviously you are right. |
I started working on #29963 |
@mniestroj shall we close this? |
This has been superseded with #30370. |
boot_img_magic[] is needed for boot_magic_write() function, which is
defined if FLASH_AREA_IMAGE_SECONDARY is defined as well.
Make sure boot_img_magic[] is defined when FLASH_AREA_IMAGE_SECONDARY.
Fixes: #30075