diff --git a/embassy-stm32/src/device_signature.rs b/embassy-stm32/src/device_signature.rs index b9999339..c3b0894a 100644 --- a/embassy-stm32/src/device_signature.rs +++ b/embassy-stm32/src/device_signature.rs @@ -33,55 +33,46 @@ use cortex_m::interrupt; #[cfg(any(stm32f0, stm32f3))] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FFF_F7AC as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FFF_F7CC as _; } #[cfg(stm32f1)] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FFF_F7E8 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FFF_F7E0 as _; } #[cfg(any(stm32f2, stm32f4))] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FFF_7A10 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FFF_7A22 as _; } #[cfg(any(stm32f72x, stm32f73x))] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FF0_7A10 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FF0_7A22 as _; } #[cfg(any(stm32f76x, stm32f77x))] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FF0_F420 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FF0_F442 as _; } #[cfg(any(stm32g0, stm32l4, stm32wb5x))] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FFF_7590 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FFF_75E0 as _; } #[cfg(any(stm32h72x, stm32h73x, stm32h74x, stm32h75x))] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FF1_E800 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FF1_E880 as _; } #[cfg(any(stm32h7ax, stm32h7bx))] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x08FF_F800 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x08FF_F80C as _; } #[cfg(stm32l0)] mod pointers { pub const DEVICE_ID_PTR: *const u8 = 0x1FF8_0050 as _; - pub const FLASH_SIZE_PTR: *const u16 = 0x1FF8_007C as _; } use pointers::*; @@ -111,8 +102,3 @@ pub fn device_id_hex() -> &'static str { core::str::from_utf8_unchecked(&DEVICE_ID_STR) } } - -/// Returns the Flash memory size of the device in Kbytes -pub fn flash_size_kb() -> u16 { - unsafe { *FLASH_SIZE_PTR } -} diff --git a/examples/stm32f0/src/bin/device.rs b/examples/stm32f0/src/bin/device.rs index b2a7324b..1216214b 100644 --- a/examples/stm32f0/src/bin/device.rs +++ b/examples/stm32f0/src/bin/device.rs @@ -4,7 +4,7 @@ use cortex_m_rt::entry; use defmt::*; -use embassy_stm32::device_signature::{device_id, device_id_hex, flash_size_kb}; +use embassy_stm32::device_signature::{device_id, device_id_hex}; use {defmt_rtt as _, panic_probe as _}; #[entry] @@ -12,7 +12,6 @@ fn main() -> ! { // Example to show how to read the unique id of the mcu info!("Device ID: {:?}", device_id()); info!("Device Hex ID: {:?}", device_id_hex()); - info!("Flash Size in KB = {:?}", flash_size_kb()); // Main is done, run this future that never finishes loop {