Setup for link options for a standard SDK executable.
Setup for link options for a standard SDK executable.
This includes:
default, no_flash, blocked_ram and copy_to_ram binariesThe default linker scripts comprise of a base memmap_*.ld file, and a series of .incl files that are included by it.
The base memmap_*.ld files are located in the pico_platform directory of the target chip. Each file has a tree showing the files that are included by it.
To override any included files, place the overriding files in a directory, and pass that directory to the pico_add_linker_script_override_path CMake function. The usual files to override when making a custom linker script are:
memory_extra.incl, to add extra memory regionssection_extra_*.incl files, to add extra sections to the binary - see the comments in the files for more detailsdefault_*_excludes.incl files, to change what is placed in RAM for flash binary types (eg default, blocked_ram)You can also set variables in the linker script using the pico_set_linker_script_var CMake function, to change the location and size of default memory regions. The available variables are:
HEAP_LOC, to set the heap locationHEAP_LIMIT, to set the heap limitRAM_ORIGIN, to set the origin of RAMRAM_LENGTH, to set the length of RAMXIP_RAM_ORIGIN, to set the origin of XIP RAMXIP_RAM_LENGTH, to set the length of XIP RAMSCRATCH_X_ORIGIN, to set the origin of scratch xSCRATCH_X_LENGTH, to set the length of scratch xSCRATCH_Y_ORIGIN, to set the origin of scratch ySCRATCH_Y_LENGTH, to set the length of scratch y