Skip to content

Commit 3bf0122

Browse files
committed
PR zephyrproject-rtos#91200: soc: rp2350: add IMAGE_DEF using rom_start linker script
Use this approach for a simpler flow and to make relocation of images into RAM easier. Also do not force-select CONFIG_XIP (which is a default anyway), since RP2350 can boot from SRAM. Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
1 parent 7da64e7 commit 3bf0122

File tree

4 files changed

+22
-32
lines changed

4 files changed

+22
-32
lines changed

soc/raspberrypi/rpi_pico/rp2350/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ zephyr_library_sources(soc.c)
77

88
zephyr_include_directories(.)
99

10-
set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "")
10+
# Add the image definition block if required
11+
zephyr_linker_sources(ROM_START rom_start.ld)
12+
13+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

soc/raspberrypi/rpi_pico/rp2350/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ config SOC_SERIES_RP2350
77
select HAS_RPI_PICO
88
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
99
select SOC_RESET_HOOK
10-
select XIP
1110

1211
config SOC_RP2350A_M33
1312
select ARM
@@ -31,7 +30,7 @@ config SOC_RP2350B_M33
3130

3231
config RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
3332
bool
34-
default y if FLASH_LOAD_OFFSET = 0x100
33+
default y
3534
# Currently the IDF only supports using the Cortex-M33 cores. Enforce
3635
# this at build configuration time.
3736
depends on SOC_SERIES_RP2350 && CPU_CORTEX_M33

soc/raspberrypi/rpi_pico/rp2350/linker.ld

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* rom_start.ld - additional data to append at the ROM start */
2+
3+
/*
4+
* Copyright (c) 2024 Andrew Featherstone
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*/
8+
9+
#if CONFIG_RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
10+
LONG(0xffffded3) /* PICOBIN_BLOCK_MARKER_START */
11+
LONG(0x10210142) /* IMAGE_DEF Item */
12+
LONG(0x00000203) /* VECTOR_TABLE Item */
13+
LONG(ABSOLUTE(_vector_start)) /* - Address of the vector table in flash */
14+
LONG(0x000003ff) /* Last Item in Block */
15+
LONG(0x00000000) /* End of block loop */
16+
LONG(0xab123579) /* PICOBIN_BLOCK_MARKER_END */
17+
#endif /* CONFIG_RP2_REQUIRES_IMAGE_DEFINITION_BLOCK */

0 commit comments

Comments
 (0)