This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sprintf function does not work in keil

Hi to all
I am new in STM32 and keil (I used Atmel chips) and now I am getting familier with them.
I made a project and I can send data to serial port with the following function :
"HAL_UART_Transmit(&huart1,(uint8_t *) "Hello\n\r", 7, 10);"
but I do not know why there is no data when I use the following function based on sprintf:
"sprintf((char *) buffer,"23");"

The thing is that the code is well compiled and there is no error but the function does not work.
Do I need to add some more code for sprintf function ??!!!

Help please

Parents
  • Compiler errors tell you about errors in syntax, not errors of logic or judgement.

    sprintf() should fill the buffer, but that's going to depend on how you define the buffer, which you fail to show, and then whether you output it anywhere, which again you don't show.

    You need to learn how to clearly explain and present problems, be attentive to detail.

Reply
  • Compiler errors tell you about errors in syntax, not errors of logic or judgement.

    sprintf() should fill the buffer, but that's going to depend on how you define the buffer, which you fail to show, and then whether you output it anywhere, which again you don't show.

    You need to learn how to clearly explain and present problems, be attentive to detail.

Children