-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ben Lichtman
committed
Apr 8, 2020
0 parents
commit b4f0f1f
Showing
15 changed files
with
900 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,10 @@ | ||
[target.thumbv6m-none-eabi] | ||
runner = 'arm-none-eabi-gdb' | ||
|
||
rustflags = [ | ||
"-C", "link-arg=-Tlink.x", | ||
# "-C", "link-arg=-s", | ||
] | ||
|
||
[build] | ||
target = "thumbv6m-none-eabi" |
This file contains 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,6 @@ | ||
target remote :3333 | ||
monitor arm semihosting enable | ||
set print asm-demangle on | ||
load | ||
break main | ||
continue |
This file contains 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,2 @@ | ||
/target | ||
**/*.rs.bk |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,27 @@ | ||
[package] | ||
name = "uart-buster" | ||
version = "0.1.0" | ||
authors = ["Ben Lichtman"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
# panic-halt = "0.2.0" | ||
panic-semihosting = "0.5.3" | ||
embedded-hal = "0.2.3" | ||
nrf51-hal = "0.7.1" | ||
cortex-m-rt = "0.6.12" | ||
cortex-m-semihosting = "0.3.5" | ||
cortex-m = "0.6.1" | ||
nb = "0.1.2" | ||
alloc-cortex-m = "0.3.5" | ||
|
||
[profile.dev] | ||
debug = true | ||
opt-level = 3 | ||
|
||
[profile.release] | ||
debug = false | ||
lto = "fat" | ||
opt-level = 3 |
This file contains 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,18 @@ | ||
use std::env; | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
// Put the linker script somewhere the linker can find it | ||
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | ||
File::create(out.join("memory.x")) | ||
.unwrap() | ||
.write_all(include_bytes!("memory.x")) | ||
.unwrap(); | ||
println!("cargo:rustc-link-search={}", out.display()); | ||
|
||
// Only re-run the build script when memory.x is changed, | ||
// instead of when any part of the source code changes. | ||
println!("cargo:rerun-if-changed=memory.x"); | ||
} |
This file contains 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 @@ | ||
arm-none-eabi-gdb -q target/thumbv6m-none-eabi/debug/microbit-rust |
This file contains 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 @@ | ||
openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg |
This file contains 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,11 @@ | ||
MEMORY | ||
{ | ||
/* NOTE K = KiBi = 1024 bytes */ | ||
FLASH : ORIGIN = 0x00000000, LENGTH = 256K | ||
RAM : ORIGIN = 0x20000000, LENGTH = 16K | ||
} | ||
|
||
/* This is where the call stack will be allocated. */ | ||
/* The stack is of the full descending type. */ | ||
/* NOTE Do NOT modify `_stack_start` unless you know what you are doing */ | ||
_stack_start = ORIGIN(RAM) + LENGTH(RAM); |
This file contains 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,5 @@ | ||
source [find interface/cmsis-dap.cfg] | ||
source [find target/nrf51.cfg] | ||
|
||
init | ||
flash probe 0 |
Oops, something went wrong.