Closed MarkoSagadin closed 4 years ago
printf and printk have differences in the implementation and separate buffers. So printk can push stuff without a new line, but printf cannot do that.
Current solution is to replace all printk calls with printf's, then it works, this can be seen in commit 8bac408.
We can consider this as a workaround, as people coming from Zephyr are used to printk, not printf. If this presists we have to write it to README.
bu adding this line to setup:
setvbuf(stdout, NULL, _IONBF, 0);
the printf
output won't be buffered and will be printed immediately without a new line.
@MarkoSagadin
I implemented this in commit a95aab4, this solved the problem like you wrote.
There is a bug (or maybe feature) in Zephyr with printf implementation: buffer will be sent over serial only after calling printf with newline character or when buffer fills up.