6.4.8 GPIO port configuration lock register (GPIOx_LCKR) (x = A to K)register นี้ถูกใช้เพื่อล็อค the configuration ของ the port bits เมื่อ a correct write sequence ถูกนำมาใช้กับ bit 16 (LCKK). ค่าของ bits [15:0] ถูกใช้เพื่อล็อค the configuration ของ the GPIO. ในระหว่าง the write sequence, ค่าของ LCKR[15:0] ต้องไม่เปลี่ยน. เมื่อ the LOCK sequence ถูกนำมาใช้บน a port bit แล้ว, ค่าของ port bit นี้ไม่สามารถถูกแก้ไขได้อีกต่อไปจนกระทั่ง the next MCU reset or peripheral reset.
Note: A specific write sequence ถูกใช้เพื่อเขียนไปยัง the GPIOx_LCKR register. เฉพาะ word access (32-bit long)
ถูกอนุญาตให้ในระหว่าง locking sequence นี้.แต่ละ lock bit จะแช่แข็ง a specific configuration register (control and alternate function registers).
Address offset: 0x1C
Reset value: 0x0000 0000

Bits 31:17 Reserved, must be kept at reset value.
Bit 16
LCKK: Lock key
บิตนี้สามารถถูกอ่านได้ตลอดเวลา. มันสามารถถูกแก้ไขได้เฉพาะการใช้ the lock key write sequence.
0: Port configuration lock key ไม่ทำงาน
1: Port configuration lock key ทำงาน. The GPIOx_LCKR register ถูกล็อคจนกระทั่ง the next MCU reset หรือ
peripheral reset.
LOCK key write sequence:
WR LCKR[16] = ‘1’ + LCKR[15:0]
WR LCKR[16] = ‘0’ + LCKR[15:0]
WR LCKR[16] = ‘1’ + LCKR[15:0]
RD LCKR
RD LCKR[16] = ‘1’ (read operation นี้เป็นทางเลือกแต่มันจะยืนยันได้ว่า the lock ทำงาน)
Note: ในระหว่าง the LOCK key write sequence, ค่าของ LCK[15:0] ต้องไม่เปลี่ยน.
error ใดๆใน the lock sequence จะละทิ้ง the lock.
หลังจาก the first lock sequence บนบิตใดๆของ the port, read access ใดบน the LCKK bit จะส่งคืนกลับ ‘1’ จนกระทั่ง
the next MCU reset หรือ peripheral reset.
Bits 15:0
LCK[15:0]: Port x lock I/O pin y (y = 15 to 0)
บิตเหล่านี้ถูกอ่าน/เขียนได้แต่สามารถถูกเขียนเฉพาะเมื่อ the LCKK bit เป็น ‘0.
0: Port configuration ไม่ถูกล็อค
1: Port configuration ถูกล็อค