cancel
Showing results for 
Search instead for 
Did you mean: 

About UART of STM32F411RET6/STM32F030R8 Nucleo board using STM32CubeMX 4.8.0 and keil 5.14

kufosan
Associate II
Posted on July 12, 2015 at 07:22

Dear

I have two Nucleo board,  STM32F411RET6 and STM32F030R8.

so I tested two board, and got some interesting(?) results.

two board was good for sending.

when UART using HAL_UART_Transmit_IT(HAL_UART_TxCpltCallback) is good.

but receiving is not good.

firstly 

I checked the usb2serial module and test serial program also, these are ok.

for STM32F030R8

if the size of the received data is 90Bytes,

(012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789) 

then HAL_UART_RxCpltCallback gets signal but just one time.

for STM32F411RET6

if the size of the received data is 200Bytes,

(01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789) 

then HAL_UART_RxCpltCallback gets signal

and if I send next 200Bytes, then HAL_UART_RxCpltCallback  also gets the signal repeatly.

What's the reason for these results?

Would you help me?

#stm32f030r8 #stm32f411ret6 #uart
2 REPLIES 2
kufosan
Associate II
Posted on July 12, 2015 at 08:35

The reason is the buffer size of HAL_UART_Receive_IT(..).

But If I want to receive the data, I call the HAL_UART_Receive_IT(..) repeatly.

So I need  to receive the data by interrupt not call repeatly.

In this forum, some answer used the code ''USART_GetITStatus(USART1, USART_IT_RXNE)'' for that in ''USART3_IRQHandler(void)''.

But If the code is made by STM32CubeMX automatically, ''USART_GetITStatus(..)'' does not exist.

How can I receive the data by interrupt not call HAL_UART_Receive_IT repeatly?

and How can I use similar function like USART_GetITStatus(..) in Nucleo board?

Would you help me?

Dear

I have two Nucleo board,  STM32F411RET6 and STM32F030R8.

so I tested two board, and got some interesting(?) results.

two board was good for sending.

when UART using HAL_UART_Transmit_IT(HAL_UART_TxCpltCallback) is good.

but receiving is not good.

firstly 

I checked the usb2serial module and test serial program also, these are ok.

for STM32F030R8

if the size of the received data is 90Bytes,

(012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789) 

then HAL_UART_RxCpltCallback gets signal but just one time.

for STM32F411RET6

if the size of the received data is 200Bytes,

(01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789) 

then HAL_UART_RxCpltCallback gets signal

and if I send next 200Bytes, then HAL_UART_RxCpltCallback  also gets the signal repeatly.

What's the reason for these results?

Would you help me?

Posted on July 12, 2015 at 16:28

How can I use similar function like USART_GetITStatus(..) in Nucleo board?

You could use SPL instead or HAL/Cube? You're more likely to get support on the forum with that.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..