mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-24 23:08:08 +00:00
Merge pull request #102 from justahero/update-build-target-cargo-config
Update entry on building program in workshop book
This commit is contained in:
commit
6b722bd1bf
1 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,7 @@ The default in a Cargo project is to compile for the host (native compilation).
|
||||||
``` text
|
``` text
|
||||||
# .cargo/config
|
# .cargo/config
|
||||||
[build]
|
[build]
|
||||||
target = "thumbv7em-none-eabi" # = ARM Cortex-M4
|
target = "thumbv7em-none-eabihf" # = ARM Cortex-M4
|
||||||
```
|
```
|
||||||
|
|
||||||
✅ Inside the folder `beginner/apps`, use the following command to cross compile the program to the ARM Cortex-M4 architecture.
|
✅ Inside the folder `beginner/apps`, use the following command to cross compile the program to the ARM Cortex-M4 architecture.
|
||||||
|
@ -14,12 +14,12 @@ target = "thumbv7em-none-eabi" # = ARM Cortex-M4
|
||||||
$ cargo build --bin hello
|
$ cargo build --bin hello
|
||||||
```
|
```
|
||||||
|
|
||||||
The output of the compilation process will be an ELF (Executable and Linkable Format) file. The file will be placed in the `target/thumbv7em-none-eabi` directory.
|
The output of the compilation process will be an ELF (Executable and Linkable Format) file. The file will be placed in the `target/thumbv7em-none-eabihf` directory.
|
||||||
|
|
||||||
✅ Run `$ file target/thumbv7em-none-eabi/debug/hello` and compare if your output is as expected.
|
✅ Run `$ file target/thumbv7em-none-eabihf/debug/hello` and compare if your output is as expected.
|
||||||
|
|
||||||
Expected output:
|
Expected output:
|
||||||
``` console
|
``` console
|
||||||
$ file target/thumbv7em-none-eabi/debug/hello
|
$ file target/thumbv7em-none-eabihf/debug/hello
|
||||||
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
|
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
|
||||||
```
|
```
|
Loading…
Reference in a new issue