WUnkn
New Contributor
5 years agoNIOS2 Host File System not Working
Hi all, please see my code below, I have hostfs enabled in BSP
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include "system.h"
#include "alt_types.h"
int main ()
{
printf ("HOSTFS step1\n");
FILE *fp;
fp = fopen ("/mnt/host/readme.txt", "a");
printf ("HOSTFS step2\n");
if (fp == NULL)
{
printf ("HOSTFS failed\n");
while (1);
}
else
{
fclose (fp);
printf ("HOSTFS OK\n");
}
return 0;
}
When execute my code on DE10_LITE board, I could only see HOSTFS step1
readme.txt is a very small ASCII file
Any idea it would not fopen readme.txt?
Thank u