-
Notifications
You must be signed in to change notification settings - Fork 71
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
memory.x or probe-run "fix" #165
Comments
I don't have much experience in this area, but @allexoll on Element explained it for me:
It sounds like we need to remove |
yes, usually, a device driver crate does not need a memory.x linker script. Usually, it will be used like this:
|
I see that a dependency on
I don't see how to use a dev-dependency to get the linker to find |
basically, you need one, and only one memory.x per executable (not per crate, per executable). Usually, this comes from either the hal, or you provide it yourself. for example
adding this to a driver for a display does not make sense, since the driver is intended to be usable with different MCU, and therefore with different memory layouts. If you want to have buildable and runnable example in this repository, you'll need to find a way to have it only included for those examples, and not for projects that include this driver, since it probably will be the wrong one for their MCU. i think that could be either done in cargo/config (i think this is not used when used as a crate) with something like "linker-arg=Tmemory.x". in any case, having I hope it's more clear now |
Thanks @allexoll that is more clear. I see that with |
On a forked branch
The examples in Let me know if you want me to submit a PR. |
ssd1306
in use (if applicable): current git versionDescription of the problem/feature request/other
I was stripping down my
Cargo.toml
to report a runtime problem with another crate and discovered that removing the unusedssd1306
gives me a linker problem compiling the example for a completely different crate:At first I thought the
ssd1306
build was "fixing" the link failure by copying a (STM32F103C8T6)memory.x
file from thessd1306
crate root into thetarget
directory. But deleting those does not "unfix" the linker, so I suspect something with the build scripts or probe-run. I can do the proper fix by providing the correctmemory.x
, but I would like to understand what is going on, and most importantly be sure I am getting the proper memory map on various MCUs.Any ideas?
The text was updated successfully, but these errors were encountered: