Skip to content

Commit 7e25d06

Browse files
authored
Merge branch 'f4-update-otg-fs' into f4-otg_fs
2 parents 41b3c83 + f682a26 commit 7e25d06

27 files changed

+286
-1358
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
## [Unreleased]
44

5+
* Update STM32F4 to V1.8 archive source
6+
* Remove workaround for bug in duckscript's `mv`
57
* Replace `makehtml.py` with `svd2html`
6-
* Updated to svd2rust 0.28.0, svdtools 0.3.0, use tools binaries for CI
8+
* Updated to svd2rust 0.30.0, svdtools 0.3.0, use tools binaries for CI
9+
* Enable atomic operations on register support, Rust edition 2021 (#846)
710
* files in devices/common_patches moved to subdirectories
811
* remove excutable file perm bit from yaml file ([#854])
912
* doc on `OTG_FS_*` for STM32F4 with standalone `OTG_FS_*` section ([#855])

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
all: patch svd2rust
22

3-
.PHONY: patch crates svd2rust form check clean-rs clean-patch clean-html clean-svd clean lint mmaps
3+
.PHONY: extract patch crates svd2rust form check clean-rs clean-patch clean-html clean-svd clean lint mmaps
44
.PRECIOUS: svd/%.svd .deps/%.d
55

66
SHELL := /usr/bin/env bash
@@ -17,6 +17,7 @@ YAMLS := $(foreach crate, $(CRATES), \
1717
$(wildcard devices/$(crate)*.yaml))
1818

1919
# Each yaml file in devices/ exactly name-matches an SVD file in svd/
20+
EXTRACTED_SVDS := $(patsubst devices/%.yaml, svd/%.svd, $(YAMLS))
2021
PATCHED_SVDS := $(patsubst devices/%.yaml, svd/%.svd.patched, $(YAMLS))
2122
FORMATTED_SVDS := $(patsubst devices/%.yaml, svd/%.svd.formatted, $(YAMLS))
2223

@@ -60,7 +61,7 @@ crates:
6061
define crate_template
6162
$(1)/src/%/mod.rs: svd/%.svd.patched $(1)/Cargo.toml
6263
mkdir -p $$(@D)
63-
cd $$(@D); svd2rust -m -g --strict --pascal_enum_values --max_cluster_size -i ../../../$$<
64+
cd $$(@D); svd2rust -m -g --strict --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics -i ../../../$$<
6465
rustfmt --config-path="rustfmt.toml" $$@
6566
rm $$(@D)/build.rs
6667
mv -f $$(@D)/generic.rs $$(@D)/../
@@ -73,7 +74,7 @@ $(1)/src/%/.form: $(1)/src/%/mod.rs
7374
touch $$@
7475

7576
$(1)/src/%/.check: $(1)/src/%/mod.rs
76-
cd $(1) && cargo check --target-dir ../target/check/ --features rt,$$*
77+
cd $(1) && cargo check --target-dir ../target/check/ --features rt,atomics,$$*
7778
touch $$@
7879

7980
$(1)/Cargo.toml: crates
@@ -87,6 +88,8 @@ svd/%.svd: svd/.extracted ;
8788
svd/.extracted:
8889
cd svd && ./extract.sh && touch .extracted
8990

91+
extract: $(EXTRACTED_SVDS)
92+
9093
patch: $(PATCHED_SVDS)
9194

9295
svd2rust: $(RUST_SRCS) crates

Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ for i in ${handle}
145145
if ${need_update}
146146
echo "svd2rust: ${serie}"
147147
cd ${dir_name}
148-
exec svd2rust -m -g --strict --pascal_enum_values --max_cluster_size -i "../../../${patchedpath}"
148+
exec svd2rust -m -g --strict --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics -i "../../../${patchedpath}"
149149
rm build.rs
150150
rm ../generic.rs
151151
mv generic.rs ../

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ contain the latest patches and updates.
9898
* Otherwise, build using `cargo` (double check versions against `scripts/tool_install.sh`):
9999
* `cargo install form --version 0.10.0`
100100
* `cargo install svdtools --version 0.3.0`
101-
* `cargo install svd2rust --version 0.28.0`
101+
* `cargo install svd2rust --version 0.30.0`
102102
* `cargo install svd2html --version 0.1.3`
103103
* Install rustfmt: `rustup component add rustfmt`
104-
* Unzip bundled SVD zip files: `cd svd; ./extract.sh; cd ..`
105104
* Generate patched SVD files: `make patch` (you probably want `-j` for all `make` invocations)
106105
* Alternatively you could install `cargo-make` runner and then use it instead of `make`. Works on MS Windows natively:
107106
* `cargo install cargo-make`
@@ -170,12 +169,12 @@ Check out the full list of supported devices [here](https://stm32-rs.github.io/s
170169

171170
## Adding New Devices
172171

173-
* Update SVD zips in `svd/vendor` to include new SVD.
174-
* Run `svd/extract.sh` to extract the zips into `svd` (ignored in git).
172+
* Update SVD zips in `svd/vendor` to include new SVDs.
173+
* Run `make extract` to extract the new zip files.
175174
* Add new YAML file in `devices/` with the new SVD path and include any
176175
required SVD patches for this device, such as renaming or merging fields.
177176
* Add the new devices to `stm32_part_table.yaml`.
178-
* Add the new devices `scripts/makecrates.py`.
177+
* Add the new devices to `scripts/makecrates.py`.
179178
* You can run `scripts/matchperipherals.py` script to find out what existing
180179
peripherals could be cleanly applied to this new SVD. If they look sensible,
181180
you can include them in your device YAML. This requires a Python environment with the `pyyaml`
@@ -194,7 +193,7 @@ these steps as well:
194193

195194
## Updating Existing Devices/Peripherals
196195

197-
* Using Linux, run `svd/extract.sh` at least once to pull the SVDs out.
196+
* Using Linux, run `make extract` at least once to pull the SVDs out.
198197
* Edit the device or peripheral YAML (see below for format).
199198
* Using Linux, run `make` to rebuild all the crates using `svd patch` and `svd2rust`.
200199
* Test your new stuff compiles: `cd stm32f4; cargo build --features stm32f405`

devices/common_patches/sdio_sdmmc/f446.yaml

Lines changed: 0 additions & 235 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"DIEPCTL*,DOEPCTL*":
2+
_modify:
3+
EPENA:
4+
access: read-write
5+
Stall:
6+
name: STALL
7+
description: STALL handshake

devices/common_patches/usb_otg/fs_v1.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,28 +102,13 @@ OTG_FS_HOST:
102102
- fs_host_array.yaml
103103

104104
OTG_FS_DEVICE:
105-
DIEPCTL*:
106-
_modify:
107-
EPENA:
108-
access: read-write
109-
Stall:
110-
name: STALL
111-
description: STALL handshake
112-
113-
DOEPCTL*:
114-
_modify:
115-
EPENA:
116-
access: read-write
117-
Stall:
118-
name: STALL
119-
description: STALL handshake
120-
121105
DAINTMSK:
122106
_modify:
123107
OEPINT:
124108
name: OEPM
125109
description: OUT EP interrupt mask bits
126110

127111
_include:
112+
- epena_stall.yaml
128113
- fs_device_cluster.yaml
129114

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