Skip to content

Commit

Permalink
Link with lld, update cortex-m-rt to use new procedural macros
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlamb-gh committed Sep 7, 2018
1 parent 075e4b9 commit 9e41e6e
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 56 deletions.
11 changes: 4 additions & 7 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
[target.thumbv7em-none-eabihf]
runner = 'arm-none-eabi-gdb'
rustflags = [
"-C", "link-arg=-Wl,-Tlink.x",
"-C", "link-arg=-nostartfiles",

# uncomment to use rustc LLD to link programs (a)
# "-C", "link-arg=-Tlink.x",
# "-C", "linker=lld",
# "-Z", "linker-flavor=ld.lld",
# link with lld
"-C", "link-arg=-Tlink.x",
"-C", "linker=rust-lld",
"-Z", "linker-flavor=ld.lld",
]

[build]
Expand Down
180 changes: 152 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ version = "0.0.1"
authors = ["jonlamb-gh <lamb.jon.io@gmail.com>"]

[dependencies.panic-abort]
version = "0.2.0"
version = "0.3.0"
optional = true

[dependencies.panic-semihosting]
version = "0.3.0"
version = "0.4.0"
optional = true

[dependencies.cortex-m-semihosting]
version = "0.3.0"
version = "0.3.1"
optional = true

[dependencies.cortex-m]
version = "0.5.4"
version = "0.5.7"
features = ["const-fn"]

[dependencies.cortex-m-rt]
version = "0.5.2"
version = "0.6.1"
features = ["device"]

[dependencies.nucleo-f767zi]
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ cargo install --force rustfmt-nightly
rustup target add thumbv7em-none-eabihf

cargo install svd2rust

# currently used for linking
# TODO - switch over to lld
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install gcc-arm-embedded
```

```bash
Expand All @@ -25,6 +19,8 @@ cargo build

## Deploying

Install [stlink](https://github.com/texane/stlink) tools.

```bash
./scripts/deploy

Expand All @@ -39,6 +35,12 @@ st-flash --format ihex write target/thumbv7em-none-eabihf/debug/oxcc.hex

## Debugging

Install OpenOCD:

```bash
sudo apt-get install openocd
```

```bash
./scripts/run-openocd

Expand Down
Loading

0 comments on commit 9e41e6e

Please sign in to comment.