NXP IMXRT10XX Toolchain Linker Issues with SDRAM #95571
Replies: 3 comments 2 replies
-
@dkouba-atym I converted your issue #95083 to this discussion because it is not an issue. But you can give feedback here for how you think the situation can be improved to be more convenient or useful to you. The reason for the redeclaration linker warning when you added the DT prop is because the SOC linker script is still pulled in, in addition to the DT defined linker regions that are defined by a macro in the cortex-m linker script. Before that, the reason for your error is because you are using this compiler section attribute on something that is not a section. "SDRAM" is a memory region, not a section. What you did is add a new input section which didn't have any special rule to apply it into any output section that will go into the SDRAM region, so it ended up just getting put into flash. The reason for why it goes there specifically when this happens, I haven't investigated the details, but it's moot, because the bug was on your code using "SDRAM" as an input section without any linker script describing where that section goes. |
Beta Was this translation helpful? Give feedback.
-
After looking at the linker script you referenced, the purpose is to provide the linker the information that that region exists, but it does not provide the section placement rules. I believe, given the current implementation, and given the possibility that there could be a more generic SEMC solution later that the "cleanest solution" would be to have a custom linker script which has the section placement rules. Something like:
Then you can include the custom section placement rules by adding: to CMakeLists.txt. I am somewhat conflicted on the purpose of the current linker script declaration of the SDRAM region, since it does not provide section placement rules, but it does serve the purpose of ensuring that "SDRAM" is only available to linker in the event that zephyr,sram is directed elsewhere. |
Beta Was this translation helpful? Give feedback.
-
Is there a reason why #95299 won't work and avoid the linker script altogether? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Hi all, we are working with the NXP IMXRT1064 and are intending to use the SDRAM as a memory region for some specific data structures, while the application runs out of OCRAM.
With the default SoC/board configuration (
sdram0
node enabled in the device tree), this linker script is included in the build process which creates a MEMORY region for the SDRAM.However when I try to assign a data structure to the SDRAM region:
This results in a linker error:
To get around this, I add the following to my overlay:
With this, I am able to assign my variable to the region successfully. However, this results in a linker warning:
When I inspect
linker.cmd
, I do see the regions duplicated:To me, it seems like the custom linker script should be removed and this all should be dealt with via the
.dts
file, wrapping in the definition of the memory region usingzephyr,memory-region
. However, I am not well-versed in this area of Zephyr and I don't know what that may break or if that is the recommended standard practice.If someone can provide guidance as to the correct approach to fixing this, I'd be happy to contribute a PR with the changes.
Regression
Steps to reproduce
No response
Relevant log output
Impact
Functional Limitation – Some features not working as expected, but system usable.
Environment
No response
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions