Skip to content

Commit 4cd8025

Browse files
committed
doc: add Debug section to the FAQ
1 parent 8976588 commit 4cd8025

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

FAQ.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,29 @@ void loop() {
4949
}
5050
```
5151

52+
## Debug
53+
54+
Debug can not be functional using generic when some features are enabled. Example, with Generic L486 with USB enabled. When USB is initialized, it configures all the pins available in the `PinMap_USB_OTG_FS`:
55+
https://github.com/stm32duino/Arduino_Core_STM32/blob/c6bc5b23761c30ff5ef08baa22af1519b0a76d5a/variants/STM32L4xx/L475V(C-E-G)T_L476V(C-E-G)T_L486VGT/PeripheralPins.c#L403-L411
56+
57+
In this case `PA_13` is `JTMS-SWDIO` preventing debug to be functional.
58+
To avoid this, it is required to redefine the `PinMap_USB_OTG_FS` array to remove useless pins as explained [here](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Custom-definitions#example-for-the-adc-pinmap-of-the-nucleo_f103rb), like this:
59+
60+
```C
61+
const PinMap PinMap_USB_OTG_FS[] = {
62+
// {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
63+
// {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
64+
// {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
65+
{PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
66+
{PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
67+
// {PA_13, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_NOE
68+
// {PC_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_NOE
69+
{NC, NP, 0}
70+
};
71+
```
72+
73+
Issue discussed here: https://github.com/stm32duino/Arduino_Core_STM32/issues/2047
74+
5275
## OS specific
5376
### Linux
5477

0 commit comments

Comments
 (0)