Size of usb key mounted as openmv

Dear all,

When i connect a cam (H7/F7), there is a usb key mounted of 80Ko for F7 and 110Ko for H7 (without an SDCARD of course).
I would like to know if it is possible to increase this size of this usb key because the overall size of flash is 2Mo (F7/H7) and the full firmware + bootloader is around 1.3Mo.

I did not find any paramater in files of openmv3 and openmv4 directories.
In micropython/port/stm32/flashbdev.c, there are #define parameters but i dont understand how it works and so i dont know if there are the good ones…
#define FLASH_SECTOR_SIZE_MAX 0x08000
#define FLASH_MEM_SEG1_START_ADDR 0x080080000

Thanks for help,

No the filesystem is cached in memory, and the way it’s designed limits the filesystem to the smaller sectors at the beginning of the flash (16 or 32). So it can’t be increased.

Well i dont understand what means “filesystem is cached in memory” because :

F7 has :

  • sector (0) for boot of 32k
  • sector (1, 2, 3) for Fat of 32k each (32k x 3 = 96k)
  • sector 4 of 128k and sector (5 to 11) of 256k each for firmware each (128k + 7 x 256k = 1920K)

H7 has :

  • sector (0) for boot of 128k
  • sector (1) for Fat of 128k
  • sector (2 to 15 ) of 128k each for firmware (14 x 128k = 1792K)

In F7, there are 3 sectors for Fat, why dont do the same for H7 because the firmware is around 1.3Mo ?

Yes we can add more sectors to the H7. But the F7 can’t use any sectors larger than 32K.

That said, the flash filesystem is not intended to store images/videos etc… it’s just for scripts.

Flash doesn’t allow random modifications. Whenever you want to set a previously set 0 bit to 1 you have to erase the entire flash page and then re-write it.

So, to allow this when you write anything we have to suck in the entire flash into RAM, do the modification in RAM, and then erase the flash, and then write it back again. It’s not the fastest thing.

Yes i know, but the time to transfert image through UART is too long, and my idea was to stock these images temporarely to this flash.

I thought the vfs driver manage this page writing but you are right, there are some unstabilities.
eg, sometimes all files i had on this flash disappeared, probably because i disconnected it at the wrong time, like with USB1.

As well, I did an uartd_interface to flash H7 with a prompt c program, and even if i erased sector 1, i dont know why but the is not recreated…

Why not use an SD card?

Hi, I was going to add more sectors to the H7 filesystem, but I realized that it requires changes the bootloader and it must be updated before updating the firmware, otherwise the bootloader will jump to the old firmware address. So in conclusion this can’t be done right now, because it will force users to update their bootloaders.

Hi, iabdalkader

I am also looking approx 10 KB more in usb key size to use my script, is above updation available?

No it will Not be increased, actually we’re using all the flash right now.