2023-02-21 02:31 AM
I am using the SW pins as GPIO outputs for Softpwm generation.(DMA+GPIO)
All works great if i do "continue", but when i decide to "migrate" the cubeMx to the last version and i click regenerate code.... the SWDIO and SWCLK pins are not used as GPIO outputs.
Solved! Go to Solution.
2023-02-21 03:05 AM
Fixed the issue by manually adding
__HAL_AFIO_REMAP_SWJ_DISABLE
in HAL_MspInit()
2023-02-21 02:50 AM
after doing a git diff, one of the changes cubeMX does when migrated to 6.6.1 and autogenerate code is: to remove
__HAL_AFIO_REMAP_SWJ_DISABLE
from the ....hal_msp.c file
That __HAL_AFIO_REMAP_SWJ_DISABLE() is a macro defined in stm32f1xx_hal_gpio_ex.h
stm32f1xx_hal_gpio_ex.h/c were not changed when code was autogenerated, so the macro is still available
2023-02-21 02:58 AM
When migrated to the newer cubeMx The HAL_MspInit() function becomes:
2023-02-21 03:05 AM
Fixed the issue by manually adding
__HAL_AFIO_REMAP_SWJ_DISABLE
in HAL_MspInit()