@@ -89,7 +89,6 @@ features = ["stm32f405", "rt"]
89
89
The nightlies should always build and be as stable as the latest release, but
90
90
contain the latest patches and updates.
91
91
92
-
93
92
## Generating Device Crates / Building Locally
94
93
95
94
* Install ` svd2rust ` , ` svdtools ` , and ` form ` :
@@ -107,6 +106,52 @@ contain the latest patches and updates.
107
106
* Generate svd2rust device crates: ` make svd2rust `
108
107
* Optional: Format device crates: ` make form `
109
108
109
+ Basically, the full process is:
110
+
111
+ ```
112
+ +--------------------------+ +------------------------+ +--------------------------+ +--------------------------+
113
+ | ST-supplied SVD archives | | SVD peripheral patches | | Peripheral fields detail | | Perip. fields collecting |
114
+ | in 'svd/vendor/' | | in 'devices/patches/' | | in 'devices/fields' | | in 'devices/collect' |
115
+ +--------------------------+ +------------------------+ +--------------------------+ +--------------------------+
116
+ | | | |
117
+ | | (optional) (optional)
118
+ `make extract` | | |
119
+ | +----------------------------+-----------------------------+
120
+ | |
121
+ v v
122
+ +----------------------------+ +--------------------------+
123
+ | ST-supplied SVD files | | SVD device changes |
124
+ | in 'svd/' | | in 'devices/' |
125
+ +----------------------------+ +--------------------------+
126
+ | |
127
+ +---------------------------+----------------------------+
128
+ |
129
+ `make patch`
130
+ (using svdtools)
131
+ |
132
+ v
133
+ +------------------------+
134
+ | Patched SVD files |
135
+ | in 'svd/' |
136
+ +------------------------+
137
+ |
138
+ `make svd2rust`
139
+ |
140
+ v
141
+ +------------------------+
142
+ | Generated STM32 crates |
143
+ | in 'stm32*/' |
144
+ +------------------------+
145
+ |
146
+ `make form` (optional)
147
+ |
148
+ v
149
+ +------------------------+
150
+ | Formatted STM32 crates |
151
+ | in 'stm32*/' |
152
+ +------------------------+
153
+ ```
154
+
110
155
## Motivation and Objectives
111
156
112
157
This project serves two purposes:
@@ -129,46 +174,19 @@ This project is still young and there's a lot to do!
129
174
130
175
* More peripheral patches need to be written, most of all. See what we've got
131
176
in ` devices/ ` and grab a reference manual!
177
+ * Each ` stm32*.yaml ` file is a patch for a specific device SVD.
178
+ * To avoid repetition, common patches are written per peripheral in
179
+ ` devices/patches ` . Search there if a patch you want to add doesn't already
180
+ exist!
181
+ * Register fields description in ` devices/fields ` are not a part of the
182
+ CMSIS-SVD specification but enable type-safe friendly-name interface
183
+ (enumerated values) for highly detailed crates.
184
+ * ` devices/collect ` is here for collecting in ` array ` s, ` cluster ` s and ` derive ` s
185
+ to minimize duplication.
132
186
* Also everything needs testing, and you can't so easily automate finding bugs
133
187
in the SVD files...
134
188
135
- ## Supported Device Families
136
-
137
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32c0.svg?label=stm32c0 )] ( https://crates.io/crates/stm32c0 )
138
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32f0.svg?label=stm32f0 )] ( https://crates.io/crates/stm32f0 )
139
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32f1.svg?label=stm32f1 )] ( https://crates.io/crates/stm32f1 )
140
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32f2.svg?label=stm32f2 )] ( https://crates.io/crates/stm32f2 )
141
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32f3.svg?label=stm32f3 )] ( https://crates.io/crates/stm32f3 )
142
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32f4.svg?label=stm32f4 )] ( https://crates.io/crates/stm32f4 )
143
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32f7.svg?label=stm32f7 )] ( https://crates.io/crates/stm32f7 )
144
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32g0.svg?label=stm32g0 )] ( https://crates.io/crates/stm32g0 )
145
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32g4.svg?label=stm32g4 )] ( https://crates.io/crates/stm32g4 )
146
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32h5.svg?label=stm32h5 )] ( https://crates.io/crates/stm32h5 )
147
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32h7.svg?label=stm32h7 )] ( https://crates.io/crates/stm32h7 )
148
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32l0.svg?label=stm32l0 )] ( https://crates.io/crates/stm32l0 )
149
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32l1.svg?label=stm32l1 )] ( https://crates.io/crates/stm32l1 )
150
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32l4.svg?label=stm32l4 )] ( https://crates.io/crates/stm32l4 )
151
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32l5.svg?label=stm32l5 )] ( https://crates.io/crates/stm32l5 )
152
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32mp1.svg?label=stm32mp1 )] ( https://crates.io/crates/stm32mp1 )
153
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32u5.svg?label=stm32u0 )] ( https://crates.io/crates/stm32u0 )
154
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32u5.svg?label=stm32u5 )] ( https://crates.io/crates/stm32u5 )
155
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32wl.svg?label=stm32wl )] ( https://crates.io/crates/stm32wl )
156
- [ ![ crates.io] ( https://img.shields.io/crates/v/stm32wb.svg?label=stm32wb )] ( https://crates.io/crates/stm32wb )
157
-
158
- Please see the individual crate READMEs for the full list of devices each crate
159
- supports. All SVDs released by ST for STM32 devices are covered, so probably
160
- your device is supported to some extent!
161
-
162
- ** Devices that are nearly identical, like the STM32F405/F415, are supported by
163
- ST under a single SVD file STM32F405, so if you can't find your exact device
164
- check if its sibling is supported instead. The crate READMEs make this clear.**
165
-
166
- Many peripherals are not yet patched to provide the type-safe friendly-name
167
- interface (enumerated values); please consider helping out with this!
168
-
169
- Check out the full list of supported devices [ here] ( https://stm32-rs.github.io/stm32-rs/ ) .
170
-
171
- ## Adding New Devices
189
+ ### Adding New Devices
172
190
173
191
* Update SVD zips in ` svd/vendor ` to include new SVDs.
174
192
* Run ` make extract ` to extract the new zip files.
@@ -192,7 +210,7 @@ these steps as well:
192
210
* Update this Readme to include the new devices.
193
211
* Add the devices to ` workflows/ci.yaml ` and ` workflows/nightlies.yaml ` .
194
212
195
- ## Updating Existing Devices/Peripherals
213
+ ### Updating Existing Devices/Peripherals
196
214
197
215
* Using Linux, run ` make extract ` at least once to pull the SVDs out.
198
216
* Edit the device or peripheral YAML (see below for format).
@@ -208,12 +226,11 @@ SVD file, with registers and fields ready to be populated. For single bit wide
208
226
fields with names ending in 'E' or 'D' it additionally generates sample
209
227
"Enabled"/"Disabled" entries to save time.
210
228
211
- ## Device and Peripheral YAML Format
229
+ ### Device and Peripheral YAML Format
212
230
213
231
Please see the [ svdtools] ( https://github.com/stm32-rs/svdtools ) documentation
214
232
for full details of the patch file format.
215
233
216
-
217
234
### Style Guide
218
235
219
236
* Enumerated values should be named in the past tense ("enabled", "masked",
0 commit comments