Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
931 Views

How to store a .bmp picture on sdram?

Hi, I need your help on how to store an image from my pc into the niosII stratix II rohs's sdram, I do not know whether to use the host based file system using the fuctions fread, and fwrite,,, or if it would be better storing it first in flash (zip file system)and the into de sdram. 

 

I want to do this in order to send the data to some image processing Ip slave peripheral, working with the nios II processor, the processed data will be loaded into the same sdram and sent back to the host pc.  

 

I will really appreciate any help from you.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor I
147 Views

Hi, 

 

Did you manage to load the picture into SDRAM? would you help me? 

what C instructions did you use ? could you provide me with an example code? 

 

Thanks
Altera_Forum
Honored Contributor I
147 Views

I was able to do it using the host based file system, look it up on the IDE help, it is quite simple. just use functions like fread, and fwrite from the standard C to read and update an BMP file on host computer.

Altera_Forum
Honored Contributor I
147 Views

Another method would be to use system console. These days I'm not sure which one would be faster: HostFS or System console (file access over debug channel vs tcl...)

Altera_Forum
Honored Contributor I
147 Views

@naocojo  

I am considering using the M4K blocks too .. will this method work too? 

 

I have read an image from the SD_card, need to save it on kit(SDRAM) or Onchip memory of the FPGA, is all I need is to provide the fwrite and fread with the base address of the memory I am writing too to access these memories 

 

I have read that "The host-based file system only operates while debugging a project. It cannot be used for run sessions.", What does this mean 

 

@BadOmen 

How do I use the System console? where can i find a reference to read about it
Altera_Forum
Honored Contributor I
147 Views

http://www.altera.com/education/training/courses/oemb1117 

 

http://www.altera.com/literature/hb/qts/qts_qii53028.pdf 

 

If you search the alterawiki for system console you'll find a bunch of examples.
Reply