Skip to content

Commit c322ae5

Browse files
committed
[U(S)ART] Fix AF settings
Since e02bc35, some serial was not functional. Ex for Nucleo-L432KC, the AF of USART2 (used for STLink VCP) are not the same. Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 8854222 commit c322ae5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cores/arduino/stm32/uart.c

+3
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ void uart_init(serial_t *obj)
285285
GPIO_InitStruct.Pin = STM_GPIO_PIN(obj->pin_tx);
286286
GPIO_InitStruct.Mode = STM_PIN_MODE(function);
287287
GPIO_InitStruct.Pull = STM_PIN_PUPD(function);
288+
#ifndef STM32F1xx
289+
GPIO_InitStruct.Alternate = STM_PIN_AFNUM(function);
290+
#endif /* STM32F1xx */
288291
HAL_GPIO_Init(port, &GPIO_InitStruct);
289292

290293

0 commit comments

Comments
 (0)