26 Commits

Author SHA1 Message Date
bors[bot]
217ebb3a79 Merge #42
42: v0.3.4 r=therealprof a=japaric

a few more updates before the next release

r? @rust-embedded/cortex-m

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-08-28 14:07:43 +00:00
Jorge Aparicio
5063e90960 v0.3.4 2018-08-28 15:56:49 +02:00
bors[bot]
73ced50a21 Merge #41
41: use LLD as the default linker r=therealprof a=japaric

closes #39

I added instructions on how to switch to a different linker to .cargo/config but
I don't think that's too visible. Beginners are unlikely to look into that file
if they run into problems with the default linker. Any suggestions to improve
the visibility of that information?

Also, don't merge this until the default linker changes for the Cortex-M targets
on nightly as this relies on that change.

r? @rust-embedded/cortex-m

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-08-28 13:15:12 +00:00
Jorge Aparicio
b89c76e3fc use size instead of arm-none-eabi-size 2018-08-28 14:55:02 +02:00
Jorge Aparicio
7bb74b2123 fix some warnings 2018-08-28 14:54:40 +02:00
Jorge Aparicio
0eaa0de3c6 update the minimal example 2018-08-27 22:52:02 +02:00
Jorge Aparicio
3e39a0b927 publish docs on GH pages 2018-08-27 17:44:55 +02:00
Jorge Aparicio
a79ea9bee7 bump dependencies to not depend on arm-none-eabi-gcc 2018-08-27 17:39:07 +02:00
Jorge Aparicio
34d34975c3 update symptom for the 'overwrite .cargo/config' problem 2018-08-27 15:19:48 +02:00
Jorge Aparicio
72e914069c use LLD as the default linker
closes #39
2018-08-25 19:32:28 +02:00
Jorge Aparicio
014dab642a tweak bors.toml 2018-08-11 19:37:39 -05:00
bors[bot]
cb68ff7248 Merge #40
40: v0.3.3 r=adamgreig a=japaric

changes required to publish a new version

r? @adamgreig (chosen at random)

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-08-07 22:33:55 +00:00
Jorge Aparicio
55f44f21be v0.3.3 2018-08-07 17:25:15 -05:00
bors[bot]
f38979def1 Merge #27
27: Clarify purpose of rerun-if-changed in build.rs r=japaric a=adamgreig

The current `build.rs` contains
```rust
    println!("cargo:rerun-if-changed=build.rs");
    println!("cargo:rerun-if-changed=memory.x");
```

This causes the build script to be re-run if (and *only if*) `build.rs` or `memory.x` change. The line for `build.rs` is redundant: the Cargo guide [says](https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script) the build script is always rerun when `build.rs` changes, so we can drop that line.

The remaining line caused me a bit of confusion when adding other functionality to my project's build script, before I realised it tells Cargo to *only* rerun the build script when `memory.x` changes, as opposed to the default behaviour which is to rerun it on every build. The comment helps clarify the point of this line, so if users add other functionality to their build scripts it is hopefully easier to notice.

Co-authored-by: Adam Greig <adam@adamgreig.com>
2018-08-07 21:14:34 +00:00
Adam Greig
ba27df0b57 Update comment on rerun-if-changed to better reflect what it does 2018-08-07 20:58:00 +01:00
Adam Greig
f39fa8ebef Add comment to build script about rerun-if-changed, and remove redundant line for build.rs 2018-08-07 20:57:02 +01:00
Jorge Aparicio
5832d097c6 README: mention the CoC and who maintains this repo 2018-08-07 00:25:15 -05:00
Jorge Aparicio
2a2879a3b0 add CODEOWNERS, CoC; tweak bors and Travis 2018-08-06 21:41:02 -05:00
bors[bot]
daea420f17 Merge #38
38: stop recommending LLD r=japaric a=japaric

until https://bugs.llvm.org/show_bug.cgi?id=38435 is fixed

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-08-03 02:39:19 +00:00
Jorge Aparicio
b7884948b2 fix the allocator example 2018-08-02 21:38:42 -05:00
Jorge Aparicio
01e9a597c1 stop recommending LLD
until https://bugs.llvm.org/show_bug.cgi?id=38435 is fixed
2018-08-02 21:12:11 -05:00
Jorge Aparicio
ae503ee8fb v0.3.2 2018-06-19 19:53:30 -05:00
bors[bot]
4a398df058 Merge #33
33: Update panic-semihosting dependency to 0.3.0 r=japaric a=plaes

This is due to #[lang = "panic_fmt"] -> #[panic_implementation] breakage

Co-authored-by: Priit Laes <plaes@plaes.org>
2018-06-20 00:46:27 +00:00
Priit Laes
efb84ccf53 Update panic-semihosting dependency to 0.3.0
This is due to #[lang = "panic_fmt"] -> #[panic_implementation] breakage
2018-06-17 09:23:23 +03:00
Jorge Aparicio
a462ab027d Merge pull request #30 from MrBuddyCasino/master
minor doc fix: git => cargo
2018-05-16 12:50:57 +02:00
Michael Böckling
6da25bced8 Update lib.rs
fixed doc: clone command should be cargo, not git
2018-05-16 11:00:33 +02:00
16 changed files with 173 additions and 106 deletions

View File

@@ -1,50 +1,56 @@
[target.thumbv6m-none-eabi] [target.thumbv6m-none-eabi]
runner = 'arm-none-eabi-gdb' runner = 'arm-none-eabi-gdb'
rustflags = [ rustflags = [
"-C", "link-arg=-Wl,-Tlink.x", # LLD (shipped with the Rust toolchain) is used as the default linker
"-C", "link-arg=-nostartfiles", "-C", "link-arg=-Tlink.x",
# uncomment to use rustc LLD to link programs (a) # if you run into problems with LLD switch to the GNU linker by commenting out
# "-C", "link-arg=-Tlink.x", # this line
# "-C", "linker=lld", # "-C", "linker=arm-none-eabi-ld",
# "-Z", "linker-flavor=ld.lld",
# if you need to link to pre-compiled C libraries provided by a C toolchain
# use GCC as the linker by commenting out both lines above and then
# uncommenting the three lines below
# "-C", "linker=arm-none-eabi-gcc",
# "-C", "link-arg=-Wl,-Tlink.x",
# "-C", "link-arg=-nostartfiles",
] ]
[target.thumbv7m-none-eabi] [target.thumbv7m-none-eabi]
runner = 'arm-none-eabi-gdb' runner = 'arm-none-eabi-gdb'
rustflags = [ rustflags = [
"-C", "link-arg=-Wl,-Tlink.x", # the comments under `[target.thumbv6m-none-eabi]` also apply here
"-C", "link-arg=-nostartfiles", "-C", "link-arg=-Tlink.x",
# uncomment to use rustc LLD to link programs (a) # "-C", "linker=arm-none-eabi-ld",
# "-C", "link-arg=-Tlink.x",
# "-C", "linker=lld", # "-C", "linker=arm-none-eabi-gcc",
# "-Z", "linker-flavor=ld.lld", # "-C", "link-arg=-Wl,-Tlink.x",
# "-C", "link-arg=-nostartfiles",
] ]
[target.thumbv7em-none-eabi] [target.thumbv7em-none-eabi]
runner = 'arm-none-eabi-gdb' runner = 'arm-none-eabi-gdb'
rustflags = [ rustflags = [
"-C", "link-arg=-Wl,-Tlink.x", # the comments under `[target.thumbv6m-none-eabi]` also apply here
"-C", "link-arg=-nostartfiles", "-C", "link-arg=-Tlink.x",
# uncomment to use rustc LLD to link programs (a) # "-C", "linker=arm-none-eabi-ld",
# "-C", "link-arg=-Tlink.x",
# "-C", "linker=lld", # "-C", "linker=arm-none-eabi-gcc",
# "-Z", "linker-flavor=ld.lld", # "-C", "link-arg=-Wl,-Tlink.x",
# "-C", "link-arg=-nostartfiles",
] ]
[target.thumbv7em-none-eabihf] [target.thumbv7em-none-eabihf]
runner = 'arm-none-eabi-gdb' runner = 'arm-none-eabi-gdb'
rustflags = [ rustflags = [
"-C", "link-arg=-Wl,-Tlink.x", # the comments under `[target.thumbv6m-none-eabi]` also apply here
"-C", "link-arg=-nostartfiles", "-C", "link-arg=-Tlink.x",
# uncomment to use rustc LLD to link programs (a) # "-C", "linker=arm-none-eabi-ld",
# "-C", "link-arg=-Tlink.x",
# "-C", "linker=lld", # "-C", "linker=arm-none-eabi-gcc",
# "-Z", "linker-flavor=ld.lld", # "-C", "link-arg=-Wl,-Tlink.x",
# "-C", "link-arg=-nostartfiles",
] ]
# (a) you also need to comment out the other two `link-arg` lines. But note that as of v0.6.0 LLD
# has a bug where it mislinks FFI calls and they up crashing the program at runtime

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @rust-embedded/cortex-m

4
.github/bors.toml vendored Normal file
View File

@@ -0,0 +1,4 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = ["continuous-integration/travis-ci/push"]

View File

@@ -2,33 +2,25 @@ language: rust
matrix: matrix:
include: include:
- env: TARGET=x86_64-unknown-linux-gnu
rust: nightly
if: branch = master AND type != pull_request
- env: TARGET=thumbv6m-none-eabi - env: TARGET=thumbv6m-none-eabi
rust: nightly rust: nightly
addons: if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
apt:
packages:
- gcc-arm-none-eabi
- env: TARGET=thumbv7m-none-eabi - env: TARGET=thumbv7m-none-eabi
rust: nightly rust: nightly
addons: if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
apt:
packages:
- gcc-arm-none-eabi
- env: TARGET=thumbv7em-none-eabi - env: TARGET=thumbv7em-none-eabi
rust: nightly rust: nightly
addons: if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
apt:
packages:
- gcc-arm-none-eabi
- env: TARGET=thumbv7em-none-eabihf - env: TARGET=thumbv7em-none-eabihf
rust: nightly rust: nightly
addons: if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
apt:
packages:
- gcc-arm-none-eabi
before_install: set -e before_install: set -e
@@ -38,6 +30,9 @@ install:
script: script:
- bash ci/script.sh - bash ci/script.sh
after_success:
- bash ci/after-success.sh
after_script: set +e after_script: set +e
cache: cargo cache: cargo
@@ -48,6 +43,7 @@ before_cache:
branches: branches:
only: only:
- master
- staging - staging
- trying - trying

View File

@@ -5,6 +5,23 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased] ## [Unreleased]
## [v0.3.3] - 2018-08-07
### Changed
- Stopped recommending LLD as it requires an unstable feature.
### Fixed
- The allocator example. It now uses the `#[alloc_error_handler]` attribute
instead of the unstable `oom` lang item.
## [v0.3.2] - 2018-06-19
### Fixed
- Bumped the panic-semihosting dependency to fix some examples when compiling with latest nightly.
## [v0.3.1] - 2018-05-13 ## [v0.3.1] - 2018-05-13
- Document the standard `main` interface issue in the troubleshooting guide. - Document the standard `main` interface issue in the troubleshooting guide.
@@ -172,7 +189,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Initial release - Initial release
[Unreleased]: https://github.com/japaric/cortex-m-quickstart/compare/v0.3.1...HEAD [Unreleased]: https://github.com/japaric/cortex-m-quickstart/compare/v0.3.3...HEAD
[v0.3.3]: https://github.com/japaric/cortex-m-quickstart/compare/v0.3.2...v0.3.3
[v0.3.2]: https://github.com/japaric/cortex-m-quickstart/compare/v0.3.1...v0.3.2
[v0.3.1]: https://github.com/japaric/cortex-m-quickstart/compare/v0.3.0...v0.3.1 [v0.3.1]: https://github.com/japaric/cortex-m-quickstart/compare/v0.3.0...v0.3.1
[v0.3.0]: https://github.com/japaric/cortex-m-quickstart/compare/v0.2.7...v0.3.0 [v0.3.0]: https://github.com/japaric/cortex-m-quickstart/compare/v0.2.7...v0.3.0
[v0.2.7]: https://github.com/japaric/cortex-m-quickstart/compare/v0.2.6...v0.2.7 [v0.2.7]: https://github.com/japaric/cortex-m-quickstart/compare/v0.2.6...v0.2.7

37
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,37 @@
# The Rust Code of Conduct
## Conduct
**Contact**: [Cortex-M team](https://github.com/rust-embedded/wg#the-cortex-m-team)
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
* Please be kind and courteous. There's no need to be mean or rude.
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Cortex-M team][team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
## Moderation
These are the policies for upholding our community's standards of conduct.
1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
3. Moderators will first respond to such remarks with a warning.
4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of the communication channel to cool off.
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology.
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, **in private**. Complaints about bans in-channel are not allowed.
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.
In the Rust community we strive to go the extra step to look out for each other. Don't just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they're off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
The enforcement policies listed above apply to all official embedded WG venues; including official IRC channels (#rust-embedded); GitHub repositories under rust-embedded; and all forums under rust-embedded.org (forum.rust-embedded.org).
*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*
[team]: https://github.com/rust-embedded/wg#the-cortex-m-team

View File

@@ -2,17 +2,18 @@
authors = ["Jorge Aparicio <jorge@japaric.io>"] authors = ["Jorge Aparicio <jorge@japaric.io>"]
categories = ["embedded", "no-std"] categories = ["embedded", "no-std"]
description = "A template for building applications for ARM Cortex-M microcontrollers" description = "A template for building applications for ARM Cortex-M microcontrollers"
documentation = "https://rust-embedded.github.io/cortex-m-quickstart/cortex_m_quickstart"
keywords = ["arm", "cortex-m", "template"] keywords = ["arm", "cortex-m", "template"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
name = "cortex-m-quickstart" name = "cortex-m-quickstart"
repository = "https://github.com/japaric/cortex-m-quickstart" repository = "https://github.com/japaric/cortex-m-quickstart"
version = "0.3.1" version = "0.3.4"
[dependencies] [dependencies]
cortex-m = "0.5.0" cortex-m = "0.5.6"
cortex-m-rt = "0.5.0" cortex-m-rt = "0.5.3"
cortex-m-semihosting = "0.3.0" cortex-m-semihosting = "0.3.1"
panic-semihosting = "0.2.0" panic-semihosting = "0.3.0"
# Uncomment for the panic example. # Uncomment for the panic example.
# panic-itm = "0.1.1" # panic-itm = "0.1.1"

View File

@@ -2,7 +2,9 @@
> A template for building applications for ARM Cortex-M microcontrollers > A template for building applications for ARM Cortex-M microcontrollers
# [Documentation](https://docs.rs/cortex-m-quickstart) This project is developed and maintained by the [Cortex-M team][team].
# [Documentation](https://rust-embedded.github.io/cortex-m-quickstart/cortex_m_quickstart)
# License # License
@@ -20,3 +22,12 @@ at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions. dual licensed as above, without any additional terms or conditions.
## Code of Conduct
Contribution to this crate is organized under the terms of the [Rust Code of
Conduct][CoC], the maintainer of this crate, the [Cortex-M team][team], promises
to intervene to uphold that code of conduct.
[CoC]: CODE_OF_CONDUCT.md
[team]: https://github.com/rust-embedded/wg#the-cortex-m-team

View File

@@ -1,3 +0,0 @@
status = [
"continuous-integration/travis-ci/push",
]

View File

@@ -12,6 +12,7 @@ fn main() {
.unwrap(); .unwrap();
println!("cargo:rustc-link-search={}", out.display()); println!("cargo:rustc-link-search={}", out.display());
println!("cargo:rerun-if-changed=build.rs"); // Only re-run the build script when memory.x is changed,
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=memory.x"); println!("cargo:rerun-if-changed=memory.x");
} }

20
ci/after-success.sh Normal file
View File

@@ -0,0 +1,20 @@
set -euxo pipefail
main() {
cargo doc
mkdir ghp-import
curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz |
tar --strip-components 1 -C ghp-import -xz
./ghp-import/ghp_import.py target/doc
set +x
git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK
}
# only publish on successful merges to master
if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TARGET = x86_64-unknown-linux-gnu ]; then
main
fi

View File

@@ -1,7 +1,9 @@
set -euxo pipefail set -euxo pipefail
main() { main() {
rustup target add $TARGET if [ $TARGET != x86_64-unknown-linux-gnu ]; then
rustup target add $TARGET
fi
} }
main main

View File

@@ -61,10 +61,12 @@ EOF
examples+=( $ex ) examples+=( $ex )
fi fi
IFS=,;eval arm-none-eabi-size target/$TARGET/release/examples/"{${examples[*]}}" IFS=,;eval size target/$TARGET/release/examples/"{${examples[*]}}"
popd popd
rm -rf $td rm -rf $td
} }
main if [ $TARGET != x86_64-unknown-linux-gnu ]; then
main
fi

View File

@@ -10,7 +10,7 @@
//! --- //! ---
#![feature(alloc)] #![feature(alloc)]
#![feature(global_allocator)] #![feature(alloc_error_handler)]
#![feature(lang_items)] #![feature(lang_items)]
#![no_main] #![no_main]
#![no_std] #![no_std]
@@ -25,6 +25,7 @@ extern crate cortex_m_rt as rt;
extern crate cortex_m_semihosting as sh; extern crate cortex_m_semihosting as sh;
extern crate panic_semihosting; extern crate panic_semihosting;
use core::alloc::Layout;
use core::fmt::Write; use core::fmt::Write;
use alloc_cortex_m::CortexMHeap; use alloc_cortex_m::CortexMHeap;
@@ -54,9 +55,9 @@ fn main() -> ! {
} }
// define what happens in an Out Of Memory (OOM) condition // define what happens in an Out Of Memory (OOM) condition
#[lang = "oom"] #[alloc_error_handler]
#[no_mangle] #[no_mangle]
pub fn rust_oom() -> ! { pub fn alloc_error(_layout: Layout) -> ! {
asm::bkpt(); asm::bkpt();
loop {} loop {}

View File

@@ -15,28 +15,19 @@
//! define a panicking behavior is to link to a [panic handler crate][0] //! define a panicking behavior is to link to a [panic handler crate][0]
//! //!
//! [0]: https://crates.io/keywords/panic-impl //! [0]: https://crates.io/keywords/panic-impl
//!
//! - Define the `HardFault` handler using the [`exception!`] macro. This handler (function) is
//! called when a hard fault exception is raised by the hardware.
//!
//! [`exception!`]: https://docs.rs/cortex-m-rt/~0.5/cortex_m_rt/macro..html
//!
//! - Define a default handler using the [`exception!`] macro. This function will be used to handle
//! all interrupts and exceptions which have not been assigned a specific handler.
#![no_main] // <- IMPORTANT! #![no_main] // <- IMPORTANT!
#![no_std] #![no_std]
extern crate cortex_m; extern crate cortex_m;
#[macro_use(entry, exception)] #[macro_use(entry)]
extern crate cortex_m_rt as rt; extern crate cortex_m_rt as rt;
// makes `panic!` print messages to the host stderr using semihosting // makes `panic!` print messages to the host stderr using semihosting
extern crate panic_semihosting; extern crate panic_semihosting;
use cortex_m::asm; use cortex_m::asm;
use rt::ExceptionFrame;
// the program entry point is ... // the program entry point is ...
entry!(main); entry!(main);
@@ -47,17 +38,3 @@ fn main() -> ! {
asm::bkpt(); asm::bkpt();
} }
} }
// define the hard fault handler
exception!(HardFault, hard_fault);
fn hard_fault(ef: &ExceptionFrame) -> ! {
panic!("HardFault at {:#?}", ef);
}
// define the default exception handler
exception!(*, default_handler);
fn default_handler(irqn: i16) {
panic!("Unhandled exception (IRQn = {})", irqn);
}

View File

@@ -2,9 +2,8 @@
//! //!
//! # Dependencies //! # Dependencies
//! //!
//! - Nightly Rust toolchain newer than `nightly-2018-04-08`: `rustup default nightly` //! - Nightly Rust toolchain from 2018-08-28 or newer: `rustup default nightly`
//! - Cargo `clone` subcommand: `cargo install cargo-clone` //! - Cargo `clone` subcommand: `cargo install cargo-clone`
//! - ARM toolchain: `sudo apt-get install gcc-arm-none-eabi` (on Ubuntu)
//! - GDB: `sudo apt-get install gdb-arm-none-eabi` (on Ubuntu) //! - GDB: `sudo apt-get install gdb-arm-none-eabi` (on Ubuntu)
//! - OpenOCD: `sudo apt-get install OpenOCD` (on Ubuntu) //! - OpenOCD: `sudo apt-get install OpenOCD` (on Ubuntu)
//! - [Optional] Cargo `add` subcommand: `cargo install cargo-edit` //! - [Optional] Cargo `add` subcommand: `cargo install cargo-edit`
@@ -27,7 +26,7 @@
//! 2) Clone this crate //! 2) Clone this crate
//! //!
//! ``` text //! ``` text
//! $ git clone cortex-m-quickstart --vers 0.3.0 //! $ cargo clone cortex-m-quickstart --vers 0.3.4
//! ``` //! ```
//! //!
//! 3) Change the crate name, author and version //! 3) Change the crate name, author and version
@@ -179,11 +178,13 @@
//! ``` text //! ``` text
//! $ cargo build //! $ cargo build
//! Compiling demo v0.1.0 (file:///home/japaric/tmp/demo) //! Compiling demo v0.1.0 (file:///home/japaric/tmp/demo)
//! error: linking with `arm-none-eabi-ld` failed: exit code: 1 //! error: linking with `rust-lld` failed: exit code: 1
//! | //! |
//! = note: "arm-none-eabi-gcc" "-L" (..) //! = note: "rust-lld" "-flavor" "gnu" "-L" (..)
//! (..)
//! = note: rust-lld: error: section '.vector_table' will not fit in region 'FLASH': overflowed by X bytes
//! rust-lld: error: section '.vector_table' will not fit in region 'FLASH': overflowed by Y bytes
//! (..) //! (..)
//! (..)/ld: region `FLASH' overflowed by XXX bytes
//! ``` //! ```
//! //!
//! Solution: Specify your device memory layout in the `memory.x` linker script. See [Usage] //! Solution: Specify your device memory layout in the `memory.x` linker script. See [Usage]
@@ -206,24 +207,15 @@
//! //!
//! ## Overwrote the original `.cargo/config` file //! ## Overwrote the original `.cargo/config` file
//! //!
//! Error message: //! You won't get an error message but the output binary will be empty
//! //!
//! ``` text //! ``` text
//! error: linking with `arm-none-eabi-gcc` failed: exit code: 1 //! $ cargo build && echo OK
//! | //! OK
//! = note: (..) //!
//! (..) //! $ size target/thumbv7m-none-eabi/debug/app
//! (..)/crt0.o: In function `_start': //! text data bss dec hex filename
//! (.text+0x90): undefined reference to `memset' //! 0 0 0 0 0 target/thumbv7m-none-eabi/debug/app
//! (..)/crt0.o: In function `_start':
//! (.text+0xd0): undefined reference to `atexit'
//! (..)/crt0.o: In function `_start':
//! (.text+0xd4): undefined reference to `__libc_init_array'
//! (..)/crt0.o: In function `_start':
//! (.text+0xe4): undefined reference to `exit'
//! (..)/crt0.o: In function `_start':
//! (.text+0x100): undefined reference to `__libc_fini_array'
//! collect2: error: ld returned 1 exit status
//! ``` //! ```
//! //!
//! Solution: You probably overwrote the original `.cargo/config` instead of appending the default //! Solution: You probably overwrote the original `.cargo/config` instead of appending the default