41. Device electronic signature
The device electronic signature is stored in the System memory area of the flash memory module, and can be read using the debug interface or by the CPU. It contains factory-programmed identification and calibration data that allow the user firmware or other external devices to automatically match to the characteristics of the STM32G0x1 microcontroller.
41.1 Unique device ID register (96 bits)
The unique device identifier is ideally suited:
- • for use as serial numbers (for example USB string serial numbers or other end applications)
- • for use as part of the security keys in order to increase the security of code in Flash memory while using and combining this unique ID with software cryptographic primitives and protocols before programming the internal Flash memory
- • to activate secure boot processes, etc.
The 96-bit unique device identifier provides a reference number which is unique for any device and in any context. These bits cannot be altered by the user.
Base address: 0x1FFF 7590
Address offset: 0x00
Read only = 0xXXXX XXXX where X is factory-programmed

| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| UID[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| UID[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 UID[31:0] : X and Y coordinates on the wafer expressed in BCD format
Address offset: 0x04
Read only = 0xXXXX XXXX where X is factory-programmed

| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| UID[63:48] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| UID[47:32] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:8 UID[63:40] : LOT_NUM[23:0]
Lot number (ASCII encoded)
Bits 7:0 UID[39:32] : WAF_NUM[7:0]
Wafer number (8-bit unsigned number)
Address offset: 0x08
Read only = 0xXXXX XXXX where X is factory-programmed

| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| UID[95:80] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| UID[79:64] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 UID[95:64] : LOT_NUM[55:24]
Lot number (ASCII encoded)
41.2 Flash memory size data register
Base address: 0x1FFF 75E0
Address offset: 0x00
Read only = 0xXXXX where X is factory-programmed

| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| FLASH_SIZE | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 15:0 FLASH_SIZE[15:0] : Flash memory size
This bitfield indicates the size of the device Flash memory expressed in Kbytes.
As an example, 0x040 corresponds to 64 Kbytes.
41.3 Package data register
Base address: 0x1FFF 7500
Address offset: 0x00
Read only = 0xXXXX where X is factory-programmed

| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | PKG[3:0] | |||
| r | r | r | r | ||||||||||||
Bits 15:4 Reserved
Bits 3:0 PKG[3:0] : Package type
Condition: STM32G071xx and STM32G081xx
0000: UFQFPN28 GP version
0001: UFQFPN28 N version
0100: UFQFPN32 / LQFP32 GP version
0101: UFQFPN32 / LQFP32 N version
1000: UFQFPN48 / LQFP48
1100: LQPF64
Others: Reserved
Condition: STM32G031xx, STM32G041xx, STM32G051xx, and STM32G061xx
0001: SO8
0010: WLCSP18
0011: TSSOP20
0100: UFQFPN28
0101: UFQFPN32 / LQFP32
0111: UFQFPN48 / LQFP48
Others: Reserved
Condition: STM32G0B1xx and STM32G0C1xx
0000: LQFP100
0001: LQFP32/UFQFPN32 GP version
0010: LQFP32/UFQFPN32 N version
0100: LQFP48 / UFQFPN48 GP version
0101: LQFP48 / UFQFPN48 N version
0110: WLCSP52
0111: LQFP64 GP version
1000: LQFP64 N version
1010: UFBGA64 N version
1011: LQFP80
1100: UFBGA100
Others: Reserved