Skip to main content
ZKURT.1
Senior
December 23, 2021
Question

Hi. I want to send an "int" with the HAL_UART_Transmit method. But the strange shapes that I added appear in the picture. Why could it be?

  • December 23, 2021
  • 2 replies
  • 2490 views

Hi. I want to send an "int" with the HAL_UART_Transmit method. But the strange shapes that I added appear in the picture. Why could it be?

0693W00000HpeznQAB.png0693W00000Hpew1QAB.png

This topic has been closed for replies.

2 replies

ZKURT.1
ZKURT.1Author
Senior
December 23, 2021

0693W00000Hpf1jQAB.png

TDK
December 23, 2021

'%d' is not a string. Change it to "%d".

GCC provides a warning when you do this that you should have noticed:

../Core/Src/main.c:120:19: warning: multi-character character constant [-Wmultichar]

../Core/Src/main.c:120:19: warning: passing argument 2 of 'sprintf' makes pointer from integer without a cast [-Wint-conversion]

"If you feel a post has answered your question, please click ""Accept as Solution""."