Printf Function by STM32
Printf Function by STM32
If somebody want to take some variable in the STM32 code, he might use the output devices to check the
variable. However, the output devices such as segment, LCD, or something else might have their own
function; they can not always display the variable. However, for the debugging, the PC, can be use as a output
by serial communication. The post I wrote before is about the serial communication. Using this serial
communication, we can find the variable of the stm32 and debugging easily. Firstly, let's discuss about the
echo test. The echo test is for the test which the devices properly react from the signal of PC.
*All the code need USART connection with PC. Refer to the previous post.
I give you a code to receive a character from the computer and send the next character of the ASCII when the
serial communication is occurred.
int main(void)
uint8_t ch;
while(1)
else
This code send the echo of the user's input. If you input "a" on the Tera term, you can get "b" on the screen.
Then, let's make a "printf" function on the stm32.
int main(void)
uint8_t ch;
while(1)
else