forked from WyliodrinEmbeddedIoT/tockloader-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknown_boards.rs
More file actions
104 lines (87 loc) · 2.49 KB
/
Copy pathknown_boards.rs
File metadata and controls
104 lines (87 loc) · 2.49 KB
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
use crate::board_settings::BoardSettings;
use crate::connection::{ProbeTargetInfo, SerialTargetInfo};
pub trait KnownBoard {
fn serial_target_info(&self) -> SerialTargetInfo;
fn probe_target_info(&self) -> ProbeTargetInfo;
fn get_settings(&self) -> BoardSettings;
}
pub struct NucleoF4;
impl KnownBoard for NucleoF4 {
fn serial_target_info(&self) -> SerialTargetInfo {
SerialTargetInfo::default()
}
fn probe_target_info(&self) -> ProbeTargetInfo {
ProbeTargetInfo {
chip: "STM32F429ZIT".to_string(),
core: 0,
}
}
fn get_settings(&self) -> BoardSettings {
BoardSettings {
arch: Some("cortex-m4".to_string()),
start_address: 0x08040000,
page_size: 512,
ram_start_address: 0x20000000,
}
}
}
pub struct MicrobitV2;
impl KnownBoard for MicrobitV2 {
fn serial_target_info(&self) -> SerialTargetInfo {
SerialTargetInfo::default()
}
fn probe_target_info(&self) -> ProbeTargetInfo {
ProbeTargetInfo {
chip: "nRF52833".to_string(),
core: 0,
}
}
fn get_settings(&self) -> BoardSettings {
BoardSettings {
arch: Some("cortex-m4".to_string()),
start_address: 0x00040000,
page_size: 512,
ram_start_address: 0x20000000,
}
}
}
pub struct Nrf52840dk;
impl KnownBoard for Nrf52840dk {
fn serial_target_info(&self) -> SerialTargetInfo {
SerialTargetInfo::default()
}
fn probe_target_info(&self) -> ProbeTargetInfo {
ProbeTargetInfo {
chip: "nRF52840_xxAA".to_string(),
core: 0,
}
}
fn get_settings(&self) -> BoardSettings {
BoardSettings {
arch: Some("cortex-m4".to_string()),
start_address: 0x00040000,
page_size: 4096,
ram_start_address: 0x20008000,
}
}
}
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,
}
}
}