Skip to content
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

zephyr_code_relocate() now supports the NOCOPY_DATA flag to inhibit data relocation #86628

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rhaberkorn
Copy link

This helps when building firmwares for coprocessors, where the image is loaded completely into SRAM in Linux-land using the remoteproc framework.

For a motivation of this change, see #86530.

Copy link

github-actions bot commented Mar 4, 2025

Hello @rhaberkorn, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

This is activated by passing NOCOPY_DATA to zephyr_code_relocate().

It helps when building firmwares for coprocessors, where the image is loaded
completely into SRAM from Linux-land using the remoteproc framework.

Fixes: zephyrproject-rtos#86530

Signed-off-by: Robin Haberkorn <haberkorn@metratec.com>
@rhaberkorn rhaberkorn force-pushed the relocate-nocopy-data branch from c2c7015 to 1118aa3 Compare March 4, 2025 15:59
@@ -149,14 +149,18 @@ XIP area.

This example will place the .text section of the ``xip_external_flash.c`` file
to the ``EXTFLASH`` memory region where it will be executed from (XIP). The
.data will be relocated as usual into SRAM.
.data will be relocated as usual into SRAM, since XIP flash does not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.data will be relocated as usual into SRAM, since XIP flash does not
.data will be relocated as usual into SRAM, since Flash in XIP mode does not

@@ -149,14 +149,18 @@ XIP area.

This example will place the .text section of the ``xip_external_flash.c`` file
to the ``EXTFLASH`` memory region where it will be executed from (XIP). The
.data will be relocated as usual into SRAM.
.data will be relocated as usual into SRAM, since XIP flash does not
allow random write access and variables do not have to be persisted.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
allow random write access and variables do not have to be persisted.
allow random write access and variables do not have to persist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants