I'm looking to programmatically read the serial number out of a device which uses an STM32 (L07x / L08x / L010). I can read the serial using the STM32 St-Link Utility GUI by reading addresses
0x1FF80064 (using size: 0x4, data width: 32 bits).
I now need to do this programmatically. I'm using
st-tools to flash firmware, so thought I could use this to read the addresses out.
I've tried to do it as follows:
st-flash --format ihex read part1.hex 0x1FF80050 32
st-flash --format ihex read part1.hex 0x1FF80054 32
st-flash --format ihex read part1.hex 0x1FF80064 32
It produces an output which I'm finding difficult to parse to extract the serial I need. E.g. part1.hex produces this:
...where the St-Link utility gives me
I'm not hugely familiar with STM32 kit - can anyone advise if there's a more concise way to retrieve the serial number?