Add support for using XIP cache as SRAM#2932
Conversation
Allows for much simpler custom linker scripts
…ript_var variables Means that CMake doesn't need to know the default memory addresses for different platforms
…l files easier Restructured so that it includes the platform-specific files before common ones, so common ones can be overridden
Use new include_linker_script_dir and use_linker_script_file functions to add the linker arguments
Breaking change for Bazel builds using different binary types, instead of setting PICO_DEFAULT_LINKER_SCRIPT to eg `//src/rp2_common/pico_crt0:no_flash_linker_script` it is now `//src/rp2_common/pico_standard_link:no_flash_linker_script`
Treat rp2040 layout (boot2 instead of embedded blocks) as the outlier
Allows overriding what to exclude from .text/.rodata and put in .data
These were being placed in Flash due to a missing space, and also are under libc on some compilers
Add PICO_LINKER_SCRIPT_INCLUDE_DIRS and PICO_LINKER_DEFAULT_LOCATIONS_PATH, instead of hardcoded paths under PICO_LINKER_SCRIPT_PATH Also improve pico_set_linker_script_var and pico_add_linker_script_override_path to better utilise generator expressions
Required changes to the way bazel views these files
…d sections_... which contain multiple Only exceptions are section_..._data and section_bss, as these contain data/bss and tdata/tbss - these are kept together as they are treated as a single section
…n in the future by CMake/bazel functions
…ink_libraries, as it uses generator expressions Also add more checks to kitchen_sink
Intended for platform specific overrides, whereas post_end is for cross-platform overrides, similar to section_end vs section_platform_end
Use spinlock IDs that are unaffected by E2
…ead of new binary types Adds pico_include_in_generated_section to fill section_generated_... files with lists of include files, and pico_set_compile_definition to allow setting the same definition multiple times on a target without getting warnings
Has missed setting PICO_CRT0_PIN_XIP_SRAM
Ordering of transistions matters
|
Hi, it's nice to see some progress on this, thanks! In the description it says: "This adds a new xip_ram binary type (RP2350 only) which puts all code & data in XIP SRAM". Can you clarify the intent and use case for this new xip_ram binary type? By "all code & data" are you intending to put both .data and .text code sections into the eXecute In Place (XIP) SRAM, not just the eXecutable .text sections? That seems suboptimal. Is this some kind of provision to support External flash and PSRAM with the XIP hardware that I'm not familiar with? Also, in the memmap_xip_ram.incl file, am I reading it correctly that all SRAM locations, including the usual SCRATCH X/Y locations, where the CPUs typically maintain their stack data, are being remapped into the XIP SRAM address space with the new xip_ram binary type? From our previous conversations in #2660 and #2932 I had attempted the PR #2677 to add my two new build script functions separately, but I ran into supported CMAKE version limitations that precluded their inclusion. The build script functions were attempting to promote whole source file's contents like the "not_in_flash" and "time_critical" macros would, but at source file granularity: Is the new xip_ram binary type an attempt to do something similar? I'm still focused in RP2040 development, and think a new "copy_to_xip_and_ram" binary type option, that is basically equivalent to the existing "copy_to_ram" binary type option, except that it places all the TARGET eXecutable .text and .time_critical.text content into XIP SRAM could be useful. Maybe in addition to the new pico_use_xip_sram_for_time_critical(TARGET) build script function we could also add a new pico_use_xip_sram_for_functions(TARGET) build script function that places all the TARGET eXecutable .text and .time_critical.text content into the XIP SRAM? That would make my proposed "copy_to_xip_and_ram" binary type option redundant. Also, the "pico_use_xip_sram_for_time_critical()" could be renamed to "pico_use_xip_sram_for_time_critical_functions()" making the two function's relation and their instruction focus more obvious. Cheers! |
The new The stuff we discussed before is now replaced with the
Placing all of |
Special treatment is no longer in the future
This adds a new
xip_rambinary type (RP2350 only) which puts all code & data in XIP SRAM, and apico_use_xip_sram_for_time_criticalCMake function to put functions marked as time_critical in XIP SRAM instead of regular SRAM. Thepico_use_xip_sram_for_time_criticalis only useful forcopy_to_ramandno_flashbinary types - it will still work fordefaultbinary types, but makes everything slower instead of faster.Adds tests of both - currently the
pico_xip_sram_testdoesn't fit on Clang or Bazel so is skipped on both, andpico_use_xip_sram_for_time_criticalis not implemented in Bazel, sopico_critical_xip_sram_testuses a custom linker script instead, for the same effect.Supercedes #2660, and fixes #2653