Skip to content

Commit b12ae65

Browse files
authored
Preliminary mgmt-gateway task (#655)
Handles basic discovery messages and exposes a USART over UDP.
1 parent bd85738 commit b12ae65

File tree

6 files changed

+694
-14
lines changed

6 files changed

+694
-14
lines changed

Cargo.lock

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

app/gimletlet/app.toml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ task-slots = ["user_leds"]
109109
name = "task-uartecho"
110110
features = ["stm32h753", "usart2"]
111111
uses = ["usart2"]
112-
interrupts = {"usart2.irq" = 1}
112+
interrupts = {"usart2.irq" = 0b01}
113113
priority = 3
114114
max-sizes = {flash = 8192, ram = 4096}
115115
stacksize = 2048
@@ -138,7 +138,7 @@ task-slots = ["sys"]
138138

139139
[tasks.net]
140140
name = "task-net"
141-
stacksize = 4320
141+
stacksize = 4800
142142
priority = 3
143143
features = ["h753", "h7-vlan", "gimletlet-nic"]
144144
max-sizes = {flash = 65536, ram = 16384, sram1 = 16384}
@@ -157,6 +157,20 @@ start = true
157157
task-slots = ["net"]
158158
features = ["vlan"]
159159

160+
[tasks.mgmt_gateway]
161+
name = "task-mgmt-gateway"
162+
priority = 4
163+
max-sizes = {flash = 32768, ram = 8192}
164+
stacksize = 4096
165+
start = true
166+
uses = [
167+
"usart1",
168+
"system_flash", # TODO also used by `net`, both to read the stm32 uid
169+
]
170+
task-slots = ["net", "sys"]
171+
features = ["usart1", "vlan"]
172+
interrupts = {"usart1.irq" = 0b10}
173+
160174
[tasks.validate]
161175
name = "task-validate"
162176
priority = 3
@@ -262,3 +276,10 @@ owner = {name = "udpecho", notification = 1}
262276
port = 7
263277
tx = { packets = 3, bytes = 1024 }
264278
rx = { packets = 3, bytes = 1024 }
279+
280+
[config.net.sockets.mgmt_gateway]
281+
kind = "udp"
282+
owner = {name = "mgmt_gateway", notification = 0b01}
283+
port = 11111 # TODO do we have a documented port for MGS traffic?
284+
tx = { packets = 3, bytes = 1024 }
285+
rx = { packets = 3, bytes = 1024 }

task/mgmt-gateway/Cargo.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "task-mgmt-gateway"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
cfg-if = "1"
8+
num-traits = {version = "0.2", default-features = false}
9+
serde = {version = "1", default-features = false, features = ["derive"]}
10+
ssmarshal = {version = "1", default-features = false}
11+
tinyvec = "1.6"
12+
13+
drv-stm32h7-usart = {path = "../../drv/stm32h7-usart", features = ["h753"]}
14+
drv-stm32xx-uid = {path = "../../drv/stm32xx-uid", features = ["family-stm32h7"]}
15+
ringbuf = {path = "../../lib/ringbuf"}
16+
task-net-api = {path = "../net-api", features = ["use-smoltcp"]}
17+
userlib = {path = "../../sys/userlib", features = ["panic-messages"]}
18+
19+
gateway-messages = {git = "https://github.com/oxidecomputer/omicron", rev = "5951498bbd60306bf8e73a382e6b5aaed67a7616"}
20+
21+
[features]
22+
vlan = ["task-net-api/vlan"]
23+
usart1 = []
24+
usart2 = []

0 commit comments

Comments
 (0)