Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

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.

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    @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