stm32g4: Do not disable SWD by accident

Keep SWEN as 1 in FLASH->ACR register such
that the SWD interface doesn't get disabled.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
This commit is contained in:
Alex Voinea 2022-12-03 15:17:32 +01:00 committed by KevinOConnor
parent 516fdae2b7
commit 0972561783
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ clock_setup(void)
((CONFIG_CLOCK_FREQ>30000000) ? FLASH_ACR_LATENCY_1WS : ((CONFIG_CLOCK_FREQ>30000000) ? FLASH_ACR_LATENCY_1WS :
FLASH_ACR_LATENCY_0WS))))); FLASH_ACR_LATENCY_0WS)))));
FLASH->ACR = (latency | FLASH_ACR_ICEN | FLASH_ACR_DCEN FLASH->ACR = (latency | FLASH_ACR_ICEN | FLASH_ACR_DCEN
| FLASH_ACR_PRFTEN); | FLASH_ACR_PRFTEN | FLASH_ACR_DBG_SWEN);
enable_pclock(PWR_BASE); enable_pclock(PWR_BASE);
PWR->CR3 |= PWR_CR3_APC; // allow gpio pullup/down PWR->CR3 |= PWR_CR3_APC; // allow gpio pullup/down