Jump to content
43oh

Serial + USB mass storage on the same USB?


Recommended Posts

I have the LM4F120 Stellaris Launchpad and was wondering if it was possible to have a single USB connection (either the debug or device port on my launchpad) function simultaneously as a  UART serial connect but also connect to my computer as a mass storage device? Is this at all possible? How would I go about it? 

 

Maybe I'm going about this wrong but basically what I am wishing to do is to be able to access files on an SD card that is attached to my launchpad on my computer. I simultaneously would like to be able to send messages to/from the board from the computer. Is there a good way of doing this? USB serial or USB bulk? I'm just using the Stellarisware example code for everything at the moment and can get UART communications working from the debug port and the mass storage from the device port. I can plug both usb ports in at the same time but then I need two cables connected.. not ideal. How can I combine the two easily?

Link to post
Share on other sites

USB clearly supports multiple function devices.  For instance, the Launchpad shows up as an ICDI device as well as the virtual serial port,

and there are port replicators that show up as a whole bunch of USB devices (network, HID, serial, parallel, etc.)

 

I think you should be able to make a combination USB device that provides both serial and MSC, assuming the launchpad has enough enbpoints.

You might look at the example code for the USB dev serial to get the serial portion.

 

Then it should be a matter of figuring out the proper descriptors for having them both on the same USB device.

Might start by looking at the composite device class driver information/files in Stellarisware USB library.

 

I have not actually done what you are asking about, so can't say for sure that it will work, there might be some limitation/gotchas, either in the USB spec, or limits on the launchpad.

Link to post
Share on other sites

What you want is a USB composite serial plus mass storage.

 

Get a full copy of StellarisWare for all boards.  http://www.ti.com/sw-lm3s

 

The old EK-LM3S9D92 kit has a composite example that is a HID with serial.  Find that example in C:\StellarisWare\boards\ek-lm3s9d92\usb_dev_chidcdc\ port it to the LM4F120.  The port should be only to configure the USB Port D Pins as USB mode not GPIO during your init code.  The rest should work. almost straight away.  Once you have that working on the LM4F120 remove the HID stuff from the example and replace it with mass storage.  Look for usb_dev_msc in the DK-LM3S9D96 board directory.  From that you can get an idea how to setup a mass storage controller stellaris device.  The DK has a lot of graphics and extra stuff in it that you will want to strip out.

 

Dexter

Link to post
Share on other sites
  • 1 month later...

What you want is a USB composite serial plus mass storage.

 

Get a full copy of StellarisWare for all boards.  http://www.ti.com/sw-lm3s

 

The old EK-LM3S9D92 kit has a composite example that is a HID with serial.  Find that example in C:\StellarisWare\boards\ek-lm3s9d92\usb_dev_chidcdc\ port it to the LM4F120.  The port should be only to configure the USB Port D Pins as USB mode not GPIO during your init code.  The rest should work. almost straight away.  Once you have that working on the LM4F120 remove the HID stuff from the example and replace it with mass storage.  Look for usb_dev_msc in the DK-LM3S9D96 board directory.  From that you can get an idea how to setup a mass storage controller stellaris device.  The DK has a lot of graphics and extra stuff in it that you will want to strip out.

 

Dexter

Hi Dexter, 

 

Sorry I'm just a newbie on the embedded programming and please excuse me if my problem is too naive. I'm also working on the USB Composite between CDC and MassStorage (MSC) application for the LM3S9D96 board, and I realized that in the supported driver for Windows OS, there is no driver for the usb_dev_comp_serial_and_msc. The rest of the C code can be modified from other examples in the StellarisWare but when the code is done, EV board plugged in, there is no notification to install the appropriate driver for this kind of application. So how can we get a new driver or modify the existing driver (for the usb_dev_ccdcmsc.inf for example) to work with the Compostie between CDC and MSC?

 

Hau Vo

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...