Concerning the Fat32 library usage:
There is a possible error in the outcome of routine "FAT32_Dev_SectorCount" in unit "__Lib_FAT32_Driver" of the Fat32 example in the mP PIC mpkg file:
Code excerpt:
Code: Select all
if (1 = ((csdbuf[0] and 0xC0) shr 6)) then
begin
size := 0; size := size shl 8;
size := size + (csdbuf[7] and 0x3F); size := size shl 8;
size := size + csdbuf[8]; size := size shl 8;
size := size + csdbuf[9]; size := size shl 0;
// size is in 0.5MB, get size in sectors (assumed 512 bytes sector size)
size := size * 1024; // <--- must be: Size := (Size+1) * 1024
end
The outcome of the unchanged routine will always be 1024 sectors (0.5 MB) too less.
Thanks in advance for changing this!