How do I unlock and write to the GPIOx->LCKR register so I can reconfigure GPIOx pins?
I'm trying wean myself off the STM HAL library and learn how to program peripherals at the register level. I'm starting with UART1 on a STM32H7A3. UART1 with Alternate Function 7 has TX on GPIOB pin 6 and RX on GPIOB pin 7. So I think I need to set GPIOB->MODER6[1:0] and GPIO->MODER7[1:0] to 10 (alternate function mode). The problem is the H7 boots up with the GPIOB->LCKR register set to 0xFFFFFEBF which means pin 7 is locked. There's some information in the reference manual and the web about how to lock a pin with the LCKR register but I haven't found anything telling me how to unlock a pin. Just writing a 0 to the LCKR register lock key LCKK bit doesn't seem to work.
How do I unlock and write to the GPIOB->LCKR register so I can unlock pin 7 (or any pin) so I can reconfigure it?
