Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12387 Discussions

NIOS2 Host File System not Working

WUnkn
Beginner
337 Views

 

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

0 Kudos
6 Replies
BoonBengT_Intel
Moderator
285 Views

Hi @WUnkn,

Thank you for posting and sharing the finding in Intel community forum, hope this message find you well and apologies for the delayed in response.
If I understand the situation correctly, you would like to read from the 'readme.txt', please try changing the second param for the fopen to r as below and see if it works:
fp = fopen ("/mnt/host/readme.txt", "r");

Please do let us know if that helps.

Best Wishes
BB

BoonBengT_Intel
Moderator
255 Views

Hi @WUnkn,

Good day, just checking in to see if there is any further doubts in regards to this matter.
Please do let us know.

 

Best Wishes
BB

BoonBengT_Intel
Moderator
233 Views

Hi @WUnkn,

 

Hope this message find you well and good day, unfortunately as we do not receive any response from you to the previous clarification that we have provided. This thread will now be transitioned to community support. If you have new queries, please feel free to open a new thread to get support from Intel experts. Otherwise, the community users will further help you with doubts in this thread.

 

Best Wishes
BB

BoonBengT_Intel
Moderator
225 Views

Hi @WUnkn,

 

Hope you are well, glad that you are back with us.
Quick check did you managed to try on the previous suggestion?
Please do let us know if there is any further clarification/doubts/issues on the previous steps so that we can better understand the situation.

 

Best Wishes
BB

BoonBengT_Intel
Moderator
184 Views

Hi @WUnkn,

 

Hope you are doing well and safe.
Any updates on the following thread?

 

Best Wishes
BB

BoonBengT_Intel
Moderator
174 Views

Hi @WUnkn,

 

Unfortunately as we still do not receive any response from you to the previous clarification that we have provided, hence would assume problem are closed. With that we will now be transitioned to community support. If you have new queries, please feel free to open a new thread to get support from Intel experts. Otherwise, the community users will further help you with doubts in this thread.

 

Best Wishes
BB

Reply