Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

4.4.5.3. Output From a printf() or perf_print_formatted_output() Call Near the End

This issue occurs when the Nios® II application executes a BREAK instruction to transfer profiling data to the development workstation during the exit() or return() from main().

As a workaround, call usleep(500000) before exiting or returning from main(). This call creates an adequate delay for you to transmit the I/O to the JTAG UART before main returns (or calls exit()). If the output is still partially truncated, increase the delay value passed to usleep(). Use #include <unistd.h> for the usleep() function prototype.