-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for using XIP cache as SRAM #2660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
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
*(.time_critical.text*) | ||
. = ALIGN(4); | ||
__xip_ram_text_end__ = .; | ||
} > XIP_RAM AT> FLASH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this line ending the .xip_text
block needs to be the following in the copy_to_ram_using_xip_ram
case
} > XIP_RAM AT> FLASH
and needs to be the following in the no_flash_using_xip_ram
case
} > XIP_RAM
__embedded_block_end = .; | ||
. = ALIGN(256); | ||
KEEP (*(.vectors)) | ||
*(.time_critical*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line:
*(.time_critical*)
is preempting the
*(.time_critical.text*)
line of the @ADDITIONAL_PRE_DATA@
block below.
Should it be relocated into the .data
block where it is housed for both the copy_to_ram
and default
linker scripts?
|
||
.data : { | ||
__data_start__ = .; | ||
*(vtable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E.g. could add the following here in .data
under vtable
as is done for the copy_to_ram
and default
linker scripts:
*(.time_critical*)
. = ALIGN(4);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll ping @kilograham over this, as I'm not sure why time critical is placed in a different place for no_flash vs the other build types?
Move default time_critical section, and store correctly
These changes are now working as expected for me and my test program running on an RP2040 using in following configurations: |
KEEP (*(.embedded_block)) | ||
__embedded_block_end = .; | ||
KEEP (*(.reset)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the RP2350 implementations of this and the copy_to_ram template this block is ended with
} > FLASH
should that be made the same here and in the RP2040's copy_to_ram template?
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 #2137This should fix #2653 for both RP2040 and RP2350
This adds new binary types
xip_sram
(whole binary in XIP SRAM), andcopy_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 usingpico_get_addressmap_value
, to remove hardcoded SRAM addresses from the CMake