Page 1 of 1

STM32F407 UART/USART

Posted: Fri Oct 16, 2020 10:37 am
by Alan_37
Hi
I just started playing with STM32 so this is new for me, now I just came across something strange

I made a simple flowcode that initialize the Uart, enables the UART1 RX Interapt, the interapt calls a
macro to receive a string then that string is sent back to me so that I can test the UART is working correctly

everything is working fine until it comes in the part to send the string back to me, below you can see I am sending
a string: Test and I receive back the first 2 characters in a strange way.
uart.png
uart.png (26.32 KiB) Viewed 6351 times
A bit of help will be greatly appreciated :)

I am also attaching the flowcode file below

Re: STM32F407 UART/USART

Posted: Fri Oct 16, 2020 11:14 am
by Alkaline
Hello

I rewrote part of the program for you. If you use the interupts it is a good idea that the macro called by the inteurp does not introduce delay ect.

In this case the function receives a character from the uart port and puts it in a buffer. This allows to receive more characters, to store them in a buffer and subsequently to go and analyze them.

So the macro that performs the character reception has to do that and that's it and in the shortest time possible

In main, each data received is analyzed and put into a string.

Re: STM32F407 UART/USART

Posted: Fri Oct 16, 2020 11:26 am
by Alan_37
Hi Alkaline

Thanks for your reply I will test this and let you know the outcome shortly

Alan

Re: STM32F407 UART/USART

Posted: Fri Oct 16, 2020 11:34 am
by Alan_37
Hi Alkaline

It Works 100% thanks very much for your help.

Alan