Skip to content

Commit 4237548

Browse files
feat: add nucleou545-re-q to known boards
Signed-off-by: Vlada <vladagrushchenko@gmail.com>
1 parent c7d54ef commit 4237548

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

tockloader-cli/src/known_boards.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pub enum KnownBoardNames {
33
NucleoF4,
44
MicrobitV2,
55
Nrf52840dk,
6+
NucleoU545ReQ,
67
}
78

89
impl KnownBoardNames {
@@ -11,6 +12,7 @@ impl KnownBoardNames {
1112
"nucleo-f4" => Some(Self::NucleoF4),
1213
"microbit-v2" => Some(Self::MicrobitV2),
1314
"nrf52840dk" => Some(Self::Nrf52840dk),
15+
"nucleo-u545re-q" => Some(Self::NucleoU545ReQ),
1416
_ => None,
1517
}
1618
}
@@ -20,6 +22,7 @@ impl KnownBoardNames {
2022
KnownBoardNames::NucleoF4 => "nucleo-f4",
2123
KnownBoardNames::MicrobitV2 => "microbit-v2",
2224
KnownBoardNames::Nrf52840dk => "nrf52840dk",
25+
KnownBoardNames::NucleoU545ReQ => "nucleo-u545re-q",
2326
}
2427
}
2528
}
@@ -29,6 +32,7 @@ pub fn list_known_board_names() -> Vec<KnownBoardNames> {
2932
KnownBoardNames::NucleoF4,
3033
KnownBoardNames::MicrobitV2,
3134
KnownBoardNames::Nrf52840dk,
35+
KnownBoardNames::NucleoU545ReQ,
3236
]
3337
}
3438

@@ -49,6 +53,7 @@ mod tests {
4953
KnownBoardNames::NucleoF4,
5054
KnownBoardNames::MicrobitV2,
5155
KnownBoardNames::Nrf52840dk,
56+
KnownBoardNames::NucleoU545ReQ,
5257
];
5358

5459
assert_eq!(list_known_board_names(), backup_list, "If this fails it means that you likely forgot to update `list_known_boards`, and subsequently the `list_known_boards_updated` test");

tockloader-cli/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ fn get_known_board(user_options: &ArgMatches) -> Option<Box<dyn KnownBoard>> {
9797
KnownBoardNames::Nrf52840dk => {
9898
Box::new(tockloader_lib::known_boards::Nrf52840dk) as Box<dyn KnownBoard>
9999
}
100+
KnownBoardNames::NucleoU545ReQ => {
101+
Box::new(tockloader_lib::known_boards::NucleoU545ReQ) as Box<dyn KnownBoard>
102+
}
100103
}
101104
})
102105
}

tockloader-lib/src/known_boards.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,27 @@ impl KnownBoard for Nrf52840dk {
7878
}
7979
}
8080
}
81+
82+
pub struct NucleoU545ReQ;
83+
84+
impl KnownBoard for NucleoU545ReQ {
85+
fn serial_target_info(&self) -> SerialTargetInfo {
86+
SerialTargetInfo::default()
87+
}
88+
89+
fn probe_target_info(&self) -> ProbeTargetInfo {
90+
ProbeTargetInfo {
91+
chip: "STM32U545RETxQ".to_string(),
92+
core: 0,
93+
}
94+
}
95+
96+
fn get_settings(&self) -> BoardSettings {
97+
BoardSettings {
98+
arch: Some("cortex-m4".to_string()),
99+
start_address:0x08000000,
100+
page_size: 8192,
101+
ram_start_address: 0x20000000,
102+
}
103+
}
104+
}

0 commit comments

Comments
 (0)