-
Notifications
You must be signed in to change notification settings - Fork 63
update examples #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
update examples #109
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,25 @@ | ||
| [target.thumbv7m-none-eabi] | ||
| [build] | ||
| # Common embedded build targets | ||
| target = "thumbv7em-none-eabihf" | ||
| # target = "thumbv6m-none-eabi" | ||
|
|
||
| [target.thumbv7em-none-eabihf] | ||
| # used to run the qemu_test.rs example with QEMU | ||
| runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" | ||
| rustflags = ["-C", "link-arg=-Tlink.x"] | ||
| runner = "./qemu-runner.sh --target thumbv7em-none-eabihf" | ||
| rustflags = [ | ||
| "-Clink-arg=-Tlink.x", | ||
| "-Clink-arg=-Tdefmt.x", | ||
| # Can be useful for debugging and to inspect where the heap memory is placed/linked. | ||
| # "-Clink-args=-Map=app.map" | ||
| ] | ||
|
|
||
| [target.thumbv6m-none-eabi] | ||
| # used to run the qemu_test.rs example with QEMU | ||
| runner = "./qemu-runner.sh --target thumbv6m-none-eabi" | ||
| rustflags = [ | ||
| "-Clink-arg=-Tlink.x", | ||
| "-Clink-arg=-Tdefmt.x", | ||
| ] | ||
|
|
||
| [env] | ||
| DEFMT_LOG="info" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/bash | ||
|
|
||
| # This requires you to previously run `cargo install defmt-print` | ||
|
|
||
| # See https://ferroussystems.hackmd.io/@jonathanpallant/ryA1S6QDJx for a description of all the relevant QEMU machines | ||
| TARGET="" | ||
| ELF_BINARY="" | ||
|
|
||
| # very small argument parser | ||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --target) TARGET="$2"; shift 2 ;; | ||
| *) ELF_BINARY="$1"; shift ;; | ||
| esac | ||
| done | ||
|
|
||
| # default to the target cargo is currently building for | ||
| TARGET="${TARGET:-thumbv7em-none-eabihf}" | ||
|
|
||
| case "$TARGET" in | ||
| thumbv6m-none-eabi) | ||
| MACHINE="-cpu cortex-m3 -machine mps2-an385" ;; | ||
| thumbv7em-none-eabihf) | ||
| # All suitable for thumbv7em-none-eabihf | ||
| MACHINE="-cpu cortex-m4 -machine mps2-an386" ;; | ||
| # MACHINE="-cpu cortex-m7 -machine mps2-387" ;; | ||
| # MACHINE="-cpu cortex-m7 -machine mps2-500" | ||
| *) | ||
| echo "Unsupported target: $TARGET" >&2 | ||
| exit 1 ;; | ||
| esac | ||
|
|
||
| LOG_FORMAT='{[{L}]%bold} {s} {({ff}:{l:1})%dimmed}' | ||
|
|
||
| echo "Running on '$MACHINE'..." | ||
| echo "------------------------------------------------------------------------" | ||
| qemu-system-arm $MACHINE -semihosting-config enable=on,target=native -nographic -kernel $ELF_BINARY | defmt-print -e $ELF_BINARY --log-format="$LOG_FORMAT" | ||
| echo "------------------------------------------------------------------------" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.