2017-12-17 10:18 PM
when used the 103 series MCU, the SWD port will been disabled in follow step.
1) enable the SWD interface.
2) enable tim3 CH1 PWM function and remapping the output pin to PB4.
3) when the tim3 init code run to __HAL_AFIO_REMAP_TIM3_PARTIAL(), the SWD debug interface will been disable.
4) this bug can be reappear in STM32F103RCT and STM32F103ZET.
5) the software used IAR.
2017-12-18 07:36 AM
Hello
Hu.Bruno
,Please in thestm32f1xx_hal_msp.c file,comment this line:
/**DISABLE: JTAG-DP Disabled and SW-DP Disabled
*/ __HAL_AFIO_REMAP_SWJ_DISABLE();Then tell me if this workaround resolve your issue or you still have problems.
Meanwhile, I will raise this issue internally to the appropriate team or further check.
Best Regards
Imen
2018-01-22 07:30 PM
Hello Imen,
the workaround you provided didn't work.
BTW, I found the workaround works well.
modify the file stm32f1xx_hal_msp.c
1) find the function HAL_MspInit(void)
2) comment the line __HAL_AFIO_REMAP_SWJ_NOJTAG();
3) add new line
__HAL_AFIO_REMAP_SWJ_NONJTRST();
the detail as below.
/**NOJTAG: JTAG-DP Disabled and SW-DP Enabled
*/ //__HAL_AFIO_REMAP_SWJ_NOJTAG(); __HAL_AFIO_REMAP_SWJ_NONJTRST(); /* USER CODE BEGIN MspInit 1 */