Page 1 of 1

Broken STM32F030 UART driver

Posted: Mon May 22, 2017 11:15 am
by andresv
Hi,

UART driver does not compile with RT-STM32F030R8-NUCLEO64 demo code.
The only change what I did was just to turn on UART1 driver from mcuconf.h and halconf.h

Code: Select all

#define STM32_UART_USE_USART1               TRUE


Code: Select all

#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
#define HAL_USE_UART                TRUE
#endif


And got following error:

Code: Select all

Compiling ch_test.c
Compiling test_root.c
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c: In function 'translate_errors':
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c:35:24: error: 'USART_ISR_LBD' undeclared (first use in this function)
 #define USART_ISR_LBDF USART_ISR_LBD
                        ^
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c:172:13: note: in expansion of macro 'USART_ISR_LBDF'
   if (isr & USART_ISR_LBDF)
             ^
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c:35:24: note: each undeclared identifier is reported only once for each function it appears in
 #define USART_ISR_LBDF USART_ISR_LBD
                        ^
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c:172:13: note: in expansion of macro 'USART_ISR_LBDF'
   if (isr & USART_ISR_LBDF)
             ^
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c: In function 'usart_start':
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c:237:33: error: 'USART_CR2_LBDIE' undeclared (first use in this function)
   u->CR2 = uartp->config->cr2 | USART_CR2_LBDIE;
                                 ^
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c: In function 'serve_usart_irq':
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c:35:24: error: 'USART_ISR_LBD' undeclared (first use in this function)
 #define USART_ISR_LBDF USART_ISR_LBD
                        ^
../../../os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c:324:14: note: in expansion of macro 'USART_ISR_LBDF'
   if (isr & (USART_ISR_LBDF | USART_ISR_ORE | USART_ISR_NE |
              ^
Compiling test_sequence_001.c
make: *** [build/obj/hal_uart_lld.o] Error 1
make: *** Waiting for unfinished jobs....


gcc: arm-none-eabi-gcc-4.9.3
chibios:
commit b9df092c8c8134e51dd63b2e5046842d14019c59
Author: Giovanni Di Sirio <[email protected]>
Date: Thu May 18 13:35:01 2017 +0000

EDIT: found another thread about this problem: viewtopic.php?t=3389.

Re: Broken STM32F030 UART driver

Posted: Mon May 22, 2017 11:51 am
by Giovanni
Hi,

Moving this in "bug reports" or it will be forgotten again...

Giovanni

Re: Broken STM32F030 UART driver

Posted: Sun May 28, 2017 4:25 pm
by Giovanni
Hi,

Fixed in repository.

Giovanni