Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tockloader-cli/src/known_boards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub enum KnownBoardNames {
NucleoF4,
MicrobitV2,
Nrf52840dk,
NucleoU545ReQ,
}

impl KnownBoardNames {
Expand All @@ -11,6 +12,7 @@ impl KnownBoardNames {
"nucleo-f4" => Some(Self::NucleoF4),
"microbit-v2" => Some(Self::MicrobitV2),
"nrf52840dk" => Some(Self::Nrf52840dk),
"nucleo-u545re-q" => Some(Self::NucleoU545ReQ),
_ => None,
}
}
Expand All @@ -20,6 +22,7 @@ impl KnownBoardNames {
KnownBoardNames::NucleoF4 => "nucleo-f4",
KnownBoardNames::MicrobitV2 => "microbit-v2",
KnownBoardNames::Nrf52840dk => "nrf52840dk",
KnownBoardNames::NucleoU545ReQ => "nucleo-u545re-q",
}
}
}
Expand All @@ -29,6 +32,7 @@ pub fn list_known_board_names() -> Vec<KnownBoardNames> {
KnownBoardNames::NucleoF4,
KnownBoardNames::MicrobitV2,
KnownBoardNames::Nrf52840dk,
KnownBoardNames::NucleoU545ReQ,
]
}

Expand All @@ -49,6 +53,7 @@ mod tests {
KnownBoardNames::NucleoF4,
KnownBoardNames::MicrobitV2,
KnownBoardNames::Nrf52840dk,
KnownBoardNames::NucleoU545ReQ,
];

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");
Expand Down
3 changes: 3 additions & 0 deletions tockloader-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ fn get_known_board(user_options: &ArgMatches) -> Option<Box<dyn KnownBoard>> {
KnownBoardNames::Nrf52840dk => {
Box::new(tockloader_lib::known_boards::Nrf52840dk) as Box<dyn KnownBoard>
}
KnownBoardNames::NucleoU545ReQ => {
Box::new(tockloader_lib::known_boards::NucleoU545ReQ) as Box<dyn KnownBoard>
}
}
})
}
Expand Down
24 changes: 24 additions & 0 deletions tockloader-lib/src/known_boards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,27 @@ impl KnownBoard for Nrf52840dk {
}
}
}

pub struct NucleoU545ReQ;

impl KnownBoard for NucleoU545ReQ {
fn serial_target_info(&self) -> SerialTargetInfo {
SerialTargetInfo::default()
}

fn probe_target_info(&self) -> ProbeTargetInfo {
ProbeTargetInfo {
chip: "STM32U545RETxQ".to_string(),
core: 0,
}
}

fn get_settings(&self) -> BoardSettings {
BoardSettings {
arch: Some("cortex-m4".to_string()),
start_address: 0x08000000,
page_size: 8192,
ram_start_address: 0x20000000,
}
}
}
Loading