-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic L4 variants disable SWD debugging without any notice #2047
Comments
Hi @fronders |
I've added a debug section to the FAQ: |
I have a custom STM32L486-based board and wanted to debug via SWD using ST-Link V3.
![image](https://private-user-images.githubusercontent.com/15352046/248755050-27761178-e1bb-4ae5-9f3c-898a939f08e3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1NzU0NjAsIm5iZiI6MTcyMDU3NTE2MCwicGF0aCI6Ii8xNTM1MjA0Ni8yNDg3NTUwNTAtMjc3NjExNzgtZTFiYi00YWU1LTlmM2MtODk4YTkzOWYwOGUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDAxMzI0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmZWNlNWZjYTY3MTU5YmUxM2MyMTQ3NGMxOWVmNzBiZDI5NmI1ZjRhM2UzMDYwNTMzYjJjYWUyNjE1Y2E3ZWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uzcWTiLLeQdfeiTiHZURfu380rYFeDsuiOZ0kJs9358)
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: