stm32: Add option to disable SWD on GigaDevice STM32F103 clones
Tested by @FotoFieber. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -257,8 +257,13 @@ armcm_main(void)
|
||||
|
||||
// Disable JTAG to free PA15, PB3, PB4
|
||||
enable_pclock(AFIO_BASE);
|
||||
stm32f1_alternative_remap(AFIO_MAPR_SWJ_CFG_Msk,
|
||||
AFIO_MAPR_SWJ_CFG_JTAGDISABLE);
|
||||
if (CONFIG_STM32F103GD_DISABLE_SWD)
|
||||
// GigaDevice clone can't enable PA13/PA14 at runtime - enable here
|
||||
stm32f1_alternative_remap(AFIO_MAPR_SWJ_CFG_Msk,
|
||||
AFIO_MAPR_SWJ_CFG_DISABLE);
|
||||
else
|
||||
stm32f1_alternative_remap(AFIO_MAPR_SWJ_CFG_Msk,
|
||||
AFIO_MAPR_SWJ_CFG_JTAGDISABLE);
|
||||
|
||||
sched_main();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user