arduino-libraries / Arduino_USBHostMbed5

Apache License 2.0
4 stars 11 forks source link

Fix error in size() #22

Closed alrvid closed 1 year ago

alrvid commented 1 year ago

The size() function incorrectly returned the block size instead of the block size times the block count. This sent FATFileSystem::reformat() into an mbed_assert_internal - mbed_error - mbed_halt_system sequence, when disk_get_sector_count() in FATFileSystem.cpp calculates scount as 1 as a consequence. Thus, it wasn't possible to format FAT file systems on USB thumb drives.

github-actions[bot] commented 1 year ago

Memory usage change @ 9fe1909e724b00259c920a534127e19140346bcd

Board flash % RAM for global variables %
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_opta:opta :small_red_triangle: 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
Click for full report table Board|`examples/DirList`
flash|%|`examples/DirList`
RAM for global variables|%|`examples/FileRead`
flash|%|`examples/FileRead`
RAM for global variables|%|`examples/FileWrite`
flash|%|`examples/FileWrite`
RAM for global variables|%|`examples/OptaDirList`
flash|%|`examples/OptaDirList`
RAM for global variables|%|`examples/PortentaOTA`
flash|%|`examples/PortentaOTA`
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- `arduino:mbed_giga:giga`|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:mbed_opta:opta`|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|64|0.01|0|0.0 `arduino:mbed_portenta:envie_m7`|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A
Click for full report CSV ``` Board,examples/DirList
flash,%,examples/DirList
RAM for global variables,%,examples/FileRead
flash,%,examples/FileRead
RAM for global variables,%,examples/FileWrite
flash,%,examples/FileWrite
RAM for global variables,%,examples/OptaDirList
flash,%,examples/OptaDirList
RAM for global variables,%,examples/PortentaOTA
flash,%,examples/PortentaOTA
RAM for global variables,% arduino:mbed_giga:giga,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:mbed_opta:opta,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0 arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A ```
manchoz commented 1 year ago

Nice catch!

LGTM