History: usbh_cd_mst

This page describes all changes made to the usbh_cd_mst package, the USB Host Mass Storage Class Driver, since its release.


3.17 (2021-03-30, 16:43):

  • Fixed the transfer direction of the SCSI Synchronize Cache command as DIR_ANY was set which resulted in an IN direction, despite the command being an OUT command.

3.16 (2020-07-07, 13:03):

  • MST device was not handled correctly on interfaces other than 0.

3.15 (2020-02-27, 16:45):

  • Compiler Warning eliminated.

3.14 (2019-08-27, 16:30):

  • Static analysis issues eliminated.

3.13 (2018-09-07, 08:36):

  • Transfer could not be started from multiple tasks.
  • Refactoring to comply with coding standard rules.

3.12r2 (2018-08-29, 18:17):

  • Document HTML link added to the documentation folder.
  • History and document files renamed to the package name.

3.12 (2018-05-09, 13:16):

  • f_initvolume() could return with error code 16 (F_ERR_CARDREMOVED) when called after f_delvolume(). START STOP UNIT command is now disabled by default in configuration.

3.11 (2018-05-03, 06:56):

  • Eliminated possible data loss: synchronizes buffers on the remote device when driver is released or flush function is called.
  • Slow reading and writing could be experienced when f_putc() was used and  SCSI_SUPPORT_REMOVABLE_DEVICE=1, because device status was requested at every call. Introduced option SCSI_REMOVABLE_DEVICE_POLL_INTERVAL_MS.


  •  Refactoring to comply with coding standard rules (CodeSonar).


  •  usbh_mst_present() could incorrectly report the presence of the device straight after disconnecting it.


  •  Static analyzer warnings were eliminated. psp_types.h is included instead of stdint.h.


  •  CD-ROM support added.


  •  Media not supporting Test Unit Ready were not possible to get mounted. Non-removable media are supported now in case SCSI_SUPPORT_REMOVABLE_DEVICE is enabled.


  •  Class driver got stuck while trying to issue Mode Sense command to some MSDs (MSDs returning less than 8 Bytes were affected).


  •  scsi_read()/scsi_write() incorrectly reported success in case of timeout (error).
  •  scsi_write() retried the write even if the media reported write protection (causing a big delay before reporting the error).


  •  Updated to work with USB host base major version 3.


  •  Treat "MODE SENSE" not supported if the request returns command failed. Some memory sticks couldn't be accessed without this modification.


  •  READ(12) and WRITE(12) removed, some MSD doesn't support it, so only READ(10) WRITE(10) is used.


  •  scsi_raw_read() and scsi_raw_write() added, these functions adds the possibility to send raw SCSI commands to the device and read/write data.
  •  LUN ID parameter added to SCSI communication transfer function.


  •  no. of available blocks was incorrectly reported as one less.


  • Last block couldn't be read/written due to a comparison error
  • SCSI version merged with MST, SCSI version file was:


     - definition of unused command codes removed.

     - scsi_mode_sense(): handle the case when device does not support MODE SENSE command.

     - scsi_test_unit_ready(): LUN state handled here if TEST UNIT READY succeeded but current LUN state is DISCONNECTED.

     - scsi_get_unit_state(): extra call for request_sense() removed: REQUEST SENSE needs to be called only in case TEST UNIT READY reported IO_CHECK.


     - lun_state cleared at startup, caused unoperational media on systems where uninitialized variables are not cleared at startup.


     - Mode sense request will also check the validity of the response length. Some memory sticks reports invalid response without refusing mode sense 10 request.


     - psp_endianness.h used instead of psp_endiness.h.


     - needless version checks removed from API header file.

     - return codes changed from enum to #define.


     - read/write checks if the accessed sector (range) is valid, this way over-addressing a device can be avoided.


     - OAL resource initialization changed. It will free resources from init in case of failure.


     - scsi descriptor communication interface check added to scsi_get_lun_info() and scsi_get_unit_state() to protect the system against disconnection.


 - usbh_mst_transfer(): in case an IN transfer after a successful Command gets STALLed by the device, ERR_IO_NOT_SUPP is returned.


 - psp_endianness.h used instead of psp_endiness.h.

 - usbh_utils version number check removed.


 - needless version checks removed from API header file.

 - all notification callbacks are cast to (void) to avoid warnings this is required because notification functions return an error code.


 - data residue check removed in case status indicates success or fail. Some memory sticks didn't operate correctly as bad residue indicated in case of failure.


 - usbh notification function parameters were in the reverse order.