-
Notifications
You must be signed in to change notification settings - Fork 7.6k
soc: rp2350: enable support for building with CONFIG_XIP=n #91200
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: main
Are you sure you want to change the base?
Conversation
Doesn't regress building without the snippet as nothing but commit hash changes in the built image |
11b08d2
to
800369c
Compare
Did you look at: #36800 |
Hm, I briefly read it now. Seems they also ended up patching DT, so this is basically it, but done as a snippet with an overlay to be applied easily Should I try just XIP=n to see if Zephyr automatically ignores flash and links into RAM? The only issue is that we have to add the image header to the RP2350 executable, thus we must use the ld script to add that section |
|
Thanks for checking up. |
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.
Having a ram boot / code location snippet could make sense., but it should be a generic snippet, where there could be a specific entry for handling of rpi_pico2
, see https://docs.zephyrproject.org/latest/build/snippets/writing.html#board-specific-settings on how to do so in a snippet.
However, as commented, then it seems that ram code size is very depending on the sample / application size, and thus any size defined in the snippet would likely have to be adjusted.
For this reason, then perhaps it would be better to have a new test or sample which shows how a sample can be built and executed from flash / or placed directy in ram without using Zephyr's relocation feature.
Then users can build as:
$ west build -b rpi_pico2/rp2350a/m33 <new-sample>
or applying the overlay that could live together with the sample, like this:
$ west build -b rpi_pico2/rp2350a/m33 <new-sample> -- -DDTC_OVERLAY_FILE=ram.overlay
An example of such approach can be seen in https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/fs/format/ where a ramdisk.overlay
overlay file is provided that the user can specify.
The advantage of dtc overlay approach is that it becomes more visible to users that the ram.overlay
file should be copied to their own sample, and that they won't have to modify an upstream snippet.
The disadvantage of such approach compared to the snippet approach is of course that it's less visible that the ram option exists for any sample.
Okay, perhaps with a regex I can match
It is not likely to have to be adjusted. 256 KB "flash" and 256 KB RAM should be fine for most cases and others should be able to make a custom overlay/dts.
Yes, and this is more complex than a snippet for the development workflow. I will probably implement a SoC-specific overlay in the snippet, so that we match not only |
This comment was marked as outdated.
This comment was marked as outdated.
Use this approach for a simpler flow and to make relocation of images into RAM easier. Also do not force-select CONFIG_XIP (which is a default anyway), since RP2350 can boot from SRAM. Signed-off-by: Dmitrii Sharshakov <[email protected]>
Updated linker scripts no longer necessitate that. Users who employ a bootloader in their design should be able to adjust partitioning more easily, removing IMAGE_DEF with a Kconfig if needed. Signed-off-by: Dmitrii Sharshakov <[email protected]>
|
perhaps marking the PR |
@tejlmand ah, sorry, I've already rewritten everything. You're welcome to review now |
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 is a neater solution than what I'd done originally (and was subsequently copied around). LGTM.
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.
DTS changes OK
@tejlmand could you please take a look? These changes already got 3 approvals, so perhaps it'd be best to merge them to avoid unnecessary stale PRs and merge conflicts. Thank you! |
…rt linker script Use this approach for a simpler flow and to make relocation of images into RAM easier. Also do not force-select CONFIG_XIP (which is a default anyway), since RP2350 can boot from SRAM. Signed-off-by: Dmitrii Sharshakov <[email protected]>
…ion for RP2350 Updated linker scripts no longer necessitate that. Users who employ a bootloader in their design should be able to adjust partitioning more easily, removing IMAGE_DEF with a Kconfig if needed. Signed-off-by: Dmitrii Sharshakov <[email protected]>
Should be also possible on RP2040 but has less practical applications due to lack of UART boot.
Usage:
west build -b rpi_pico2/rp2350a/m33 samples/subsys/usb/console -- -DCONFIG_XIP=n
Signed-off-by: Dmitrii Sharshakov [email protected]