String send/receive application [USART of STM32]

Since it is not practical to send a single character code in USART with the STM32 MCU, this application has been developed to send and receive a continuous string of characters. This is an example of an application that uses a pointer to store a continuous string of characters in a variable and send/receive it.

In the previous article, we sent and received a single character, but actual communication handles strings of two or more characters; in USART serial communication, commands for sending and receiving themselves are in units of a single character (8 bits), so strings are sent and received one character at a time using arrays and pointers.

This time, the program sends and receives strings by storing them in variables using pointers.

Enter a string on the PC and store the string up to the terminating character '@' in the array RxString[] using a pointer.

This program detects if the input string matches the character code "ABC" registered in advance.

This program does not use interrupts, so there is a wait time while sending and receiving, and it is not practical, but it is a program that contains the basics of string sending and receiving.

Follow me!