You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom STM32L486-based board and wanted to debug via SWD using ST-Link V3.
So I'm using release 2.5.0 and selected Generic STM32L4 series with board PN Generic STM32L486RGTx and the following options:
So the code uploads okay, but the debugging session would not start. After hours of battling with openocd configs and trying multiple different options I discovered it can only connect after chip was previously erased. This made me wonder if SWD pins might be disabled.
PA_13 is initialized there, which kills the debugging ability.
As soon as I redefined this PinMap as a strong in my sketch with that line definitions commented out
Would it be better to define those pins overridden if needed explicitly? Like, wrap it in an ifdef for example when debug symbols are enabled, or smth similar. Also please advise on the best solution in my case. I can keep the redefined PinMap_USB_OTG_FS[], or even create my own board variant, but the fact that this isn't mentioned anywhere and I had to kill like a day for finding this, is certainly discouraging.
Thanks
The text was updated successfully, but these errors were encountered:
Hi @fronders
Sorry for that, generic provide all possibles values and those files are automatically generated.
With STM32 there are several possibilities for pins and hard to fit/guess what user want. You used the correct way by redefining the PinMap array, that is why it is defined as WEAK.
Maybe a note could be added in the FAQ section of the Wiki. https://github.com/stm32duino/Arduino_Core_STM32/wiki/FAQ
I have a custom STM32L486-based board and wanted to debug via SWD using ST-Link V3.
So I'm using release 2.5.0 and selected
Generic STM32L4 series
with board PNGeneric STM32L486RGTx
and the following options:So the code uploads okay, but the debugging session would not start. After hours of battling with openocd configs and trying multiple different options I discovered it can only connect after chip was previously erased. This made me wonder if SWD pins might be disabled.
I checked variant's
PeriperalPins.c
Arduino_Core_STM32/variants/STM32L4xx/L475V(C-E-G)T_L476V(C-E-G)T_L486VGT/PeripheralPins.c
Lines 398 to 411 in fa8f7b8
PA_13
is initialized there, which kills the debugging ability.As soon as I redefined this PinMap as a strong in my sketch with that line definitions commented out
// {PA_13, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_NOE
debugging started working like a charm!
Would it be better to define those pins overridden if needed explicitly? Like, wrap it in an
ifdef
for example when debug symbols are enabled, or smth similar. Also please advise on the best solution in my case. I can keep the redefinedPinMap_USB_OTG_FS[]
, or even create my own board variant, but the fact that this isn't mentioned anywhere and I had to kill like a day for finding this, is certainly discouraging.Thanks
The text was updated successfully, but these errors were encountered: