STM32F103_MSD_BOOTLOADER icon indicating copy to clipboard operation
STM32F103_MSD_BOOTLOADER copied to clipboard

Change MSD size to match real flash size

Open tusker-tools opened this issue 3 years ago • 6 comments

Currently, the total size of the mass storage device shows 116MB, from which 115MB are free (according Windows Explorer).

It would be better to display the actual sizes:

  • Total Memory = DEV_FLASH_SIZE
  • Free Memory = APP_SIZE

Furthermore, it would be better to define a new compiler constant for the bootloader size and use it for calculating APP_ADDR and APP_SIZE in btldr_config.h

tusker-tools avatar Jan 12 '22 17:01 tusker-tools

The minimum FAT32 disk size is 32MB, it cannot indicate 64KB flash capacity.

sfyip avatar Jan 15 '22 02:01 sfyip

You are right about the minimum capacity.

Then could we at least have a total volume of 32MB where only 64KB minus BOOTLOADER_SIZE is free and the rest is occupied?

tusker-tools avatar Jan 16 '22 14:01 tusker-tools

Do you have the information how e.g. Windows calculates the free space of a FAT32 partition? Unfortunately I can't find anything in the internet, so I don't know how to realize it.

tusker-tools avatar Jan 27 '22 17:01 tusker-tools

http://elm-chan.org/fsw/ff/doc/getfree.html Usually looks into the free cluster size in FAT32 structure.

sfyip avatar Jan 31 '22 08:01 sfyip

Thus, have you succeeded with the volume size correction?

oliinykb avatar Jan 09 '24 09:01 oliinykb

No, I did not succeed. I tried different configuration parameters for the FAT32 partition, but this did not lead to the intended change. Unfortunately, I'm not deep enough into the FAT32 internals. I would appreciate if anybody could help.

tusker-tools avatar Jan 15 '24 19:01 tusker-tools