Rapid Prototyping Solutions Seminars

advertisement

Rapid Prototyping Solutions

USB and MFS Stacks Freescale, the Freescale logo, AltiVec, C-5, CodeTest, CodeWarrior, ColdFire, C-Ware, mobileGT, PowerQUICC, StarCore, and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, CoreNet, the Energy Efficient Solutions Logo, Flexis, MXC, Platform in a Package, Processor Expert, QorIQ, QUICC Engine, SmartMOS, TurboLink and VortiQa are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respect ive owners. © Freescale Semiconductor, Inc. 2010.

TM

Module Objectives

► This session describes the USB capabilities that are available when using MQX ► Describes how the MQX File System stack can interact with a USB stack ► Presents a hands-on lab with writing data to a USB Flash Stick Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

2

TM

► USB Host ► USB Device ► MFS ► USB and File System Lab

Module Agenda

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

3

TM

► USB Host ► USB Device ► MFS ► USB and File System Lab

Module Agenda

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

4

TM

MQX Host USB

► Implements USB 2.0 version ► Layered architecture • • scalability (choose only components needed in application) portability (class drivers independent on underlying hardware) ► Class drivers supported: • • • HID devices (mouse, keyboard) MSD devices (flash disk) HUB support (transparent communication through HUB) • CDC devices (serial communication) Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

Demo Applications Available

► Mouse ► Keyboard ► Mass Storage Device ► CDC Serial ► Found in \usb\host\examples Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

HUB

MQX USB Host Structure

User Application MFS

Other to be developed

Intermediate I/O Drivers

MSD HID CDC

Host Class Drivers HOST API (class level) USB 2.0 Chapter 9 API OS and HW-level HOST API Hardware Independent Layer

KHCI

(Kirin2U/Kirin3 specific controller)

EHCI

(Enhanced Host Controller Interface) USB Module (low-level drivers) Other (OHCI, ...) Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

► USB Host ► USB Device ► MFS ► USB and File System Lab

Module Agenda

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

8

TM

Stack Features

► All USB-IF chapter 9 compliance ► USB Class Support • • • • Human Interface Device (HID) Communication Data Class – Abstract Control Model (CDC – ACM) PHDC (Personal Health Care Device Class) MSD (Mass Storage Support) Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

Demo Applications available

► Mouse ► USB to Serial ► USB Network Adapter ► Weigh Scale (IEEE 11073 – 20601, IEEE 11073 - 10415) ► RAM Disk ► Found in \usb\device\examples Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

Architecture Overview

Applications USB Device Stack Library Mouse HID Medical PHDC Commun ication CDC Storage MSD

Class API Device API Device Layer Controller API

mcf5229x mcf54455 V2 USB IP V4 USB IP - - - - Low level driver - - - - USB IP

HW Register IF Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

Application Class

Device Layer

Low level driver USB Hardware

Device Layers

USB Descriptors, endpoint information - USB Application implementing class specific callbacks - USB Class API user USB Framework Module implementation (USB Ch9, Control Endpoint …) USB generic class implementation (Suspend/Resume/Reset ….) - USB function specific implementation (Non Control Endpoint Request, Class specific Request) - USB Device API user - Abstracts Hardware specific details and provides generic USB interfaces to the upper layer - Allows easy port of Applications/Class functionality over different USB IPs - USB Controller IP interfacing module. - candidate to change for every new USB IP Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

► USB Host ► USB Device ► MFS ► USB and File System Lab

Module Agenda

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

13

TM

Files and directories MFS Partition manager (optional) Device Hardware Flash cards USB mass storage devices ATA PCMCIA Removable hard drives Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

14

MFS structure

TM

MFS Features

► Standard FAT12, FAT16 and FAT32 support ► Standard handling of directory paths • • Both \ and / can be used as directory separators Support for * and ? wildcard characters ► File Attributes Supported • • Standard: Directory, Read-only, Hidden File, System file, Archived file Special: Volume Label file (only one such file allowed in root directory) ► File Time and Date • Each file entry contains 16-bit time and date fields.

► FAT Copies • MFS updates as many FATs as configured for. Only reads the first FAT.

► High-Level Formatting • An application can perform high-level formatting on a disk by calling

ioctl()

.

► Partition Manager • Support for multiple partitions on one physical drive Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

15

TM

Devices usable by MFS

• MFS can be installed on any memory-oriented device which    is standard MQX IO device in terms of open/close/read/write/ioctl calls is able to “seek” on any given position supports few block-oriented IOCTL • Devices supported today   ATA PC Card flash cards USB mass storage devices    RAM or MRAM FlashX driver working with internal or external Flash memory SPI-based SD Cards • Code under development (or legacy not-tested code)   ATA hard drives floppy-disk drives Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

16

Device

TM

MFS – API

► Basic MFS API 

_io_mfs_install -

initializes MFS and allocates memory for all of the internal MFS data structures.

_io_mfs_uninstall -

context.

uninstalls the MFS device driver and frees the memory 

fopen

- Opens the device by specifying device name or opens a file if both device name and file path is specified.

fd_ptr = fopen(“ mfsram: \data\march\ March2000results.data

”, “w”);

fclose

– Closes the file and frees the memory allocated by given

FILE_PTR

ioctl

– File- or device-specific control interface.

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

17

TM

► USB Host ► USB Device ► MFS ► USB and File System Lab

Module Agenda

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

18

TM

► Follow the USB Lab document to read and write to a USB flash drive

Hands-On

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

TM

► Learned about the USB capabilities that are available when using MQX ► Described how the MQX File System stack can interact with a USB stack ► Performed a hands-on lab with writing data to an USB Flash Stick

Summary

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009.

20

TM

TM

Download