Skip to content

rp2350: Only add IMAGE_DEF for apps at start of flash. #86294

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

Merged

Conversation

Manu3l0us
Copy link

The image_def header shall not be added to apps that are booted by a bootloader, e.g. mcuboot.

@soburi This is another patch I prepared during the RP2350 pull request by @ajf58. As I have started to use mcuboot after fixing the flash driver, I had the problem that also the application image loaded by the bootloader had the image_def block in it.

@zephyrbot zephyrbot added the platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) label Feb 25, 2025
@Manu3l0us
Copy link
Author

From what I see that this issue may also be easily resolved with #79460, so eventually this PR is probably superfluous.

@Manu3l0us Manu3l0us changed the title WIP: rp2350: Only add IMAGE_DEF for apps at start of flash. rp2350: Only add IMAGE_DEF for apps at start of flash. Apr 15, 2025
@Manu3l0us
Copy link
Author

I removed the WIP "label" as I don't plan to add something currently. The driver is working fine in my private branch

@hanan619
Copy link

@Manu3l0us
This is incomplete.
Please change Kconfig.defconfig
from

config BUILD_OUTPUT_UF2_USE_FLASH_BASE
	default y if BUILD_OUTPUT_UF2

to

config BUILD_OUTPUT_UF2_USE_FLASH_BASE
	default y if RP2_REQUIRES_IMAGE_DEFINITION_BLOCK

config BUILD_OUTPUT_UF2_USE_FLASH_OFFSET
	default y if !RP2_REQUIRES_IMAGE_DEFINITION_BLOCK

@hanan619
Copy link

@soburi Zephyr team
This is a straight forward PR. please review it

@Manu3l0us
Copy link
Author

@hanan619 Thanks for pointing out. I always flashed using a hex file with a debug probe. Therefore I didn't detect it

soburi
soburi previously approved these changes Apr 15, 2025
@Manu3l0us Manu3l0us force-pushed the fix_image_def_for_bootloader branch from 2996e92 to 24e199d Compare April 15, 2025 12:51
@Manu3l0us Manu3l0us force-pushed the fix_image_def_for_bootloader branch from 24e199d to 9bcd550 Compare April 15, 2025 12:56
The image_def header shall not be added to apps that are booted by a
bootloader, e.g. mcuboot. Added proper handling for UF2 by hanan619.

Signed-off-by: Manuel Aebischer <manuel.aebischer@belden.com>
@Manu3l0us Manu3l0us force-pushed the fix_image_def_for_bootloader branch from 9bcd550 to be83852 Compare April 15, 2025 13:08
@kartben kartben merged commit da6f391 into zephyrproject-rtos:main May 15, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants