Something may happen between these two lines: https://github.com/stm32-rs/stm32-device-signature/blob/4f0417b7dbad4c82f1b790b652923211dc37e0c4/src/lib.rs#L62-L63 Also it's better to use `ptr::write` there.