stm32g0.c: Disable UCPD on boot

The UCPD is not used with Katapult but it can result in unexpected behaviour on certain pins due to the internal pull resistors unless disabled.

Signed-off-by: Luke Harrison looxonline@gmail.com
This commit is contained in:
Luke Harrison 2024-01-29 16:53:49 +02:00 committed by Eric Callahan
parent ec4df2e45a
commit 6a7ca81e4f

View File

@ -145,6 +145,8 @@ bootloader_request(void)
void void
armcm_main(void) armcm_main(void)
{ {
// Disable internal pull-down resistors on UCPDx CCx pins
SYSCFG->CFGR1 |= (SYSCFG_CFGR1_UCPD1_STROBE | SYSCFG_CFGR1_UCPD2_STROBE);
SCB->VTOR = (uint32_t)VectorTable; SCB->VTOR = (uint32_t)VectorTable;
// Reset clock registers (in case bootloader has changed them) // Reset clock registers (in case bootloader has changed them)