diff options
| author | Angelina-2007 <[email protected]> | 2025-10-09 18:51:15 -0700 |
|---|---|---|
| committer | Angelina-2007 <[email protected]> | 2025-10-09 18:51:15 -0700 |
| commit | 2f31d7da537c754f3b1ba7b9533d1c42269721c5 (patch) | |
| tree | 452098e404cb1a33ec312644ae388537ffd86f20 | |
| parent | 35b0ba4ce0fed7588febe504e16bbf1788384f5a (diff) | |
Fix #2696: Prevent 8-bit UID reads on STM32H5 by returning [u8; 12] value
| -rw-r--r-- | embassy-stm32/src/uid.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-stm32/src/uid.rs b/embassy-stm32/src/uid.rs index 5e38532bd..2d3e2b972 100644 --- a/embassy-stm32/src/uid.rs +++ b/embassy-stm32/src/uid.rs | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | //! Unique ID (UID) | 1 | //! Unique ID (UID) |
| 2 | 2 | ||
| 3 | /// Get this device's unique 96-bit ID. | 3 | /// Get this device's unique 96-bit ID. |
| 4 | pub fn uid() -> &'static [u8; 12] { | 4 | pub fn uid() -> [u8; 12] { |
| 5 | unsafe { &*crate::pac::UID.uid(0).as_ptr().cast::<[u8; 12]>() } | 5 | unsafe { *crate::pac::UID.uid(0).as_ptr().cast::<[u8; 12]>() } |
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | /// Get this device's unique 96-bit ID, encoded into a string of 24 hexadecimal ASCII digits. | 8 | /// Get this device's unique 96-bit ID, encoded into a string of 24 hexadecimal ASCII digits. |
