AnsweredAssumed Answered

STM32F51K8 - UART Receiving using HAL libraries

Question asked by astley.rick on Jul 29, 2015
Latest reply on Jul 31, 2015 by astley.rick
Hello,

I'm working on a STM32F051K8 using the HAL libraries (with CubeMX).

The MCU is connected with a processor through an UART link.

I'm currently able to send characters strings withouth any problem using the normal mode (HAL_UART_Transmit) but I still don't understand how do I receive data using UART.

What I'm looking to do is detecting a specific characters string among the big data burst sent by the processor during its initialisation time.

I just don't understand what do I have to use/configure, despite all the research I've done until now.

I read about the circular buffer in DMA mode and also the RxCpltCallBack function but I don't understand what's needed to make them work or even how to use them (particularly the RxCpltCallBack function).

To make it simple, I just need to understand how can I receive data with the HAL_UART library.

I've tried using the USART1 Global Interrupt but it seems that no matter what's happening, the interruption is never triggered.
Obvsiously there is something that I missed since the beginning and it's why I'm asking for your help.

If someone could show me a general example code of  an UART reciving program while explaining the logic of the process it would be a great help for me. I'm looking for a specific strings among a big data burst so I guess interrupt mode or DMA mode would be the most useful for me.

Any help is appreciated.
Thank you.


(Sadly I dont have the time to learn to use the standart libraries, and I'm using HAL libraries because the team I'm working with was using them before I joined the project)
 

Outcomes