Skip to content

Conversation

will-v-pi
Copy link
Contributor

@will-v-pi will-v-pi commented Sep 11, 2025

Draft for now, as it includes changes from #2645 and #2137, requires the xip-sram branch of picotool (otherwise UF2 creation and signing fails), and is still WIP - just raising so it can be viewed early, and maybe some of these bits can be added to #2137

This should fix #2653 for both RP2040 and RP2350

This adds new binary types xip_sram (whole binary in XIP SRAM), and copy_to_ram_using_xip_ram/no_flash_using_xip_ram (time critical functions placed in XIP SRAM)

Also adds parsing of addressmap.h so variables in it can be accessed by using pico_get_addressmap_value, to remove hardcoded SRAM addresses from the CMake

Allows creating binaries using an existing binary type & linker script, but with modified RAM/SCRATCH addresses

For example, to only use SRAM1 so you can power down SRAM0 in your binary you could use `pico_set_modified_binary_type(<my_exe> no_flash RAM "0x20040000" "256k"`
New template flash and sram linker scripts, to avoid need for parsing the file

Adds a test to kitchen_sink that these new linker scripts produce the same defaults, to ensure modifications to linker scripts are propogated
Use spinlock IDs that are unaffected by E2
…ash builds

Also modify linker scripts to add templating additional regions, and callback to pico_set_modified_binary_type to set additional variables
On RP2040 they are copy to xip sram, as the bootrom doesn't support direct entry into xip sram
Time critical functions are placed in xip sram for those types
Parse addressmap.h for sram locations, and set them as target properties on pico_standard_link for storage
More DMA, and check the cycles after - now works on RP2040 and RP2350
Add pico_read_addressmap_value function to do actual reading, called by pico_get_addressmap_value when not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant