Skip to main content
Javier1
Principal
February 21, 2023
Solved

CubeMX 6.3.0 allows me to use SW pins as GPIO outputs, CubeMX 6.6.1 doesn't

  • February 21, 2023
  • 1 reply
  • 1347 views

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.

0693W00000aHJ6pQAG.png

This topic has been closed for replies.
Best answer by Javier1

Fixed the issue by manually adding

__HAL_AFIO_REMAP_SWJ_DISABLE

in HAL_MspInit()0693W00000aHJKSQA4.png 

1 reply

Javier1
Javier1Author
Principal
February 21, 2023

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

0693W00000aHJCTQA4.png 

That __HAL_AFIO_REMAP_SWJ_DISABLE() is a macro defined in stm32f1xx_hal_gpio_ex.h

0693W00000aHJG6QAO.png0693W00000aHJJPQA4.png 

stm32f1xx_hal_gpio_ex.h/c were not changed when code was autogenerated, so the macro is still available

hit me up in https://www.linkedin.com/in/javiermuñoz/
Javier1
Javier1Author
Principal
February 21, 2023

When migrated to the newer cubeMx The HAL_MspInit() function becomes:

0693W00000aHJBbQAO.png

hit me up in https://www.linkedin.com/in/javiermuñoz/
Javier1
Javier1AuthorBest answer
Principal
February 21, 2023

Fixed the issue by manually adding

__HAL_AFIO_REMAP_SWJ_DISABLE

in HAL_MspInit()0693W00000aHJKSQA4.png 

hit me up in https://www.linkedin.com/in/javiermuñoz/