If a host-side (PC host) is connected, there is no problem. However, if the host-side is disconnected, there are two reasons why printf() would block:
1. The user is using a reduced ("small") device driver. - Checkbox for "Reduced device drivers" is checked in System Library Properties page in the Nios II IDE. - The reduced device driver assumes that the host-side is always connected.
2. The user is using the default device driver, for the JTAG UART, but has no "system timer" defined (In the SOPC Builder system/In the System Library properties page). The default device driver does support "device/jtag_uart timeouts", but requires a "system timer" to implement this.
Resolution: (If necessary) change to the default device driver and be sure that you have a system timer in your SOPC Builder system and defined in your System Library.