cancel
Showing results for 
Search instead for 
Did you mean: 

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?

ZKURT.1
Senior

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

2 REPLIES 2
ZKURT.1
Senior

0693W00000Hpf1jQAB.png

TDK
Guru

'%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".