Skip to content

Commit bd1972e

Browse files
authored
Merge pull request #55 from embed-rs/smoltcp
Use smoltcp for networking
2 parents 843722e + ccab988 commit bd1972e

File tree

31 files changed

+581
-627
lines changed

31 files changed

+581
-627
lines changed

.cargo/config

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
[target.thumbv7em-none-eabihf]
2+
runner = 'sh gdb.sh'
3+
# runner='gdb.bat'
4+
rustflags = [
5+
"-C", "link-arg=-Tstm32f7.ld",
6+
"-C", "linker=arm-none-eabi-ld",
7+
"-Z", "linker-flavor=ld",
8+
"-Z", "thinlto=no",
9+
]
110
[build]
2-
target = "stm32f7"
11+
target = "thumbv7em-none-eabihf"

.gdbinitv8

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
define reset
2+
# reset board by setting the SYSRESETREQ bit it the AIRCR register
3+
# see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/Cihehdge.html
4+
set *(0xE000ED0C_usize as *const usize) = 0x05fa0004
5+
end
6+
7+
define load-reset
8+
reset
9+
load
10+
reset
11+
end
12+
13+
define lr
14+
load-reset
15+
end
16+
17+
define lrc
18+
reset
19+
load
20+
reset
21+
continue
22+
end
23+
24+
define semihosting-enable
25+
source semihosting.py
26+
catch signal SIGTRAP
27+
commands
28+
silent
29+
if (*($pc as *const usize) & 0xff) == 0xab
30+
pi SemiHostHelper.on_break()
31+
set $pc = $pc + 2
32+
continue
33+
else
34+
echo \n
35+
frame
36+
end
37+
end
38+
end

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ before_script:
1010

1111
script:
1212
- docker run stm32f7-discovery sh -c "
13-
xargo build;
14-
cd blinking_led && xargo update && xargo build
13+
set -e;
14+
pwd; ls;
15+
echo `pwd`;
16+
cargo build;
17+
cd blinking_led;
18+
cargo update;
19+
cargo build;
20+
cd ../blinking_led_with_interrupts;
21+
cargo update;
22+
cargo build;
1523
"

.vscode/settings.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

Cargo.lock

Lines changed: 30 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ cortex-m = "0.1.4"
1515
r0 = "0.1.0"
1616
spin = "0.4.5"
1717
volatile = "0.2.1"
18-
net = {git = "https://github.com/embed-rs/net.git"}
1918
rusttype = {git = "https://github.com/phil-opp/rusttype.git", branch = "no_std"}
20-
alloc-cortex-m = {git = "https://github.com/f-bro/alloc-cortex-m.git", branch = "new-alloc-api"}
19+
alloc-cortex-m = {git = "https://github.com/embed-rs/alloc-cortex-m.git", branch = "master" }
2120
bitflags = "0.7.0"
2221

2322
[dependencies.arrayvec]
@@ -27,6 +26,11 @@ version = "0.3.20"
2726
[dependencies.embedded_stm32f7]
2827
git = "https://github.com/embed-rs/embedded_stm32f7.git"
2928

29+
[dependencies.smoltcp]
30+
git = "https://github.com/m-labs/smoltcp.git"
31+
default-features = false
32+
features = ["alloc", "socket-raw", "socket-udp", "socket-tcp", "socket-icmp", "proto-ipv4"]
33+
3034
[profile]
3135

3236
[profile.release]

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ RUN set -ex; \
1212
apt-get clean -q -y; \
1313
rm -rf /var/lib/apt/lists/*; \
1414
cd ..; \
15-
cargo install xargo; \
16-
cd myapp; \
17-
rustup component add rust-src;
15+
rustup default nightly-2018-04-10; \
16+
rustup target add thumbv7em-none-eabihf; \
17+
cd myapp;
18+

Xargo.toml

Lines changed: 0 additions & 8 deletions
This file was deleted.

blinking_led/.cargo/config

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# override the recursive dependency via git to use a path dependency instead
22
paths = [".."]
33

4+
[target.thumbv7em-none-eabihf]
5+
runner = 'sh gdb.sh'
6+
# runner='gdb.bat'
7+
rustflags = [
8+
"-C", "link-arg=-Tstm32f7.ld",
9+
"-C", "linker=arm-none-eabi-ld",
10+
"-Z", "linker-flavor=ld",
11+
"-Z", "thinlto=no",
12+
]
413
[build]
5-
target = "stm32f7"
14+
target = "thumbv7em-none-eabihf"

blinking_led/.gdbinitv8

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
define reset
2+
# reset board by setting the SYSRESETREQ bit it the AIRCR register
3+
# see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/Cihehdge.html
4+
set *(0xE000ED0C_usize as *const usize) = 0x05fa0004
5+
end
6+
7+
define load-reset
8+
reset
9+
load
10+
reset
11+
end
12+
13+
define lr
14+
load-reset
15+
end
16+
17+
define lrc
18+
reset
19+
load
20+
reset
21+
continue
22+
end
23+
24+
define semihosting-enable
25+
source semihosting.py
26+
catch signal SIGTRAP
27+
commands
28+
silent
29+
if (*($pc as *const usize) & 0xff) == 0xab
30+
pi SemiHostHelper.on_break()
31+
set $pc = $pc + 2
32+
continue
33+
else
34+
echo \n
35+
frame
36+
end
37+
end
38+
end

0 commit comments

Comments
 (0)