jancumps / pico_scpi_usbtmc_labtool

LabVIEW compatible instrument on a Raspberry Pico
https://github.com/jancumps/pico_scpi_usbtmc_labtool/wiki
MIT License
13 stars 17 forks source link

investigate linker script with reserved flash space #34

Closed jancumps closed 1 year ago

jancumps commented 1 year ago

find way to reserve block(s) of flash space, so that it can't be overwritten by new, larger, firmware

sdk doc with linker info.

pico_standard_link encapsulates the standard linker setup needed to configure the type of application binary layout in
memory, and link to any additional C and/or C++ runtime libraries. It also includes the default crt0, which provides the
initial entry point from the flash second stage bootloader, contains the initial vector table (later relocated to RAM), and
initialises static data and RAM-resident code if the application is running from flash.

custom linker file: pico_set_linker_script(my_target ${CMAKE_CURRENT_LIST_DIR}/custom.ld)

default loader source.

sdk linker settings

Proof of concept

@shabaz123 , I am splitting this part out and assigning to self. I think we can build the flash stgorage part and the memory protection part separately, integrate the pieces that work, when they work.

jancumps commented 1 year ago

the section will be available in C code (for FLASH API as:

       extern uint32_t ADDR_PERSISTENT[];
       #define ADDR_PERSISTENT_BASE_ADDR   (ADDR_PERSISTENT)