|
H753_CPP_Device_Electronic_Signature 1.0
STM32H753 96-bit device unique ID read and print tutorial
|
This documentation covers a STM32 Nucleo-H753ZI tutorial project that reads the MCU's factory-programmed 96-bit unique device ID and prints it over the standard debug USART. It is a from-scratch revision of the site's older STM32 Unique ID tutorial, simplified and modernized.
The firmware demonstrates:
DBGMCU->IDCODE is entirely independent of which board the chip is mounted on – the same STM32H753ZI reports the identical value whether it's on a Nucleo-H753ZI, a custom PCB, or any other carrier. But its two halves don't carry the same guarantee as each other:
This is separate from the UID discussed above either way: the UID is unique per physical chip; DEV_ID/REV_ID describe the part and its silicon revision, not the individual chip.
Reading a UID is only half the story – the useful part is what you do with it. F439_CPP_TX-RX_LoRa_Project_01 (a two-board LoRa link) runs the IDENTICAL compiled firmware image on both the transmitter and the receiver: at boot, each board reads its own UID and compares it against two hardcoded, already-known UID sets to decide which role to play:
No jumpers, no DIP switches, no separate "TX build" and "RX build" to keep in sync – one firmware image that already knows, from hardware-guaranteed identity, which board it's running on. The tradeoff: both UIDs have to be known ahead of time. The compile-time alternative is a #ifdef ROLE_TX / #ifdef ROLE_RX switch instead – that sidesteps ever needing to know a UID in advance, but brings back the two-separate-builds problem this technique avoids.
The original STM32 Unique ID tutorial (F103_C_Device_Electronic_Signature, 2024) additionally ran the UID through a third-party 32-bit hash function (Hash32Len5to12() from a borrowed stm32_uidhash.h) and never printed any result over serial at all. This revision drops the unnecessary hash step entirely – direct comparison of the raw UID words is sufficient, as shown above – and adds real USART output, which the original never had.
The UID-reading logic is identical on every STM32 board regardless of family or package – HAL_GetUIDw0/1/2() is a fixed internal register read with no external wiring involved. The Nucleo-H753ZI used here is purely a build convenience (reusing an already-proven USART1/FTDI setup), not a requirement.
This project's documentation is intentionally a single mainpage – a project this small doesn't need the multi-page/@defgroup layered structure used by larger projects.