diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 00000000..7b08c6f8 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,4 @@ +[target.thumbv7em-tock-eabi] +rustflags = [ + "-C link-args=-Tlayout.ld", +] diff --git a/.travis.yml b/.travis.yml index 45620a30..042d0c12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: rust rust: - - nightly-2018-02-23 + - nightly-2018-03-06 os: - linux @@ -12,12 +12,9 @@ cache: - tock/userland/tools/elf2tbf/target install: - - wget -c https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2016q4/gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 - - tar -xjf gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 - rustup component add rust-src script: - - export PATH="$PATH:gcc-arm-none-eabi-6_2-2016q4/bin" - export RUSTFLAGS="$RUSTFLAGS -D warnings" - cargo test --lib - ./build_examples.sh diff --git a/.vscode/settings.json b/.vscode/settings.json index 8c31c0de..0c2fc305 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { "editor.formatOnSave": true, - "rust-client.channel": "nightly-2018-02-23", + "rust-client.channel": "nightly-2018-03-06", } \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 70136178..3206bd73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,4 +19,3 @@ lto = true [profile.release] panic = "abort" lto = true -debug = true diff --git a/README.md b/README.md index b57a6eca..de683b4d 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ This project is nascent and still under heavy development, but first steps: 1. Ensure you have a working toolchain available: - `rustup install nightly-2017-12-16` + `rustup install nightly-2018-03-06` 2. Get a copy of this toolchain, in this repo's root: - `rustup override set nightly-2017-12-16` + `rustup override set nightly-2018-03-06` 3. Need to grab a copy of the rust sources: diff --git a/build_examples.sh b/build_examples.sh index 385a2f0f..485b0322 100755 --- a/build_examples.sh +++ b/build_examples.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash set -eux -export RUST_TARGET_PATH=`pwd` -export CARGO_INCREMENTAL=0 -cargo run --manifest-path xargo/Cargo.toml -- build --release --target=thumbv7em-tock-eabi --examples +RUST_TARGET_PATH=$(pwd) cargo run --manifest-path xargo/Cargo.toml -- build --release --target=thumbv7em-tock-eabi --examples diff --git a/layout.ld b/layout.ld index 82575be0..4df68f94 100644 --- a/layout.ld +++ b/layout.ld @@ -8,10 +8,6 @@ STACK_SIZE = 2048; APP_HEAP_SIZE = 1024; KERNEL_HEAP_SIZE = 1024; -/* Memory Spaces Definitions, 448K flash, 64K ram */ -PROG_LENGTH = 0x00040000; -RAM_LENGTH = 0x00010000; - ENTRY(_start) /* Note: Because apps are relocated, the FLASH address here acts as a sentinel @@ -19,8 +15,8 @@ ENTRY(_start) * actual location in flash where the app is placed. */ MEMORY { - FLASH (rx) : ORIGIN = 0x80000000, LENGTH = PROG_LENGTH - SRAM (RWX) : ORIGIN = 0x00000000, LENGTH = RAM_LENGTH + FLASH (rx) : ORIGIN = 0x80000000, LENGTH = 0x0040000 + SRAM (RWX) : ORIGIN = 0x00000000, LENGTH = 0x0010000 } SECTIONS { diff --git a/run_example.sh b/run_example.sh index 3901858a..c6e7d0ed 100755 --- a/run_example.sh +++ b/run_example.sh @@ -4,14 +4,11 @@ set -eux -export RUST_TARGET_PATH=`pwd` -export CARGO_INCREMENTAL=0 - tab_file_name=metadata.toml elf_file_name=cortex-m4.elf bin_file_name=cortex-m4.bin -cargo run --manifest-path xargo/Cargo.toml -- build --release --target=thumbv7em-tock-eabi --example "$1" +RUST_TARGET_PATH=$(pwd) cargo run --manifest-path xargo/Cargo.toml -- build --release --target=thumbv7em-tock-eabi --example "$1" cp target/thumbv7em-tock-eabi/release/examples/"$1" "target/$elf_file_name" cargo run --manifest-path tock/userland/tools/elf2tbf/Cargo.toml -- -n "$1" -o "target/$bin_file_name" "target/$elf_file_name" @@ -30,7 +27,7 @@ then echo "do not delete apps from board." else tockloader uninstall --jtag --arch cortex-m4 --board nrf52-dk --jtag-device nrf52 --app-address 0x20000 || true - fi + fi else tockloader uninstall --jtag --arch cortex-m4 --board nrf52-dk --jtag-device nrf52 --app-address 0x20000 || true fi diff --git a/rust-toolchain b/rust-toolchain index 9c049752..b62f117c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2018-02-23 \ No newline at end of file +nightly-2018-03-06 diff --git a/thumbv7em-tock-eabi.json b/thumbv7em-tock-eabi.json index 069626d0..51171b2e 100644 --- a/thumbv7em-tock-eabi.json +++ b/thumbv7em-tock-eabi.json @@ -11,13 +11,7 @@ "executables": true, "no-compiler-rt": false, "relocation-model": "ropi-rwpi", - "linker": "arm-none-eabi-ld", - "linker-flavor": "ld", + "linker-flavor": "ld.lld", "linker-is-gnu": true, - "disable-redzone": true, - "pre-link-args": { - "ld": [ - "-Tlayout.ld" - ] - } + "disable-redzone": true } \ No newline at end of file diff --git a/xargo b/xargo index 3b13437c..e06560b1 160000 --- a/xargo +++ b/xargo @@ -1 +1 @@ -Subproject commit 3b13437c131e406b599ec49491394d8941c829ff +Subproject commit e06560b176c11adb6a869748bf17c0a37cf879a2