FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5925 Discussions

How to store a .bmp picture on sdram?

Altera_Forum
Honored Contributor II
1,481 Views

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 II
697 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
0 Kudos
Altera_Forum
Honored Contributor II
697 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.

0 Kudos
Altera_Forum
Honored Contributor II
698 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...)

0 Kudos
Altera_Forum
Honored Contributor II
698 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
0 Kudos
Altera_Forum
Honored Contributor II
698 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.
0 Kudos
Reply