2019-01-11 09:04 PM
I am looking at the code here that has the algorithm for producing the device serial number reported when the MCU is in USB DFU mode.
https://github.com/libopencm3/libopencm3/blob/master/lib/stm32/desig.c
The document they reference there, https://my.st.com/52d187b7, is now a dead link. Does anyone have the name of the document and its current location?
Solved! Go to Solution.
2019-01-16 01:13 PM
From F2 ROM
1FFF387A SUB16 sub_1FFF387A: ; Xref 1FFF1F68
1FFF387A B538 push {r3, r4, r5, lr}
1FFF387C 4811 ldr r0, [pc, #68] ; ($1FFF38C4=$1FFF7A10)
1FFF387E 6801 ldr r1, [r0, #0]
1FFF3880 6844 ldr r4, [r0, #4]
1FFF3882 6880 ldr r0, [r0, #8]
1FFF3884 1840 adds r0, r0, r1
1FFF3886 D00A beq.n loc_1FFF389E
1FFF3888 4D0F ldr r5, [pc, #60] ; ($1FFF38C8=$200012C8)
1FFF388A 2208 movs r2, #8
1FFF388C 1CA9 adds r1, r5, #2
1FFF388E F000 F81D bl sub_1FFF38CC
1FFF3892 2204 movs r2, #4
1FFF3894 F105 0112 add.w r1, r5, #18 ; $12
1FFF3898 4620 mov r0, r4
1FFF389A F000 F817 bl sub_1FFF38CC
1FFF389E LOC loc_1FFF389E: ; Xref 1FFF3886
1FFF389E BD31 pop {r0, r4, r5, pc}
2019-01-16 01:16 PM
I think it is sufficient..
2019-01-16 05:07 PM
IIRC these ST serial numbers were documented in STM8 app.notes. They include date of producing the wafer and coordinates (X,Y) of the chip on the wafer. So each chip indeed has an unique id, if this scheme is actually applied in manufacturing process.
-- pa
2019-01-16 05:47 PM
The question however is more about the 12-byte ASCII serial number generated by the DFU/USB peripheral.