Forum Discussion
Altera_Forum
Honored Contributor
14 years agoprintf bug?
Hello. I've encountered a strange behaviour of prinf function. The code is a simple "hello world" example: #include <stdio.h>
int main()
{
printf("Hello 1\n");
printf("HELLO 2\n");
return 0...
Altera_Forum
Honored Contributor
14 years agoTry with a delay loop just before the return or even with a while(1) after the last printf.
Functions like printf are non-blocking: the string is sent to the jtag uart buffer, but transmission will take place when the interface is ready, thus it could be delayed. Terminating the program before transmission has completed could prevent data from being received by your terminal.