-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCargo.toml
162 lines (141 loc) · 3.71 KB
/
Cargo.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[package]
name = "stm32f4-rtic-renode"
description = "Rust firmware for the AirGradient Pro"
version = "0.1.0"
edition = "2021"
authors = ["Jon Lamb"]
build = "build.rs"
[[bin]]
name = "air-gradient-pro"
path = "src/entry.rs"
[dependencies]
cortex-m = "0.7"
cortex-m-rt = "0.7"
rtic-monotonic = "1.0"
cortex-m-rtic = "1.1"
log = "0.4"
modular-bitfield = "0.11"
ieee802_3_miim = "0.8"
ds323x = "0.5"
sh1106 = "0.4"
wire-protocols = { path = "libraries/wire-protocols" }
# TODO - upstream these changes
[dependencies.sgp41]
#sgp41 = "0.1"
git = "https://github.com/jonlamb-gh/sgp41.git"
branch = "various-changes"
# TODO - use crates.io once available
[dependencies.sht3x]
git = "https://github.com/miek/sht3x-rs.git"
branch = "master"
[dependencies.stm32f4xx-hal]
version = "0.14"
features = ["rt", "stm32f429", "rtic"]
[dependencies.stm32-eth]
version = "0.4"
default-features = false
features = ["stm32f429", "smoltcp-phy"]
[dependencies.smoltcp]
version = "0.8"
default-features = false
features = [
"medium-ethernet",
"medium-ip",
"proto-ipv4",
"socket-icmp",
"socket-udp",
"socket-tcp",
#"log",
#"verbose"
]
[dependencies.embedded-graphics]
version = "0.7"
default-features = false
[dependencies.shared-bus]
version = "0.2"
default-features = false
features = ["cortex-m"]
[build-dependencies.built]
version = "0.5"
features = ["git2", "chrono"]
[profile.release]
codegen-units = 1 # better optimizations
debug = true # symbols are nice and they don't increase the size on Flash
lto = true # better optimizations
[package.metadata.renode]
machine-name = 'stm32f429-machine'
using-sysbus = true
#renode = '${HOME}/repos/forks/renode/renode'
variables = [
'$tap ?= "renode-tap0"',
# Set random board UNIQUE ID
'''
python "import _random"
python "rand = _random.Random()"
$id1 = `python "print rand.getrandbits(32)"`
$id2 = `python "print rand.getrandbits(32)"`
$id3 = `python "print rand.getrandbits(32)"`
''',
]
platform-description = '''
using "platforms/cpus/stm32f429.repl"
ledGreen: Miscellaneous.LED @ gpioPortB
ledBlue: Miscellaneous.LED @ gpioPortB
ledRed: Miscellaneous.LED @ gpioPortB
gpioPortB:
0 -> ledGreen@0
7 -> ledBlue@0
14 -> ledRed@0
phy: Network.EthernetPhysicalLayer @ ethernet 0
Id1: 0x0007
Id2: 0xC0F1
BasicStatus: 0xFE2D
AutoNegotiationAdvertisement: 0x00A1
AutoNegotiationLinkPartnerBasePageAbility: 0x001
// SSR
VendorSpecific15: 0x101C
ds3231 : Sensors.DS3231 @ i2c1 0x68
sh1106 : Video.SH1106 @ i2c2 0x3C
FramesPerVirtualSecond: 10
sgp41 : Sensors.SGP41 @ i2c2 0x59
VocTicks: 1024
NoxTicks: 2048
sht31 : Sensors.SHT31 @ i2c2 0x44
Temperature: 40
Humidity: 85
'''
pre-start-commands = [
'cpu PerformanceInMips 1',
'showAnalyzer sysbus.usart3',
'showAnalyzer i2c2.sh1106',
'logLevel 3 ethernet',
'logLevel 3 ethernet.phy',
'''
emulation CreateSwitch "switch"
connector Connect sysbus.ethernet switch
emulation CreateTap $tap "tap"
connector Connect host.tap switch
''',
'''
sysbus.usart3 AddLineHook "PANIC" "Antmicro.Renode.Logging.Logger.Log(LogLevel.Error, line)"
sysbus.usart3 AddLineHook "test result: ok" "Antmicro.Renode.Emulator.Exit()"
''',
]
reset = '''
sysbus LoadELF $bin
sysbus WriteDoubleWord 0x1FFF7A10 $id1
sysbus WriteDoubleWord 0x1FFF7A14 $id2
sysbus WriteDoubleWord 0x1FFF7A18 $id3
'''
post-start-commands = [
'''
echo "*******************************************"
echo "Doing workaround for https://github.com/renode/renode/issues/237"
sleep 3
allowPrivates true
ethernet packetSent true
ethernet MAC "02:00:05:06:07:08"
allowPrivates false
echo "*******************************************"
''',
]