Skip to content

Commit

Permalink
Not all signatures are at the same address; adapt.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BryanKadzban authored and eldruin committed Sep 13, 2024
1 parent 901ef83 commit 19eb744
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
<!-- next-header -->
## [Unreleased] - ReleaseDate

### Fixed

- Use the right addresses for `signature` module structs on f7x2, f7x3, and f730 devices

## [0.8.0] - 2024-08-02

### Changed
Expand Down
9 changes: 9 additions & 0 deletions src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pub struct Uid {
y: u16,
waf_lot: [u8; 8],
}
#[cfg(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730"))]
define_ptr_type!(Uid, 0x1FF0_7A10);
#[cfg(not(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730")))]
define_ptr_type!(Uid, 0x1FF0_F420);

impl Uid {
Expand Down Expand Up @@ -58,6 +61,9 @@ impl Uid {
#[derive(Debug)]
#[repr(C)]
pub struct FlashSize(u16);
#[cfg(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730"))]
define_ptr_type!(FlashSize, 0x1FF0_7A22);
#[cfg(not(any(feature = "svd-f7x2", feature = "svd-f7x3", feature = "svd-f730")))]
define_ptr_type!(FlashSize, 0x1FF0_F442);

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

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

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

impl VtempCal110 {
Expand Down

0 comments on commit 19eb744

Please sign in to comment.