This is a new thread regarding TFS issues seen here : Click drivers from MBN
@dat_tran : if I look at your source code in TinyFileSystem.cs, I can see the following :
this.blockDriver = new BlockDriver(storage, storage.PagesPerCluster); // Precalculate commonly used values based on the device parameters provided by the block driver. this.totalSectorCount = (ushort)(this.blockDriver.DeviceSize / this.blockDriver.SectorSize); this.clustersPerSector = (ushort)(this.blockDriver.SectorSize / this.blockDriver.ClusterSize); this.totalClusterCount = (ushort)(this.blockDriver.DeviceSize / this.blockDriver.ClusterSize);
Btw, those are the same in our driver, naming convention apart.
But, you set the following values in the qspi driver :
public override int Capacity => 0x1000000; public override int PageSize => 0x1000; public override int SectorSize => 0x1000; public override int BlockSize => 0x1000;
So, when the constructor gets called, you will have (pseudo-code) :
this.totalSectorCount = 0x1000000 / 0x1000 = 0x1000; this.clustersPerSector = 0x1000 / 0x4000 = 0; this.totalClusterCount = 0x1000000 / 0x4000 = 0x400;
clustersPerSector value being 0 will throw an exception later in the code. So I don’t understand how setting the same 0x1000 value for all properties can work on your side
Also, can you tell me what are the meanings of the different parameters in the different qspi methods, please ?
I’m confused between addresses, sectors, bytes, etc…