Community
cancel
Showing results for 
Search instead for 
Did you mean: 
서박사
Novice
181 Views

File handling using Nios II Software Build Tools for Eclipse

Hello,

I'm trying to use the Eclipse to compile the program for Nios II on the DE1-SoC FPGA.

I thought that the memory controller should be used for generating data logic (which means, generating data stream from the input file such as .csv file).

I started from the "DE1-SoC SDRAM Nios Demo" and tried to add the code for reading the input file using the function as fopen(), fscanf(), etc.

However, it seems that the program cannot read the input file while I specified the path of the input file.

So I'm wondering if the Eclipse is just a simple cross-compiler and the input file cannot be read since the program is running on the FPGA, which does not have the information of the input file.

As a result, my final questions are as follows:

1. Is that correct that the reason that the program cannot read the input file is the program is running on the FPGA which does not have the input file? (after writing this, I'm feeling that this question is very stupid...)

2. So how may I read the input file at the FPGA board?

 - Is there any way to insert the input file while running the Nios II program using Eclipse?

 - Should I use the HPS-FPGA (running FPGA with Linux filesystem) to use the input file?

 

Thank you for reading, and please comment on any idea since I'm quite new to FPGA & embedded programming.

0 Kudos
2 Replies
BoonBengT_Intel
Moderator
145 Views

Hi @서박사,

Is it possible to share the link to the NIOS demo mentioned? and also your NIOS project?
Also when you mention the inputs files cannot be read by the program, just curious what are the error that you are seeing?

And to answer the question that you have below:
1. Answer: Per my understanding only those FPGA board with CFI compliant flash component are able to do so.

2. So how may I read the input file at the FPGA board?
- Answer : Yes there is a way to do so, the easier options to use the read-only zip filesystem (http://www.altera.com/literature/hb/nios2/n2sw_nii52012.pdf). Example as image files, you can put your bmp file in an uncompressed .zip file, flash that file to a specific location, and enable the filesystem option in Eclipse. Then you'll be able to read your file with the standard file functions. There are other more complex options involving SD card or USB solution. You may also refer to this references design.(https://www.intel.com/content/www/us/en/programmable/support/support-resources/design-examples/intel...)

Warms Regards

BoonBengT_Intel
Moderator
119 Views

Hi @서박사,

Hope this message find you well and good day, as we do not receive any response from you to the previous clarification that we have provided. Please post a response in the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you with your follow-up questions. 

 

Warm Regards

Reply