I am trying to read a file using NIOS with the eventual goal of loading that readdata into an EEPROM.
I have followed the instructions outlined in : https://www.intel.com/content/www/us/en/programmable/documentation/mwh1416947091611.html
I have gone to the BSP editor -> Software Packages and enabled altera_hostfs. The hostfs_name is /mnt/host
My code (included below) gets stuck at fopen but if I use the NIOSII debugger, I am able to step through the whole program and readout "Hello World" into the console. Any suggestions would be appreciated.
#define BUF_SIZE (12)
fp = fopen("/mnt/host/read_test.txt", "r");
if (fp == NULL)
printf ("connot open file for reading\n");
fread(buffer, BUF_SIZE, 1, fp);
I see the following reference is useful for you, please let me know if it isn't useful:
BTW, please make sure you flush the cash to be able to see the output.