Skip to content

Commit

Permalink
Add more convenience params to .cargo/config, update README.md accord…
Browse files Browse the repository at this point in the history
…ingly. Lock embedded-hal version.
  • Loading branch information
cr1901 committed Feb 19, 2022
1 parent b2c4931 commit 2565317
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ rustflags = [
[build]
# Only one target to support for all chips!
target = "msp430-none-elf"

[unstable]
# MSP430 doesn't come with libcore compiled already. But when it does, this
# key can be removed.
build-std = ["core"]
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ features = ["rt"]

{% if examples == "yes" %}
[dev-dependencies]
embedded-hal = "1.0.0-alpha.6"
embedded-hal = "=1.0.0-alpha.6"
nb = "1.0.0"
fixed = "1.6.0"
fixed-macro = "1.1.1"
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,24 @@ This project is developed and maintained by the [MSP430 team][team].

5. Build the template application or one of the examples. Some examples
(such as `timer` or `temp-hal`) may not compile due to size
constraints when building using the `dev` profile (the default).
constraints when building using the `dev` profile (the default). Pass the
`--release` option to `cargo build` in these cases.

``` console
$ cargo build -Zbuild-std=core
$ cargo build -Zbuild-std=core --examples
$ cargo build
$ cargo build --examples
```

Note that due to [`.cargo/config`](.cargo/config), the above is shorthand
for:

``` console
$ cargo build --target=msp430-none-elf -Zbuild-std=core
$ cargo build --target=msp430-none-elf -Zbuild-std=core --examples
```

You may wish to experiment with other commented options in `.cargo/config`.

6. Once you have an ELF binary built, flash it to your microcontroller. Use [`mspdebug`](https://github.com/dlbeer/mspdebug) to launch a debug session and `msp430-elf-gdb` with the linked gdb script. For the msp430g2553 and the MSP-EXP430G2 launchpad board this looks like the following:

In one terminal session
Expand Down

0 comments on commit 2565317

Please sign in to comment.