2019-05-14 06:12 AM
Hi,
I use the STM32CubeIDE to generate the code of STM32L4 Discovery kit IoT node (B-L475E-IOT01A) and I have added code to use printf command. I can send text to HyperTerminal except ">" as code below.
printf("\fSTM32L4 Discovery kit IoT node (B-L475E-IOT01A)\r\n>");
But I tried to use code below. It can send ">".
uint8_t Text1[1] = {'>'};
HAL_UART_Transmit(&huart1,Text1,1,100);
Could you advise me to solve this problem?
Thank you
Solved! Go to Solution.
2019-05-14 06:51 AM
Try to use "fflush(stdout);" after the "printf"
Or, alternatively, turn off the buffering by issuing "setbuf(stdout, NULL);" once somewhere before.
2019-05-14 06:38 AM
Put the ">" before "\r\n" :
printf("\fSTM32L4 Discovery kit IoT node (B-L475E-IOT01A)>\r\n");
The standard C I/O implements buffering, you either need to flush the buffer or use the new-line symbol for auto-flush.
2019-05-14 06:47 AM
Thank you for your suggestion.
I would like to display ">" on HyperTerminal as below.
STM32L4 Discovery kit IoT node (B-L475E-IOT01A)
>
If I used Keil uVision5. It can use printf("\fSTM32L4 Discovery kit IoT node (B-L475E-IOT01A)\r\n>");
2019-05-14 06:51 AM
Try to use "fflush(stdout);" after the "printf"
Or, alternatively, turn off the buffering by issuing "setbuf(stdout, NULL);" once somewhere before.
2019-05-14 06:57 AM
Thank you for your suggestion.
It works.