Version in mbed-os is different if RTOS is not present.
Not checking the version number explicitly for mbed-2, but will leave the warning
as few API changes were done, and tracking of version is not done for them in
mbed-2.
Deselecting card while it is busy programming and selecting again was causing
corruption (Illegal command) with slow speed cards. Will wait for read/write
operations to complete before deselecting the card.
For better or worse, erase in the block device API is intended for flash
erases, which is a low-level operation that must occur before every
write and limits the write size of the underlying blocks. This is
different than the erase size found in SD cards, which does not limit
the write size for blocks.
Following the standard set by ATA and the ioctl function, we are adding
a seperate operation for the SD card erase behaviour named trim.
See for more info:
https://en.wikipedia.org/wiki/Trim_(computing)
Since it's an optimization, we should only send the command if the range
of bytes being erased fits. get_erase_size should still report 512, and
the erase should just noop with <SECTOR_SIZE bytes being erased. If
filesystems erase a larger range (at least spiffs does this), the
optimization can kick in.
Using fix from mbed-os core, where few devices were failing with
SPI block read, as default data on SPI was sent 0x00.
Using API 'set_default_write_value' to set the default tx fill data.
CMD9 fails for few cards if spi.write is performed during deslect of card
Card immediately sends start packet token, which goes missing in this dummy
write to SPI. Should not clock SPI bus in deselect operation.