2025-04-27 5:13 PM
I have found another bug in SWDIO code generation. I previously reported that no code is generated for SWCLK, but if both are relocated, SWDIO is also incorrect. The .Alternate uses a define of GPIO_AF1_SYS, which does not exist in stm32wl3x_hal_gpio_ex.h. The correct define should be GPIO_AF1_SWDIO, which is.
Generated code:
GPIO_InitStruct.Alternate = GPIO_AF1_SYS;
Correct to:
GPIO_InitStruct.Alternate = GPIO_AF1_SWDIO;
2025-04-27 11:47 PM
Hello @divmstr
I've tested on my side (using the STM32CubeMX V6.14.1 and the STM32CubeIDE V1.18.1). And it seems to generate the correct macro "GPIO_AF1_SWDIO".
Could you please test it on your side (using the same versions I've used) and if it is not working, please add your .ioc file.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.