Under eCos HAL -> Nios2 architecture you can set diagnostic console device and debug device. I believe that the diag device is set to jtag_uart default and the debug is set to uart. Just remove the uart from the debug device and you will not get any messages out on the uart. Printf uses jtag_uart so that you can use nios2-terminal or run the program from Nios IDE and see your printf messages there. This is a pretty nice to have in case of debugging and interacting with your system.
If you call your uart uart in SOPC, you can access it with this:
//Make a handle and a couple of variables
cyg_io_handle_t uart;
int uartlen;
unsigned char uartbuf[100];
//Look up the handle, if your uart is called uart, you'll find it on /dev/uart. If it's called uart1 you'll find it on /dev/uart1
cyg_io_lookup("/dev/uart", &uart);
//And then you can read from it:
uartlen = 80;
cyg_io_read(uart, (void*)&uartbuf[0], &uartlen);
//And write to it:
cyg_io_write(uart, (void*)&uartbuf[0], &uartlen);
Look here:
http://ecos.sourceware.org/docs-latest/ref...o-user-api.html (
http://ecos.sourceware.org/docs-latest/ref/io-user-api.html) for more information.
Ole