Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

LPC11xx experimental branch #318

Merged
merged 25 commits into from
Jul 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9d51d7a
Added very basic cortex-m0 support
farcaller Jun 26, 2015
85e4af9
Added derive(PartialEq) for ioreg enums
farcaller Jun 26, 2015
7f5f0be
Added docattr for ioreg placement getter
farcaller Jun 26, 2015
1bba7f0
Silenced a warning in shared::NoInterrupts
farcaller Jun 26, 2015
aba3c06
Added prologue and filename to svd template
farcaller Jun 26, 2015
497b3b8
Added lpc11xx svd file
farcaller Jun 26, 2015
8034847
Updated volatile_cell to use expectext
farcaller Jun 26, 2015
bdcdfc8
Added basic lpc11xx code
farcaller Jun 26, 2015
c4aada8
volatile_cell replayer is now thread-safe
farcaller Jun 27, 2015
39b90c6
Panic is ISR are switched over to bootloader
farcaller Jun 27, 2015
539584a
Test code in volatile_cell is feature=replayer now
farcaller Jul 9, 2015
2e78f9a
Added layout.ld for lpc, based on lpc1114 values
farcaller Jul 9, 2015
fcc7439
Added software-reset support for peripherals
farcaller Jul 9, 2015
20ca3ea
Switch travis to jenkins build script
farcaller Jul 9, 2015
d6d370f
Remove feature guard from lpc11xx hal
farcaller Jul 9, 2015
cfe69ec
Switch to hackndev fork of rlibc
farcaller Jul 9, 2015
107e7fa
Require feature 'test' to pull in volatile_cell replayer
farcaller Jul 13, 2015
fb37e62
Added missing apidocs
farcaller Jul 13, 2015
43343c0
Build only lib & examples for cross-build
farcaller Jul 13, 2015
a53ab13
Refactored demo apps into crates
farcaller Jul 14, 2015
44a291f
Drop .debug_gdb_scripts section (made binaries too big)
farcaller Jul 18, 2015
1d68e91
Build examples in release mode
farcaller Jul 18, 2015
579fbd1
Fixed a typo module name
farcaller Jul 18, 2015
3ff50d3
Cleaned up layout of hal/mod.rs so feature guards are more obvious
farcaller Jul 18, 2015
8d1e1a2
Added missing isr to cortex-m0
farcaller Jul 18, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ autom4te.cache
Makefile
/cov
*.pyc
/examples/*/*.json
23 changes: 3 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,12 @@ before_install:
- wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xzf master.tar.gz
- (mkdir kcov-master/build && cd kcov-master/build && cmake .. && make && make install DESTDIR=../tmp)
script:
- ./configure --host=arm-none-eabi
- cargo build --target=$TARGET --verbose --features mcu_$PLATFORM
- ./support/build-examples.sh
after_script:
- cargo test --lib --verbose
- (cd ./ioreg; cargo build --verbose; cargo test --verbose)
- (kcov-master/tmp/usr/local/bin/kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo,ioreg/tests target/kcov ioreg/target/debug/test-*)
- (cd ./platformtree; cargo build --verbose; cargo test --verbose)
- (cd ./macro_platformtree; cargo build --verbose; cargo test --verbose)
- (cd ./macro_zinc; cargo test --verbose)
- (kcov-master/tmp/usr/local/bin/kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/zinc-*)

- ./support/build-jenkins.sh
env:
matrix:
- PLATFORM=native
- PLATFORM=lpc11xx
- PLATFORM=lpc17xx
TARGET=thumbv7m-none-eabi
EXAMPLES="blink blink_pt uart dht22 empty"
- PLATFORM=k20
TARGET=thumbv7em-none-eabi
EXAMPLES="blink_k20 blink_k20_isr empty"
- PLATFORM=stm32f4
TARGET=thumbv7em-none-eabi
EXAMPLES="blink_stm32f4 empty"
- PLATFORM=stm32l1
TARGET=thumbv7m-none-eabi
EXAMPLES="blink_stm32l1 bluenrg_stm32l1 usart_stm32l1 empty"
72 changes: 11 additions & 61 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ name = "zinc"
crate-type = ["lib"]

[features]
test = ["volatile_cell/replayer"]

cpu_cortex-m0 = []
cpu_cortex-m3 = []
cpu_cortex-m4 = []

mcu_lpc11xx = ["cpu_cortex-m0"]
mcu_lpc17xx = ["cpu_cortex-m3"]
mcu_stm32f4 = ["cpu_cortex-m4"]
mcu_stm32l1 = ["cpu_cortex-m3"]
mcu_k20 = ["cpu_cortex-m4"]
mcu_tiva_c = ["cpu_cortex-m4"]
multitasking = ["cpu_cortex-m4"]

[target.thumbv6-none-eabi.dependencies.core]
git = "https://github.com/hackndev/rust-libcore"

[target.thumbv7m-none-eabi.dependencies.core]
git = "https://github.com/hackndev/rust-libcore"

Expand All @@ -32,9 +39,12 @@ path = "./ioreg"
path = "./volatile_cell"

[dependencies.rlibc]
git = "https://github.com/mcoffin/rlibc"
git = "https://github.com/hackndev/rlibc"
branch = "zinc"

[dev-dependencies]
expectest = "*"

[dev-dependencies.platformtree]
path = "./platformtree"

Expand All @@ -43,63 +53,3 @@ path = "./macro_platformtree"

[dev-dependencies.macro_zinc]
path = "./macro_zinc"

[[example]]
name = "nothing"
path = "examples/nothing.rs"

[[example]]
name = "blink"
path = "examples/blink.rs"

[[example]]
name = "blink_k20"
path = "examples/blink_k20.rs"

[[example]]
name = "blink_k20_isr"
path = "examples/blink_k20_isr.rs"

[[example]]
name = "blink_pt"
path = "examples/blink_pt.rs"

[[example]]
name = "blink_stm32f4"
path = "examples/blink_stm32f4.rs"

[[example]]
name = "blink_stm32l1"
path = "examples/blink_stm32l1.rs"

[[example]]
name = "blink_tiva_c"
path = "examples/blink_tiva_c.rs"

[[example]]
name = "bluenrg_stm32l1"
path = "examples/bluenrg_stm32l1.rs"

[[example]]
name = "dht22"
path = "examples/dht22.rs"

[[example]]
name = "empty"
path = "examples/empty.rs"

[[example]]
name = "lcd_tiva_c"
path = "examples/lcd_tiva_c.rs"

[[example]]
name = "uart"
path = "examples/uart.rs"

[[example]]
name = "uart_tiva_c"
path = "examples/uart_tiva_c.rs"

[[example]]
name = "usart_stm32l1"
path = "examples/usart_stm32l1.rs"
11 changes: 8 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ fn get_platform() -> Option<String> {
}

fn copy_linker_scripts<P: AsRef<Path>, Q: AsRef<Path>>(target: P, out_path: Q) -> io::Result<()> {
let path_prefix = if env::var("CARGO_MANIFEST_DIR").unwrap().find("/examples/").is_none() {
Path::new(".")
} else {
Path::new("./../..")
};
// Try copying the linker scripts
let target_dir = Path::new("src/hal").join(target);
let out_dir: &Path = out_path.as_ref();
try!(fs::copy("src/hal/layout_common.ld", out_dir.join("layout_common.ld")));
try!(fs::copy(target_dir.join("iomem.ld"), out_dir.join("iomem.ld")));
try!(fs::copy(target_dir.join("layout.ld"), out_dir.join("layout.ld")));
try!(fs::copy(path_prefix.join("src/hal/layout_common.ld"), out_dir.join("layout_common.ld")));
try!(fs::copy(path_prefix.join(target_dir.join("iomem.ld")), out_dir.join("iomem.ld")));
try!(fs::copy(path_prefix.join(target_dir.join("layout.ld")), out_dir.join("layout.ld")));

Ok(())
}
Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,9 @@ CC=$GCC


case $PLATFORM in
lpc11xx)
platform_target=thumbv6-none-eabi
;;
lpc17xx | stm32l1)
platform_target=thumbv7m-none-eabi
;;
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ AC_SUBST(CC, $GCC)
AC_ARG_VAR(PLATFORM, [Platform for which to build])

case $PLATFORM in
lpc11xx)
platform_target=thumbv6-none-eabi
;;
lpc17xx | stm32l1)
platform_target=thumbv7m-none-eabi
;;
Expand Down
12 changes: 12 additions & 0 deletions examples/blink_k20/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "blink"
version = "0.0.1"

[features]
default = ["mcu_k20"]
mcu_k20 = ["zinc/mcu_k20"]

[dependencies]
zinc = { path = "../.." }
macro_zinc = { path = "../../macro_zinc" }
core = { git = "https://github.com/hackndev/rust-libcore" }
3 changes: 2 additions & 1 deletion examples/blink_k20.rs → examples/blink_k20/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ extern crate core;
extern crate zinc;

use core::option::Option::Some;

use zinc::hal::cortex_m4::systick;
use zinc::hal::k20::{pin, watchdog};
use zinc::hal::pin::Gpio;
use zinc::hal::cortex_m4::systick;

/// Wait the given number of SysTick ticks
pub fn wait(ticks: u32) {
Expand Down
11 changes: 11 additions & 0 deletions examples/blink_k20_isr/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "blink_k20_isr"
version = "0.0.1"

[features]
default = ["mcu_k20"]
mcu_k20 = ["zinc/mcu_k20"]

[dependencies]
zinc = { path = "../.." }
core = { git = "https://github.com/hackndev/rust-libcore" }
12 changes: 12 additions & 0 deletions examples/blink_lpc17xx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "blink"
version = "0.0.1"

[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]

[dependencies]
zinc = { path = "../.." }
macro_zinc = { path = "../../macro_zinc" }
core = { git = "https://github.com/hackndev/rust-libcore" }
7 changes: 4 additions & 3 deletions examples/blink.rs → examples/blink_lpc17xx/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
extern crate core;
extern crate zinc;

use zinc::hal::timer::Timer;
use core::option::Option::Some;

use zinc::hal::lpc17xx::{pin, timer};
use zinc::hal::pin::GpioDirection;
use zinc::hal::pin::Gpio;
use core::option::Option::Some;
use zinc::hal::pin::GpioDirection;
use zinc::hal::timer::Timer;

#[zinc_main]
pub fn main() {
Expand Down
12 changes: 12 additions & 0 deletions examples/blink_pt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "blink"
version = "0.0.1"

[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]

[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
core = { git = "https://github.com/hackndev/rust-libcore" }
File renamed without changes.
12 changes: 12 additions & 0 deletions examples/blink_stm32f4/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "blink_stm32f4"
version = "0.0.1"

[features]
default = ["mcu_stm32f4"]
mcu_stm32f4 = ["zinc/mcu_stm32f4"]

[dependencies]
zinc = { path = "../.." }
macro_zinc = { path = "../../macro_zinc" }
core = { git = "https://github.com/hackndev/rust-libcore" }
12 changes: 12 additions & 0 deletions examples/blink_stm32l1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "blink_stm32l1"
version = "0.0.1"

[features]
default = ["mcu_stm32l1"]
mcu_stm32l1 = ["zinc/mcu_stm32l1"]

[dependencies]
zinc = { path = "../.." }
macro_zinc = { path = "../../macro_zinc" }
core = { git = "https://github.com/hackndev/rust-libcore" }
12 changes: 12 additions & 0 deletions examples/blink_tiva_c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "blink_tiva_c"
version = "0.0.1"

[features]
default = ["mcu_tiva_c"]
mcu_tiva_c = ["zinc/mcu_tiva_c"]

[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
core = { git = "https://github.com/hackndev/rust-libcore" }
11 changes: 11 additions & 0 deletions examples/bluenrg_stm32l1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "bluenrg_stm32l1"
version = "0.0.1"

[features]
default = ["mcu_stm32l1"]
mcu_stm32l1 = ["zinc/mcu_stm32l1"]

[dependencies]
zinc = { path = "../.." }
core = { git = "https://github.com/hackndev/rust-libcore" }
12 changes: 12 additions & 0 deletions examples/dht22/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "dht22"
version = "0.0.1"

[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]

[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
core = { git = "https://github.com/hackndev/rust-libcore" }
File renamed without changes.
16 changes: 16 additions & 0 deletions examples/empty/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "empty"
version = "0.0.1"

[features]
mcu_lpc11xx = ["zinc/mcu_lpc11xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
mcu_stm32f4 = ["zinc/mcu_stm32f4"]
mcu_stm32l1 = ["zinc/mcu_stm32l1"]
mcu_k20 = ["zinc/mcu_k20"]
mcu_tiva_c = ["zinc/mcu_tiva_c"]

[dependencies]
zinc = { path = "../.." }
macro_zinc = { path = "../../macro_zinc" }
core = { git = "https://github.com/hackndev/rust-libcore" }
File renamed without changes.
12 changes: 12 additions & 0 deletions examples/lcd_tiva_c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "lcd_tiva_c"
version = "0.0.1"

[features]
default = ["mcu_tiva_c"]
mcu_tiva_c = ["zinc/mcu_tiva_c"]

[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
core = { git = "https://github.com/hackndev/rust-libcore" }
File renamed without changes.
9 changes: 0 additions & 9 deletions examples/nothing.rs

This file was deleted.

12 changes: 12 additions & 0 deletions examples/uart/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "uart"
version = "0.0.1"

[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]

[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
core = { git = "https://github.com/hackndev/rust-libcore" }
File renamed without changes.
12 changes: 12 additions & 0 deletions examples/uart_tiva_c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "uart_tiva_c"
version = "0.0.1"

[features]
default = ["mcu_tiva_c"]
mcu_tiva_c = ["zinc/mcu_tiva_c"]

[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
core = { git = "https://github.com/hackndev/rust-libcore" }
Loading