RM0440
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.
Note: During the LOCK key write sequence, the value of LCK[15:0] must not change.
Bits 15:0 LCK[15:0]: Port x lock I/O pin y (y = 15 to 0)
These bits are read/write but can only be written when the LCKK bit is '0.
8.4.9
GPIO alternate function low register (GPIOx_AFRL)
(x = A to G)
Address offset: 0x20
Reset value: 0x0000 0000
31
30
29
AFSEL7[3:0]
rw
rw
rw
15
14
13
AFSEL3[3:0]
rw
rw
rw
0: Port configuration lock key not active
1: Port configuration lock key active. The GPIOx_LCKR register 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)
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.
0: Port configuration not locked
1: Port configuration locked
28
27
26
25
AFSEL6[3:0]
rw
rw
rw
rw
12
11
10
9
AFSEL2[3:0]
rw
rw
rw
rw
24
23
22
AFSEL5[3:0]
rw
rw
rw
8
7
6
AFSEL1[3:0]
rw
rw
rw
RM0440 Rev 1
General-purpose I/Os (GPIO)
21
20
19
18
AFSEL4[3:0]
rw
rw
rw
rw
5
4
3
2
AFSEL0[3:0]
rw
rw
rw
rw
17
16
rw
rw
1
0
rw
rw
321/2083
325
Need help?
Do you have a question about the STM32G4 Series and is the answer not in the manual?
Questions and answers