Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for xip_sram binary type
  • Loading branch information
will-v-pi committed Sep 4, 2025
commit 7201ebc0d08230bf8bb8707de1952c25336bf9f4
10 changes: 10 additions & 0 deletions src/rp2_common/pico_standard_link/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ if (NOT TARGET pico_standard_link)
#
# \param\ TYPE The binary type to set
function(pico_set_binary_type TARGET TYPE)
# catch special cases
if (TYPE STREQUAL "xip_sram")
if (PICO_RP2350)
pico_set_modified_binary_type(${TARGET} sram RAM 0x13ffc000 12k SCRATCH_X 0x13fff000 2k SCRATCH_Y 0x13fff800 2k)
target_compile_definitions(${TARGET} PRIVATE PICO_USE_SW_SPIN_LOCKS=0 PICO_USE_XIP_SRAM=1) # exclusives only work in main SRAM on RP2350
else()
message(FATAL_ERROR "xip_sram binary type is only supported on RP2350")
endif()
return()
endif()
set_target_properties(${TARGET} PROPERTIES PICO_TARGET_BINARY_TYPE ${TYPE})
endfunction()

Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ if (PICO_ON_DEVICE)
add_subdirectory(cmsis_test)
add_subdirectory(pico_sem_test)
add_subdirectory(pico_sha256_test)
add_subdirectory(pico_xip_sram_test)
endif()
7 changes: 7 additions & 0 deletions test/pico_xip_sram_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (NOT PICO_RP2040)
add_executable(pico_xip_sram_test pico_xip_sram_test.c)
target_link_libraries(pico_xip_sram_test PRIVATE pico_stdlib)
pico_set_binary_type(pico_xip_sram_test xip_sram)
pico_package_uf2_output(pico_xip_sram_test)
pico_add_extra_outputs(pico_xip_sram_test)
endif()
8 changes: 8 additions & 0 deletions test/pico_xip_sram_test/pico_xip_sram_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <stdio.h>
#include "pico/stdlib.h"


int main(void) {
stdio_init_all();
printf("pico_xip_sram_test begins\n");
}