
General-purpose I/Os (GPIO)
RM0453
414/1454
RM0453 Rev 2
10.4.19 GPIOC
configuration
lock register (GPIOC_LCKR)
Address offset: 0x081C
Reset value: 0x0000 0000
This register is used to lock the configuration of the port bits when a correct write sequence
is applied to bit 16 (LCKK). The value of bits [15:0] is used to lock the configuration of the
GPIO. During the write sequence, the value of LCKR[15:0] must not change. When the lock
sequence has been applied on a port bit, the value of this port bit can no longer be modified
until the next MCU reset or peripheral reset.
Note:
A specific write sequence is used to write to the GPIOC_LCKR register. Only word access
(32-bit long) is allowed during this locking sequence.
Each lock bit freezes a specific configuration register (control and alternate function
registers).
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
LCKK
rw
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
LCK15
LCK14
LCK13
Res.
Res.
Res.
Res.
Res.
Res.
LCK6
LCK5
LCK4
LCK3
LCK2
LCK1
LCK0
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
Bits 31:17 Reserved, must be kept at reset value.
Bit 16
LCKK:
Lock key
This bit can be read any time. It can only be modified using the lock key write sequence.
0: Port PC configuration lock key not active
1: Port PC configuration lock key active. GPIOC_LCKR is locked until the next MCU reset or
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 (This read operation is optional but it confirms that the lock is active.)
Note: During the LOCK key write sequence, the value of LCK[15:0] must not change.
Any error in the lock sequence aborts the lock.
After the first lock sequence on any bit of the port, any read access on the LCKK bit
returns 1 until the next MCU reset or peripheral reset.
Bit 15
LCK15:
Port PC15 lock configuration
Bit 14
LCK14:
Port PC14 lock configuration
Bit 13
LCK13:
Port PC13 lock configuration
Bits 12:7 Reserved, must be kept at reset value.
Bit 6
LCK6:
Port PC6 lock configuration
Bit 5
LCK5:
Port PC5 lock configuration
Bit 4
LCK4:
Port PC4 lock configuration
Bit 3
LCK3:
Port PC3 lock configuration