-
Notifications
You must be signed in to change notification settings - Fork 8
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
PrgCode section name #6
Conversation
Why did you rename the program |
This would also make it compatible with the target-gen tool in probe-rs, which can generate the target description file for probe-rs automatically. |
FLM algos use Even if |
Do you mean |
You can see the the template .FLM sources in the CMSIS_5 repo that these sections are used: https://github.com/ARM-software/CMSIS_5/blob/develop/Device/_Template_Flash/Target.lin |
The tool also expects |
Even with this change, all memory accesses are still done PC-relative. This means that you still can't change the location of .data/PrgData relative to .text/PrgCode. If a tool assumes it can freely relocate PrgCode and PrgData independently it would break this algo. (This isn't the case for probe-rs, I'm not sure it is for pyocd?) Other flash algos do all data accesses relative to R9. Specifying I'm not sure what's the best way forward here. |
I'm not sure what other tools do, but just renaming the |
I see. Given that RWPI doesn't work, it's probably best to not have the pyocd's algo parser can be updated to not require PrgData. (pyocd does currently ensure that the PrgData regions are placed at the same offset from PrgCode as described in the ELF, so it would work regardless.) |
Change .text to PrgCode to match the section name expected by tools that work with the CMSIS-Pack Keil flash algo format. Added comment documenting this and why .data/.bss input sections are not separated.
Updated the linker script to just change the output section name to |
👍 Nice, thanks! If not having PrgData is a problem, maybe we can add an empty PrgData too. |
Separate sections for read-only and read-write are needed by pyocd's conversion script and generally good to have split out since the ELF section attributes are quite different. These section names match the names used in Keil µVision generated FLM files, and thus are more compatible. (Otherwise, I'd have used the standard names; I'm not particularly fond of
PrgCode
andPrgData
.)And yes, there are two
PrgData
sections, but with different ELF attributes.