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.
12437 Discussions

Read/Write image file in Nios II

Altera_Forum
Honored Contributor II
1,019 Views

Hi Everyone, 

 

 

 

 

 

I want to load an image file (.bmp) using the Nios II but I can not! I used the fopen command and managed to load the image, but when I try to write in another file something happens that the image comes out deformed. 

 

Does anyone know how I can load images in the Nios II? 

 

 

 

Thank you!
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
192 Views

Hello, 

It is not easy to solve your issue, i do not have a lot of info. 

There are different flags that you can use with the fopen command in C. 

One of them determines if you read the file binairy or in a sort of interpreted text mode. 

Are you reading the files in binairy mode ? (fopen with flags "rb+" and "wb+"), if not, interpretation CR/LF can cause deformation of data. 

Best Regards, 

Johi.
Altera_Forum
Honored Contributor II
192 Views

bitmap files have header that stores information about them, see if this header is corrupted.

Altera_Forum
Honored Contributor II
192 Views

I have used the Demonstration project from DE2-115 DVD and got an FAT library, now I can open files.

Reply