mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Make overriding ram locations simpler
This commit is contained in:
parent
f6789f888a
commit
c6cac63a1f
17 changed files with 55 additions and 69 deletions
|
|
@ -1,13 +1,4 @@
|
|||
/* Include memory regions used */
|
||||
INCLUDE "rp2_common/memory_flash.ld"
|
||||
INCLUDE "platform/memory_blocked_ram.ld"
|
||||
INCLUDE "platform/memory_scratch.ld"
|
||||
/* Use blocked ram */
|
||||
RAM_ORIGIN = 0x21000000;
|
||||
|
||||
/* Include aliases for storage memory regions */
|
||||
INCLUDE "rp2_common/memory_aliases_default.ld"
|
||||
|
||||
/* Define entry point symbol */
|
||||
ENTRY(_entry_point)
|
||||
|
||||
/* Include default sections */
|
||||
INCLUDE "rp2_common/sections_default.ld"
|
||||
INCLUDE "memmap_default.ld"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
RAM_ORIGIN = DEFINED(RAM_ORIGIN) ? RAM_ORIGIN : 0x20000000;
|
||||
RAM_LENGTH = DEFINED(RAM_LENGTH) ? RAM_LENGTH : 256k;
|
||||
SCRATCH_X_ORIGIN = DEFINED(SCRATCH_X_ORIGIN) ? SCRATCH_X_ORIGIN : 0x20040000;
|
||||
SCRATCH_X_LENGTH = DEFINED(SCRATCH_X_LENGTH) ? SCRATCH_X_LENGTH : 4k;
|
||||
SCRATCH_Y_ORIGIN = DEFINED(SCRATCH_Y_ORIGIN) ? SCRATCH_Y_ORIGIN : 0x20041000;
|
||||
SCRATCH_Y_LENGTH = DEFINED(SCRATCH_Y_LENGTH) ? SCRATCH_Y_LENGTH : 4k;
|
||||
XIP_RAM_ORIGIN = DEFINED(XIP_RAM_ORIGIN) ? XIP_RAM_ORIGIN : 0x15000000;
|
||||
XIP_RAM_LENGTH = DEFINED(XIP_RAM_LENGTH) ? XIP_RAM_LENGTH : 16k;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
MEMORY
|
||||
{
|
||||
RAM(rwx) : ORIGIN = 0x21000000, LENGTH = 256k
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
MEMORY
|
||||
{
|
||||
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
MEMORY
|
||||
{
|
||||
SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
|
||||
SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
RAM_ORIGIN = DEFINED(RAM_ORIGIN) ? RAM_ORIGIN : 0x20000000;
|
||||
RAM_LENGTH = DEFINED(RAM_LENGTH) ? RAM_LENGTH : 512k;
|
||||
SCRATCH_X_ORIGIN = DEFINED(SCRATCH_X_ORIGIN) ? SCRATCH_X_ORIGIN : 0x20080000;
|
||||
SCRATCH_X_LENGTH = DEFINED(SCRATCH_X_LENGTH) ? SCRATCH_X_LENGTH : 4k;
|
||||
SCRATCH_Y_ORIGIN = DEFINED(SCRATCH_Y_ORIGIN) ? SCRATCH_Y_ORIGIN : 0x20081000;
|
||||
SCRATCH_Y_LENGTH = DEFINED(SCRATCH_Y_LENGTH) ? SCRATCH_Y_LENGTH : 4k;
|
||||
XIP_RAM_ORIGIN = DEFINED(XIP_RAM_ORIGIN) ? XIP_RAM_ORIGIN : 0x13FFC000;
|
||||
XIP_RAM_LENGTH = DEFINED(XIP_RAM_LENGTH) ? XIP_RAM_LENGTH : 16k;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
MEMORY
|
||||
{
|
||||
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 512k
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
MEMORY
|
||||
{
|
||||
SCRATCH_X(rwx) : ORIGIN = 0x20080000, LENGTH = 4k
|
||||
SCRATCH_Y(rwx) : ORIGIN = 0x20081000, LENGTH = 4k
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
MEMORY
|
||||
{
|
||||
XIP_RAM(rwx) : ORIGIN = 0x13FFC000, LENGTH = 16k
|
||||
}
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
/* Include platform memory locations */
|
||||
INCLUDE "platform/default_locations.ld"
|
||||
|
||||
/* Include memory regions used */
|
||||
INCLUDE "rp2_common/memory_flash.ld"
|
||||
INCLUDE "platform/memory_ram.ld"
|
||||
INCLUDE "platform/memory_scratch.ld"
|
||||
INCLUDE "rp2_common/memory_ram.ld"
|
||||
INCLUDE "rp2_common/memory_scratch.ld"
|
||||
|
||||
/* Include aliases for storage memory regions */
|
||||
INCLUDE "rp2_common/memory_aliases_default.ld"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
/* Include platform memory locations */
|
||||
INCLUDE "platform/default_locations.ld"
|
||||
|
||||
/* Include memory regions used */
|
||||
INCLUDE "rp2_common/memory_flash.ld"
|
||||
INCLUDE "platform/memory_ram.ld"
|
||||
INCLUDE "platform/memory_scratch.ld"
|
||||
INCLUDE "rp2_common/memory_ram.ld"
|
||||
INCLUDE "rp2_common/memory_scratch.ld"
|
||||
|
||||
/* Include aliases for storage memory regions */
|
||||
INCLUDE "rp2_common/memory_aliases_default.ld"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
/* Include platform memory locations */
|
||||
INCLUDE "platform/default_locations.ld"
|
||||
|
||||
/* Include memory regions used */
|
||||
INCLUDE "platform/memory_ram.ld"
|
||||
INCLUDE "platform/memory_scratch.ld"
|
||||
INCLUDE "rp2_common/memory_ram.ld"
|
||||
INCLUDE "rp2_common/memory_scratch.ld"
|
||||
|
||||
/* Include aliases for no_flash storage memory regions (alias to themselves) */
|
||||
INCLUDE "rp2_common/memory_aliases_no_flash.ld"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
MEMORY
|
||||
{
|
||||
RAM(rwx) : ORIGIN = RAM_ORIGIN, LENGTH = RAM_LENGTH
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
MEMORY
|
||||
{
|
||||
SCRATCH_X(rwx) : ORIGIN = SCRATCH_X_ORIGIN, LENGTH = SCRATCH_X_LENGTH
|
||||
SCRATCH_Y(rwx) : ORIGIN = SCRATCH_Y_ORIGIN, LENGTH = SCRATCH_Y_LENGTH
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
MEMORY
|
||||
{
|
||||
XIP_RAM(rwx) : ORIGIN = XIP_RAM_ORIGIN, LENGTH = XIP_RAM_LENGTH
|
||||
}
|
||||
|
|
@ -215,13 +215,14 @@ if (NOT KITCHEN_SINK_NO_BINARY_TYPE_VARIANTS)
|
|||
target_compile_definitions(kitchen_sink_blocked_ram PRIVATE KITCHEN_SINK_ID="blocked-ram binary")
|
||||
endif()
|
||||
|
||||
add_executable(kitchen_sink_memmap_custom ${CMAKE_CURRENT_LIST_DIR}/kitchen_sink.c)
|
||||
# Have heap start from 0x20030000, and custom linker script
|
||||
pico_set_linker_script(kitchen_sink_memmap_custom ${CMAKE_CURRENT_LIST_DIR}/memmap_custom.ld)
|
||||
pico_set_linker_script_var(kitchen_sink_memmap_custom HEAP_LOC 0x20030000)
|
||||
target_link_libraries(kitchen_sink_memmap_custom kitchen_sink_libs kitchen_sink_options)
|
||||
pico_add_extra_outputs(kitchen_sink_memmap_custom)
|
||||
target_compile_definitions(kitchen_sink_memmap_custom PRIVATE KITCHEN_SINK_ID="custom memmap binary")
|
||||
add_executable(kitchen_sink_ram_custom ${CMAKE_CURRENT_LIST_DIR}/kitchen_sink.c)
|
||||
# Have ram start from 0x20020000 length 128k, and heap start from 0x20030000
|
||||
pico_set_linker_script_var(kitchen_sink_ram_custom RAM_ORIGIN 0x20020000)
|
||||
pico_set_linker_script_var(kitchen_sink_ram_custom RAM_LENGTH 128k)
|
||||
pico_set_linker_script_var(kitchen_sink_ram_custom HEAP_LOC 0x20030000)
|
||||
target_link_libraries(kitchen_sink_ram_custom kitchen_sink_libs kitchen_sink_options)
|
||||
pico_add_extra_outputs(kitchen_sink_ram_custom)
|
||||
target_compile_definitions(kitchen_sink_ram_custom PRIVATE KITCHEN_SINK_ID="custom ram binary")
|
||||
endif()
|
||||
|
||||
add_executable(kitchen_sink_cpp ${CMAKE_CURRENT_LIST_DIR}/kitchen_sink_cpp.cpp)
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
/* Include memory regions used */
|
||||
INCLUDE "rp2_common/memory_flash.ld"
|
||||
INCLUDE "platform/memory_scratch.ld"
|
||||
|
||||
/* Only use 128k of SRAM, starting at 0x20020000 */
|
||||
MEMORY
|
||||
{
|
||||
RAM(rwx) : ORIGIN = 0x20020000, LENGTH = 128k
|
||||
}
|
||||
|
||||
/* Include aliases for storage memory regions */
|
||||
INCLUDE "rp2_common/memory_aliases_default.ld"
|
||||
|
||||
/* Define entry point symbol */
|
||||
ENTRY(_entry_point)
|
||||
|
||||
/* Include default sections */
|
||||
INCLUDE "rp2_common/sections_default.ld"
|
||||
Loading…
Add table
Reference in a new issue