Forum Discussion

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

Image Filtering problem

Hi,

I have a problem opening image from FLASH memory for writing. It opens it for reading only. There is some program code:

fp1 = fopen("/mnt/rozips/circuit_ch.bmp", "w");

if(fp1 == NULL){

printf("Can't open file: circuit_ch.bmp\n");

return 1;

}

fwrite((void*) buff2, 280*272, 1, fp1);

fclose(fp1);

It always printf a message that cant open a file.

I have programed my flash memory with ziped(without compression) images.

Can anyone help me?

P.S I run the program in Eclipse

Kind regards

Kycas

3 Replies

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

    If you are using the Zip filesystem provided with the Nios environment, then you can't write anything. The software module's full name is "Read-only ZIP filesystem"

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

    Thanks for Your reply.

    But how can I write an image into flash memory?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What do you want to do with the image contents once they are flashed? One way could just be to define a fixed area in the flash and just write the binary file contents there (maybe with an indication of the data size somewhere, and a magic number to signal the contents are valid).