Skip to content

Commit 938bb36

Browse files
committed
Build codegen with x86_64-unknown-linux-gnu by default
1 parent 2cfe3f1 commit 938bb36

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

codegen/.cargo/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
target = "x86_64-unknown-linux-gnu"

codegen/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ source code of the stm32f3xx-hal crate.
88
For more information on how the STM32CubeMX database is structured, check out
99
the README in the [cube-parse](https://github.com/dbrgn/cube-parse) repository.
1010

11-
Because by default cargo tries to use the `thumbv7em-none-eabihf` target, due
12-
to what's specified in the `.cargo/config`, you need to manually specify your
13-
host's target when building `codegen`, e.g.:
11+
Because by default cargo tries to use the `x86_64-unknown-linux-gnu` target,
12+
when building `codegen`, due to what's specified in the `.cargo/config`, you
13+
need to manually specify your host's target if it differs from that, e.g.:
1414

1515
```
16-
$ cargo run --target x86_64-unknown-linux-gnu -- help
16+
$ cargo run --target x86_64-apple-darwin -- help
1717
```
1818

1919
`codgen` can generate the following code:
2020

21-
- GPIO mappings
21+
- [GPIO mappings](#gpio-mappings)
2222

2323
## GPIO mappings
2424

@@ -27,12 +27,12 @@ invocations at the end of `src/gpio.rs`. Re-generating those macro-invocations
2727
is simply a matter of deleting the old ones and then executing:
2828

2929
```
30-
$ cargo run --target $host_target -- gpio $cubemx_db_path >> ../src/gpio.rs
30+
$ cargo run -- gpio $cubemx_db_path >> ../src/gpio.rs
3131
```
3232

33-
`$cubemx_db_path` must be the path to the `db/mcu` directory under an
33+
`$cubemx_db_path` must be the path to the `db/` directory under an
3434
STM32CubeMX installation. With a default Linux install, this would be
35-
`/opt/stm32cubemx/db/mcu`.
35+
`/opt/stm32cubemx/db`.
3636

3737
The generated `gpio!` invocations are gated by features whose names are derived
3838
from the respective GPIO internal peripheral (IP) version:

0 commit comments

Comments
 (0)