Skip to content

Commit da6f391

Browse files
Manuel Aebischerkartben
authored andcommitted
rp2350: Only add IMAGE_DEF for apps at start of flash.
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>
1 parent f14ea32 commit da6f391

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

soc/raspberrypi/rpi_pico/rp2350/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ config SOC_RP2350B_M33
2929

3030
config RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
3131
bool
32-
default y
32+
default y if FLASH_LOAD_OFFSET = 0x100
3333
# Currently the IDF only supports using the Cortex-M33 cores. Enforce
3434
# this at build configuration time.
3535
depends on SOC_SERIES_RP2350 && CPU_CORTEX_M33

soc/raspberrypi/rpi_pico/rp2350/Kconfig.defconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
if SOC_SERIES_RP2350
77

88
config BUILD_OUTPUT_UF2_USE_FLASH_BASE
9-
default y if BUILD_OUTPUT_UF2
9+
default y if RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
10+
11+
config BUILD_OUTPUT_UF2_USE_FLASH_OFFSET
12+
default y if !RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
1013

1114
config NUM_IRQS
1215
default 52

soc/raspberrypi/rpi_pico/rp2350/linker.ld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* SPDX-License-Identifier: Apache-2.0
77
*/
88

9+
#if CONFIG_RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
910
MEMORY
1011
{
1112
IMAGE_DEF_FLASH (r) : ORIGIN = 0x10000000, LENGTH = 128
@@ -23,5 +24,6 @@ SECTIONS
2324
LONG(0xab123579) /* PICOBIN_BLOCK_MARKER_END */
2425
} > IMAGE_DEF_FLASH
2526
}
27+
#endif /* CONFIG_RP2_REQUIRES_IMAGE_DEFINITION_BLOCK */
2628

2729
#include <zephyr/arch/arm/cortex_m/scripts/linker.ld>

0 commit comments

Comments
 (0)