NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
CLP USB Host
This wiki is open and can be edited by all! More information available @ www.ti.com/launchpad
|
Contents
Introduction[edit]
The EK-TM4C1294XL Connected LaunchPad is the first TI LaunchPad to be designed and built to be ready to act as a USB host out of the box. Example programs are provided in the TivaWare package. This tutorial will explore the usb_host_msc example from TivaWare for this kit. Most of this information will apply to other usb_host_ examples.
Prerequisites[edit]
- We assume you have downloaded TivaWare and can load example projects on to your EK-TM4C1294XL.
- We assume you have a computer with a serial terminal application to connect to the debug virtual serial port on the EK-TM4C1294XL
- We assume you have the USB Micro B cable that came with the EK-TM4C1294XL (or an equivalent cable). This will power the board and provide a user interface for the example application.
You need the following items which are not included in the kit:
ITEM ONE A USB Flash Drive such as this. We test with a wide variety of flash drives. Just about all of them work. When we find one that does not work we do our best to modify TivaWare USB Library to make it work. Yoda is completely optional. | |
ITEM TWO A USB adapter cable. Micro A male on one end and full size A female on the other end. These are included in many of the USB host capable kits from the Stellaris/Tiva team or from the following sources. |
Connect the kit and cables[edit]
Connect the USB micro A to A receptacle adapter cable to the left side of the EK-TM4C1294XL. Connect the micro B cable into the left side of the EK-TM4C1294XL and then to your computer. Make sure the power select jumper is set to ICDI. |
Download the usb_host_msc application example[edit]
In the TivaWare Install directory (Usually C:\TI\TivaWare_C_Series-<version>\) find examples/boards/ek-tm4c1294xl/usb_host_msc/ In this directory is the example USB Host Mass Storage Controller application. The binary is found in the sub-directory for each tool chain. Use [LM Flash Programmer] to load one of the pre-built binaries onto your board.
|
Connect to the UART Terminal[edit]
Connect to the debug virtual serial port from the Connected LaunchPad with the terminal program of your choice. This tutorial will use Tera Term.
UART settings are 115200 8N1.
- You will see a command prompt on the UART terminal. It will notify you when a device is plugged and unplugged.
- Type help for a list of available commands.
- Install the USB stick in to the USB A receptacle. The UART terminal will receive a notification that device is connected.
- Use the ls, cd, and cat commands to explore the contents of the flash drive.
Explore the source code[edit]
The next step is to explore the usb_host_msc source code. To do this import the project into your tool chain of choice.
We use the FATfs file system to read and write files to the mass storage device. You can use this code as a basis for your application. Perhaps logging large amounts of data to the USB stick as it is collected from a BoosterPack. Have fun and be creative. The example code is just a foundation upon which you can build.
Discover other USB Host applications[edit]
The TivaWare installer comes with other USB Host example applications. Currently (as of TivaWare 2.1) for the EK-TM4C1294XL we have usb_host_msc (for Mass Storage Controllers), usb_host_keyboard and usb_host_mouse.
Additional USB Host applications are available for other boards in the TivaWare installer such as the DK-TM4C129X kit. Applications designed for other kits will require some porting to run on the EK-TM4C1294XL.