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

Mention linker flags in README #709

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,23 @@ code (e.g. as produced by GCC), Rust uses the *Arm Embedded-Application Binary
Interface* standard or EABI. Therefore, any Rust code for the RP2040 should be
compiled with the target *`thumbv6m-none-eabi`*.

More details can be found in the [Project Template](https://github.com/rp-rs/rp2040-project-template).
More details can be found in the [Project Template].

### Linker flags

Besides the correct target, which mainly defines the instruction set,
it's also necessary to use a certain memory layout compatible with
the rp2040. To achieve that, rustc must be called with appropriate
linker flags. In the [Project Template], those flags are defined in
[`.cargo/config.toml`](https://github.com/rp-rs/rp2040-project-template/blob/main/.cargo/config.toml).
Another necessary file is
[`memory.x`](https://github.com/rp-rs/rp2040-project-template/blob/main/memory.x).

More detailed information on how the linker flags work can be found in
[the cortex_m_rt docs](https://docs.rs/cortex-m-rt/latest/cortex_m_rt/).

In most cases, it should be sufficient to use the example files from the
[Project Template].

### Loading a UF2 over USB

Expand Down Expand Up @@ -227,6 +243,8 @@ Also of note is that the special
information in the ELF file in a way that `picotool info` can read it out, are
not supported in Rust. An alternative is TBC.

[Project Template]: https://github.com/rp-rs/rp2040-project-template

<!-- ROADMAP -->
## Roadmap

Expand Down
Loading