Testing of USB Device MSC Driver Based on RT-Thread

RT-Thread IoT OS
3 min readSep 14, 2024

--

Overview of the MSC Driver:

The USB Mass Storage Class (MSC) is a standard USB device class used for data transfer between computers and external storage devices. It enables external storage devices, such as flash drives, hard drives, and optical drives, to connect via USB and function like a regular disk drive. Users can access and manage files on external storage devices just as they would with an internal hard drive.

One of the key benefits of USB MSC is its universal compatibility, as most operating systems support it without the need for additional drivers. This makes it easy to use external storage devices for file sharing, backups, and data transfers across different computers.

This testing is based on the Renesas RA8D1 hardware board (Vision Board).

1. Required Tools, Installation Packages, and Source Code

Source Code: https://github.com/RT-Thread-Studio/sdk-bsp-ra8d1-vision-board

RT-Thread Env Tool: https://www.rt-thread.io/download.html?download=Env

Renesas Flash Programmer Tool: https://www.renesas.com/us/en/software-tool/renesas-flash-programmer-programming-gui

One SD card

2. Implementation Steps

  1. Download and install the tools and packages mentioned in the first section, then clone the project.
  2. Compile the project.
  • Navigate to the directory where the RT-Thread Env tool is located.
  • Double-click to run env.exe.
  • Use the cd command to switch to the directory sdk-bsp-ra8d1-vision-board/projects/usb/vision_board_tinyusb_msc, for example: cd $(project_dir)/sdk-bsp-ra8d1-vision-board/projects/usb/vision_board_tinyusb_msc.
  • Run scons in this directory to build the project.

3. Flashing the Project

  • Open the installed Renesas Flash Programmer.
  • Create a new project.

Note: Before selecting the serial port under Tool, press the USER BOOT button and then press RST to switch to programming mode. Only then will the RA USB Boot (CDC) serial port appear.

  • Prepare for flashing.

Note: Before clicking Start to flash, you should hold down the USER BOOT button on the development board and then press RST to restart, while continuing to hold the USER BOOT button. Then click Start to begin the flashing process.

  • Flashing complete.

4. Testing the USB MSC Driver

  • Insert the SD card, ensuring it is oriented correctly.
  • Connect the development board’s USB port to the computer, which will automatically install the driver.
  • A new U Disk will appear in “My Computer.”
  • You can then open it to perform file read and write operations on the U-Disk.

RT-Thread Community ZVML_9668 contributed to this article!

--

--

RT-Thread IoT OS

An Open-Source Community-Powered Real-Time Operating System (RTOS) Project! Let’s develop, DIY, create, share, and explore this new IoT World together!