cancel
Showing results for 
Search instead for 
Did you mean: 

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

Javier1
Principal

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

we dont need to firmware by ourselves, lets talk
1 ACCEPTED SOLUTION

Accepted Solutions

Fixed the issue by manually adding

__HAL_AFIO_REMAP_SWJ_DISABLE

in HAL_MspInit()0693W00000aHJKSQA4.png 

we dont need to firmware by ourselves, lets talk

View solution in original post

3 REPLIES 3
Javier1
Principal

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

we dont need to firmware by ourselves, lets talk

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

0693W00000aHJBbQAO.png

we dont need to firmware by ourselves, lets talk

Fixed the issue by manually adding

__HAL_AFIO_REMAP_SWJ_DISABLE

in HAL_MspInit()0693W00000aHJKSQA4.png 

we dont need to firmware by ourselves, lets talk