Skip to content

Commit 19eb744

Browse files
BryanKadzbaneldruin
authored andcommitted
Not all signatures are at the same address; adapt.
ST publishes three different reference manuals: RM0385, RM0410, and RM0431. The first two have the UID and FlashSize registers at the addresses used before this commit; the last has them at the newly added addresses. That last reference manual is for the F7x2, F7x3, and F730 devices, so use the new address for those three families.
1 parent 901ef83 commit 19eb744

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
<!-- next-header -->
99
## [Unreleased] - ReleaseDate
1010

11+
### Fixed
12+
13+
- Use the right addresses for `signature` module structs on f7x2, f7x3, and f730 devices
14+
1115
## [0.8.0] - 2024-08-02
1216

1317
### Changed

src/signature.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ pub struct Uid {
3030
y: u16,
3131
waf_lot: [u8; 8],
3232
}
33+
#[cfg(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730"))]
34+
define_ptr_type!(Uid, 0x1FF0_7A10);
35+
#[cfg(not(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730")))]
3336
define_ptr_type!(Uid, 0x1FF0_F420);
3437

3538
impl Uid {
@@ -58,6 +61,9 @@ impl Uid {
5861
#[derive(Debug)]
5962
#[repr(C)]
6063
pub struct FlashSize(u16);
64+
#[cfg(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730"))]
65+
define_ptr_type!(FlashSize, 0x1FF0_7A22);
66+
#[cfg(not(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730")))]
6167
define_ptr_type!(FlashSize, 0x1FF0_F442);
6268

6369
impl FlashSize {
@@ -76,6 +82,7 @@ impl FlashSize {
7682
#[derive(Debug)]
7783
#[repr(C)]
7884
pub struct VrefCal(u16);
85+
#[cfg(not(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730")))]
7986
define_ptr_type!(VrefCal, 0x1FF0_F44A);
8087

8188
impl VrefCal {
@@ -89,6 +96,7 @@ impl VrefCal {
8996
#[derive(Debug)]
9097
#[repr(C)]
9198
pub struct VtempCal30(u16);
99+
#[cfg(not(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730")))]
92100
define_ptr_type!(VtempCal30, 0x1FF0_F44C);
93101

94102
impl VtempCal30 {
@@ -102,6 +110,7 @@ impl VtempCal30 {
102110
#[derive(Debug)]
103111
#[repr(C)]
104112
pub struct VtempCal110(u16);
113+
#[cfg(not(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730")))]
105114
define_ptr_type!(VtempCal110, 0x1FF0_F44E);
106115

107116
impl VtempCal110 {

0 commit comments

Comments
 (0)