Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The MSC demo consists of two parts:

  • Any file explorer application (Windows, Linux, Mac) from a USB host. For instance, in Windows, mass-storage devices appear as drives in My Computer. From Windows Explorer, users can copy, move, and delete files in the devices.
  • The USB Device application on the target board which responds to the request of the host.

µC/USB Device allows the explorer application to access a MSC device such as a NAND/NOR Flash memory, RAM disk, Compact Flash, Secure Digital etc. Once the device is configured for MSC and is connected to the PC host, the operating system will try to load the necessary drivers to manage the communication with the MSC device. For example, Windows loads the built-in drivers disk.sys and PartMgr.sys. You will be able to interact with the device through the explorer application to validate the device stack with MSC.

Note that the demo application provided by Micrium is only an example and is intended to be used as a starting point to develop your own application.

MSC Device Application

On the target side, the user configures the application through the app_usbd_cfg.h file.  lists a few preprocessor constants that must be defined.

If RAMDisk storage is used, ensure that the associated storage layer files are included in the project and configure the following constants located in app_usbd_cfg.h and listed in .

If µC/FS storage is used, ensure that the associated µC/FS storage layer files are included in the project and configure the following constants listed in :

MSC Host Application

To test the µC/USB-Device stack with MSC, the user can use for instance the Windows Explorer as a USB Host application on a Windows PC.

When the device configured for the MSC demo is connected to the PC, Windows loads the appropriate drivers as shown in .

Open a Windows Explorer and a removable disk appears as shown in . If the MSC demo is modified to configure a mass storage device composed of multiple logical units as shown in , Windows Explorer will show a removable disk icon per logical unit.

When you open the removable disk, if it is the first time the MSC device is connected to the PC and is not formatted, Windows will ask to format it to handle files on the mass storage. When formatting, choose the File System you want. In embedded systems, the most widespread file system is the FAT.

If the mass storage device is a volatile memory such as a SDRAM, every time the target board is switched off, the data of the memory is lost, and so is the file system data information. As a result, the next time the target is switched on, the SDRAM is blank and reconnecting the mass storage to the PC, you will have to format again the mass storage device.

Once the device is correctly formatted, you are ready to test the MSC demo. Below are a few examples of what you can do:

  • You can create one or more text files.
  • You can write data in these files.
  • You can open them to read the content of the files.
  • You can copy/paste data.
  • You can delete one or more files.

All of these actions will generate SCSI commands to write and read the mass storage device.

The MSC class supports the removable storage eject option offered by any major operating systems.  shows an example of Eject option available in Windows Explorer. When you right-click on the removable disk, you can choose the Eject option. Eject option will send to the mass storage device some special SCSI commands. The mass storage device will stop the access to the storage. Hence, Windows will modify the removable disk icon by removing the size information. If you double-click on the icon after the eject operation, Windows will display a message saying that no disk is inserted. After an eject operation, you cannot reactivate the removable media. The only way is to disconnect the device and reconnect it so that Windows will re-enumerate it and refresh the Windows explorer's content.

  • No labels