2025-09-04 2:59 AM
recently i want to control the SWD function manually by external pin level, in F1 HAL library,there are some defintions to configure this,like above, after call __HAL_AFIO_REMAP_SWJ_DISABLE(),when i connect MCU by jlink debugger,it fails, so it means this definition effect,but after call __HAL_AFIO_REMAP_SWJ_NOJTAG(),debugger still cannot connect the mcu,I try some time,then i find, when enable SWD,I must call __HAL_AFIO_REMAP_SWJ_ENABLE(),why this. i have test on stm32f103c8t6 and stm32f103vet6,both show the same result, thanks.
brief:why i must call __HAL_AFIO_REMAP_SWJ_ENABLE() not only __HAL_AFIO_REMAP_SWJ_NOJTAG() after i disable SWD