-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
65 lines (59 loc) · 1.38 KB
/
Makefile.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
[env]
BUILD = "./target/thumbv6m-none-eabi/debug/examples"
DEVICE = "ATSAMD21E18"
IF = "SWD"
SPEED = "2000"
[tasks.build]
command = "cargo"
args = ["build", "--example", "${@}"]
[tasks.debug]
dependencies = ["build"]
script = [
'''
JLinkGDBServer -device ${DEVICE} -if ${IF} -speed ${SPEED} > /dev/null &
PID=$!
script -q /dev/null -c \
"arm-none-eabi-gdb ${BUILD}/${@} \
-ex 'set print asm-demangle on' \
-ex 'target extended-remote :2331' \
-ex 'monitor semihosting enable' \
-ex 'monitor semihosting IOClient 3' \
-ex 'monitor reset' \
-ex 'load' \
-ex 'monitor reg sp=(0x00002000)' \
-ex 'monitor reg pc=(0x00002004)'"
kill -2 $PID
'''
]
[tasks.flash]
dependencies = ["bin"]
script = [
'''
JLinkExe -device ${DEVICE} -if ${IF} -speed ${SPEED} << EOF
halt
loadbin ${BUILD}/${@}.bin 0x00000000
r
go
exit
EOF
'''
]
[tasks.erase]
script = [
'''
JLinkExe -device ${DEVICE} -if ${IF} -speed ${SPEED} << EOF
halt
erase
r
exit
EOF
'''
]
[tasks.bin]
dependencies = ["build"]
command = "arm-none-eabi-objcopy"
args = ["${BUILD}/${@}", "-O", "binary", "${BUILD}/${@}.bin"]
[tasks.uf2]
dependencies = ["bin"]
command = "uf2conv"
args = ["-b", "0x2000", "-f", "0x68ed2b88", "-o", "${@}.uf2", "${BUILD}/${@}.bin"]