Skip to content

Example for stm32f3 discovery board + ChibiOS implementing a composite usb device with CDC and MSD interfaces.

License

Notifications You must be signed in to change notification settings

geoffreymbrown/STM32F3-Discovery-CDC-MSD

Repository files navigation

STM32F3-Discovery-CDC-MSD

Example for stm32f3 discovery board + ChibiOS implementing a composite usb device with CDC and MSD interfaces.

This builds a composite USB device with both a serial CLI (USB CDC) and a fat file system (USB MSC) using the ChibiOS operating system.
The core support for CDC virtual serial ports is provided by ChibiOS. The core support for mass storage is provided by the ChibiOS user repository ChibiOS-Contrib. It was necessary to make a small change to one MSC support file which is included in this repository.

The example can be built two ways. make -f Makefile will build a file system as a statically defined image which is loaded into RAM at runtime and can be both read and written. This image is built using mtools to create a 16KB image containing the files in the directory ./testfiles. As a convenience for those without mtools, a precompiled image is provided.

The second method, make -f Makefile.vfs builds a table driven "virtual disk" also containing the contents of ./testfiles. This virtual disk is generated dynamically at runtime. In contrast to the first method, this virtual disk is read only; however, it also admits "virtual files" for which the content is generated at runtime. see https://github.com/geoffreymbrown/fat16gen for an explanation of how this works.

As mentioned above, the image generated by this project has both a CLI and an MSC fat drive. On Linux and OS X, the cli can be accessed using the program screen as in:

screen /dev/tty.usbmodem402

where the path to the correct virtual com port must be determined at run time.

On OS X and Linux, the MSC device should "just work".

On Windows

Additional work is needed to make this work on Windows. I believe that a .INF file should be all that is needed, but I haven't tried and don't have an inclination to try. I would welcome pull requests to fix this (add the .INF file to ./testfiles, if that is needed).

About

Example for stm32f3 discovery board + ChibiOS implementing a composite usb device with CDC and MSD interfaces.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published