Skip to content

Commit c2d5574

Browse files
authored
Merge pull request #1152 from vinchatl/update_readme
Update README.md
2 parents 53a879e + 5ca49ed commit c2d5574

File tree

2 files changed

+59
-41
lines changed

2 files changed

+59
-41
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
* H5, U5: Add cluster definitions for GPDMA channels
143143
* F2, F4, F7: Add definitions for OPTCR, OPTCR1 and OPTCR2 registers of FLASH peripheral
144144
* F2, F4, F7: Fix several fields of FLASH peripheral and reorganise 'patches', 'fields' and 'collect' according to impacted registers
145+
* Update README.md
145146

146147
Family-specific:
147148

README.md

Lines changed: 58 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ features = ["stm32f405", "rt"]
8989
The nightlies should always build and be as stable as the latest release, but
9090
contain the latest patches and updates.
9191

92-
9392
## Generating Device Crates / Building Locally
9493

9594
* Install `svd2rust`, `svdtools`, and `form`:
@@ -107,6 +106,52 @@ contain the latest patches and updates.
107106
* Generate svd2rust device crates: `make svd2rust`
108107
* Optional: Format device crates: `make form`
109108

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+
110155
## Motivation and Objectives
111156

112157
This project serves two purposes:
@@ -129,46 +174,19 @@ This project is still young and there's a lot to do!
129174

130175
* More peripheral patches need to be written, most of all. See what we've got
131176
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.
132186
* Also everything needs testing, and you can't so easily automate finding bugs
133187
in the SVD files...
134188

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
172190

173191
* Update SVD zips in `svd/vendor` to include new SVDs.
174192
* Run `make extract` to extract the new zip files.
@@ -192,7 +210,7 @@ these steps as well:
192210
* Update this Readme to include the new devices.
193211
* Add the devices to `workflows/ci.yaml` and `workflows/nightlies.yaml`.
194212

195-
## Updating Existing Devices/Peripherals
213+
### Updating Existing Devices/Peripherals
196214

197215
* Using Linux, run `make extract` at least once to pull the SVDs out.
198216
* 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
208226
fields with names ending in 'E' or 'D' it additionally generates sample
209227
"Enabled"/"Disabled" entries to save time.
210228

211-
## Device and Peripheral YAML Format
229+
### Device and Peripheral YAML Format
212230

213231
Please see the [svdtools](https://github.com/stm32-rs/svdtools) documentation
214232
for full details of the patch file format.
215233

216-
217234
### Style Guide
218235

219236
* Enumerated values should be named in the past tense ("enabled", "masked",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy