OSError 28

I think the STM32 memory is full or the OS is corrupted.
I get an OSError 28 when I try to write to an open file .
I tried TOOLS/reset openmvcam. It did not solve the problem

Is this the internal flash memory? Or an SD card? If possible, please use and SD card for the file system. There are actually Desktop Operating System issues with the internal PYBFlash since it’s FAT12 (because it’s only 96KB). When you use an SD card most issues disappear.

I am using the is the M7 camera.
I attached my file.
I ran the file in the IED.
*when the program attempts the f.write statement I get the “OSError 28”.
Some background:
*The program originally worked fine.
*I inadvertently used “for j in range(1000):” and this is when the problem started.
*I changed back to "range(100), and the error flag is still generated.
Thanks,
Jim
copygrayvgatofile.py (1.19 KB)

Hi, we have a built-in method to do exactly what you are trying to do…

Do: save(“/file.pgm”, roi = (x_pos, y_pos, width, height))

http://docs.openmv.io/library/omv.image.html#image.image.save

When saved as a pgm file the binary will be saved in binary using the PGM file format: Netpbm - Wikipedia

As for your failure. If you are using the internal 96KB flash drive then you likely used it all up. You need to use an SD card with the OpenMV Cam if you want to save picture/video assets.

is there any way to clear the flash memory?

Yes, just reinstall the firmware and erase the internal flash drive. To do this click on the version label and follow the prompts.