Skip to content

Commit 86fe75c

Browse files
committed
[STM32F3] Use USART3_BASE instead of UART3_BASE
This change allows the use of UART3 instance. This change fixes the following issue : https://developer.mbed.org/questions/4937/Serial-problem-no-Tx-to-PB_10 It's been validated on NUCLEO_F302RB, for PB_9 and PB_10 pins
1 parent db49c1e commit 86fe75c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hal/targets/hal/TARGET_STM/TARGET_STM32F3/serial_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
9494
__HAL_RCC_USART2_CONFIG(RCC_USART2CLKSOURCE_SYSCLK);
9595
obj->index = 1;
9696
}
97-
#if defined(UART3_BASE)
97+
#if defined(USART3_BASE)
9898
if (obj->uart == UART_3) {
9999
__USART3_CLK_ENABLE();
100100
__HAL_RCC_USART3_CONFIG(RCC_USART3CLKSOURCE_SYSCLK);
@@ -157,7 +157,7 @@ void serial_free(serial_t *obj)
157157
__USART2_RELEASE_RESET();
158158
__USART2_CLK_DISABLE();
159159
}
160-
#if defined(UART3_BASE)
160+
#if defined(USART3_BASE)
161161
if (obj->uart == UART_3) {
162162
__USART3_FORCE_RESET();
163163
__USART3_RELEASE_RESET();
@@ -252,7 +252,7 @@ static void uart2_irq(void)
252252
uart_irq(UART_2, 1);
253253
}
254254

255-
#if defined(UART3_BASE)
255+
#if defined(USART3_BASE)
256256
static void uart3_irq(void)
257257
{
258258
uart_irq(UART_3, 2);
@@ -296,7 +296,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
296296
vector = (uint32_t)&uart2_irq;
297297
}
298298

299-
#if defined(UART3_BASE)
299+
#if defined(USART3_BASE)
300300
if (obj->uart == UART_3) {
301301
irq_n = USART3_IRQn;
302302
vector = (uint32_t)&uart3_irq;

0 commit comments

Comments
 (0)