Size of usb key mounted as openmv

General discussion about topics related to OpenMV.
User avatar
chrisPyres66
Posts: 117
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Size of usb key mounted as openmv

Postby chrisPyres66 » Fri Jul 12, 2019 6:06 am

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
#define FLASH_MEM_SEG1_NUM_BLOCKS 192

Thanks for help,
User avatar
iabdalkader
Posts: 952
Joined: Sun May 24, 2015 3:53 pm

Re: Size of usb key mounted as openmv

Postby iabdalkader » Fri Jul 12, 2019 6:58 am

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.
User avatar
chrisPyres66
Posts: 117
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: Size of usb key mounted as openmv

Postby chrisPyres66 » Thu Aug 01, 2019 5:21 am

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 ?
User avatar
iabdalkader
Posts: 952
Joined: Sun May 24, 2015 3:53 pm

Re: Size of usb key mounted as openmv

Postby iabdalkader » Thu Aug 01, 2019 1:17 pm

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.
User avatar
kwagyeman
Posts: 3338
Joined: Sun May 24, 2015 2:10 pm

Re: Size of usb key mounted as openmv

Postby kwagyeman » Thu Aug 01, 2019 1:58 pm

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.
Nyamekye,
User avatar
chrisPyres66
Posts: 117
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: Size of usb key mounted as openmv

Postby chrisPyres66 » Fri Aug 02, 2019 6:07 am

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 autotest.py is not recreated...
User avatar
kwagyeman
Posts: 3338
Joined: Sun May 24, 2015 2:10 pm

Re: Size of usb key mounted as openmv

Postby kwagyeman » Fri Aug 02, 2019 12:06 pm

Why not use an SD card?
Nyamekye,
User avatar
iabdalkader
Posts: 952
Joined: Sun May 24, 2015 3:53 pm

Re: Size of usb key mounted as openmv

Postby iabdalkader » Fri Sep 06, 2019 2:58 pm

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.

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 5 guests