-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
code_relocation: Add option to specify load memory segment #76513
base: main
Are you sure you want to change the base?
Conversation
Currently there is no way to select a load memory segment other than ROMABLE_REGION. This introduces an optional argument to zephyr_code_relocate() Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
Provide an example of loading code from a region other than ROMABLE_REGION Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
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.
afaict this PR breaks windows support.
# <mem_region>[\ :program_header]:<flag_1>[;<flag_2>...]:<file_1>[;<file_2>...] | ||
# Returns a 4-tuple with them: (mem_region, program_header, flags, files) | ||
# <mem_region>[:PHDR=program_header][:LMEM=load_memory]:FLAGS=<flag_1>[;<flag_2>...]:FILES=<file_1>[;<file_2>...] | ||
# Returns a 5-tuple with them: (mem_region, program_header, load_mem, flags, files) | ||
# If no `program_header` is defined, returns an empty string |
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 guess a line similar If no program_header
is needed for `load_memory.
line_split = line.split(':') | ||
arg_dict = {i.split('=')[0]: i.split('=')[1] for i in line_split[1:]} |
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.
afaict this breaks on Windows where paths contains :
, such as c:/
.
Please also take a look at this comment: #74402 (comment)
Perhaps you didn't notice the comment you removed here:
zephyr/scripts/build/gen_relocate_app.py
Line 508 in c710f88
# Be careful when splitting by : to avoid breaking absolute paths on Windows |
Currently there is no way to select a load memory segment other than ROMABLE_REGION. This introduces an optional argument (LMEM) to zephyr_code_relocate(). An example usecase is provided.