4 years, 4 months ago.

HOW to get unique ID

AS title ,HOW to get unique ID ,what code could get unique ID

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.

1 Answer

4 years, 4 months ago.



so for your STM32F401RE, try the following:

#include "mbed.h"

// unique ID test

// change this UID address to suit your model of CPU (see datasheet)
// for STM32F401RE - see chapter 24 page 831 of the following document
// http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/DM00096844.pdf
unsigned long *uid = (unsigned long *)0x1FFF7A10; 

Serial pc(USBTX, USBRX); // tx, rx 

int main() {
       pc.printf("\r\nUnique ID: %08X %08X %08X \r\n", uid[0], uid[1], uid[2]);

Accepted Answer

It working. TKS!!

posted by ben chen 23 Feb 2016