STM32 microcontroller read operation -ID

Each chip has an internal STM32 a unique Unique Device ID, 96 Bit.

This ID number can provide developers with a lot of excellent features such as:

1. Can the serial number of the user ID as a final product to help users manage the product.

2. In some of the need to ensure the security function code before running by checking the ID, ensure the safety of some of the features of the final product.

3. ID with encryption and decryption algorithm, to increase the chip's internal code encrypted to ensure security of the user of the product and can not be copied.

This feature is believed that those who do not want their product is not copied by others is certainly very good.

Now I will tell you how to read the ID:

 

This ID number is placed in a fixed position within the Flash chip, direct read out on the line 96-bit unique ID at address 0 × 1FFFF7E8 ~ 0 × 1FFFF7F4 system memory area is written at the factory by the company ST ( user can not modify) the user may be byte, half-word, or word reads an address of any individual therebetween.

(A) to configure the serial port for debugging demonstration, the front part of the section we been introduced.

Reference can post:

[Original] MINI-STM32 boards introductory tutorial (VI) based on the ADC DMA

Of course, you can also directly download our routine to read this part of the program.

(B) reading the Unique Device ID

u32 Dev_Serial0, Dev_Serial1, Dev_Serial2;

Dev_Serial0 = *(vu32*)(0×1FFFF7E8);

Dev_Serial1 = *(vu32*)(0×1FFFF7EC);

Dev_Serial2 = *(vu32*)(0×1FFFF7F0);

(C) simulation debugging

 

(1) using the Keil uVision4 connection ULINK 2 emulator test board, using a serial cable MINI-STM32 boards incidental, UART1 serial connection and PC board experiments, the open routine experimentation ADC.Uv2 instance directory compile link project;

(2) running on a PC windows comes HyperTerminal serial communication program (baud 115200,1 stop bit, no parity, no hardware flow control); or using other serial communication program;

(3) Click on the MDK Debug menu, click Start / Stop Debug Session;

(4) the program running at full speed, giving the result shown below.

MINI-STM32  STM32F103RBT6 Unique Device ID:

066C0033 32353958 43195835

Note: The last line is where the numbers in STM32F103RBT6 my MINI-STM32 development board your Unique Device ID ID of course and I would certainly not the same.

Guess you like

Origin www.cnblogs.com/liangbo-1024/p/10943605.html