a very simple question about Nios2 eclipse project build
Dear Support/Expert
I have a very simple code while I play with Nois2 and SPI interface.
/* "Hello World" example.
*/
#include "alt_types.h"
#include "altera_avalon_spi_regs.h"
#include "altera_avalon_spi.h"
#include "system.h"
#include <stdio.h>
#include <unistd.h> // usleep
int main( void){
printf ("Entered Main \n");
alt_u8 send_M;
alt_u8 count;
count = 0;
while (1) {
send_M = count;
IOWR_ALTERA_AVALON_SPI_TXDATA(SPI_0_BASE, send_M);
// Wait for transfer to complete
usleep(75);
// Print results
printf("master sent = %d \n",send_M);
count ++;
usleep(1000000);
} // end while
return 0;
}
--------------------------------
I will have this compile error
Description Resource Path Location Type
make: *** [spi_test2.elf] Error 1 spi_test2 C/C++ Problem
recipe for target 'spi_test2.elf' failed Makefile /spi_test2 line 1015 C/C++ Problem
I have tried %i, %c, %u. none of them can pass project build.
but if I comment off the
printf("master sent = %d \n",send_M);
the project will build successfully.
I am new to Nios and eclipse, and I don't write C code.
what is the problem of this printf sentence and how to solve it?
Thank you,
David