<p>The data read/write operation to the storage devices is done in unit of <em>sector</em>. FatFs supports the sector size in range of from 512 to 4096 bytes. When FatFs is configured to fixed sector size (<tt>_MIN_SS == MAX_SS</tt>, this will be the most case), the read/write function must work at that sector size. When FatFs is configured to variable sector size (<tt>_MIN_SS != MAX_SS</tt>), sector size is inquired with <tt>disk_ioctl</tt> function following <tt>disk_initialize</tt> function.</p>
<p>The memory address specified by <ttclass="arg">buff</tt> is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. The unaligned read/write request can occure at <ahref="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow unaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
<li>On the <tt>f_read()</tt> calls, avoid long read request that includes a whole of sector. - Any direct transfer never occures.</li>
<li>On the <tt>f_read(fp, data, btw, bw)</tt> calls, make sure that <tt>(((UINT)data & 3) == (f_tell(fp) & 3))</tt> is true. - Word alignment of <ttclass="arg">buff</tt> is guaranteed.</li>
<p>Generally, a multiple sector transfer request must not be split into single sector transactions to the storage device, or you will not get good read throughput.</p>