1 / 26

USB 2.0 to SD-Card File Transfer

USB 2.0 to SD-Card File Transfer. USB to SD . By: Nadav Haklai & Noam Rabinovici Supervisors: Mike Sumszyk & Roni Lavi Semester: Spring 2010. Project Goal. Create a prototype for file transfer system. Implement a stand alone bridge between USB and SD-Card interfaces.

jon
Download Presentation

USB 2.0 to SD-Card File Transfer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. USB 2.0 to SD-CardFile Transfer USB to SD By: Nadav Haklai & Noam Rabinovici Supervisors: Mike Sumszyk & RoniLavi Semester: Spring 2010

  2. Project Goal • Create a prototype for file transfer system. • Implement a stand alone bridge between USB and SD-Card interfaces. • Design a platform for future file transfer developments. • Learn the USB and SD-Card protocols.

  3. System Definition: • Copy files between USB and SD card devices. • Stand-alone device. • Support FAT file systems. • Easy to use user interface. • Low power – self powered (battery) . • Fast transfer rates - USB 2.0. • Low cost product.

  4. Prototype Constrains: • Altera DE-3 Development Board • High power – Power supply. • Large dimensions. • Lower transfer rates – generic FPGA. • Very expensive. • Short development time and resources • Using open-source code (FAT). • Using Altera examples as skeleton.

  5. Prototype System Architecture: DE3 Board ISP1761 (USB Controller) USB 2.0 Port Stratix III ISP1761 Controller Leds and switches PIO Controller Nios II Soft Processor Avalon Switch Fabric Console On Chip Memory JTAG PIO Controller SD Card Connector

  6. Development Tools • Software: • Quartus II 10.0 • SOPC Builder • NIOS II IDE 10.0 • Hardware: • Altera DE3 Board • Stratix III FPGA • Soft NIOS II Core • USB Controller - ISP1761 • Signal Analyzer • USB Analyzer

  7. Software Architecture: Control Layer Main Program – User Interface Files Layer FAT File System USB mass storage device Driver SD-Card Driver USB Protocol 512 Bytes Blocks Layer USB HOST Controller ISP 1761 HAL Physical Layer NIOS II PIO

  8. Technical Background: • USB 2.0- Standard for peripheral devices • The USB mass storage device class • ISP1761 - single-chip Hi-Speed Universal Serial Bus (USB) On-The-Go (OTG) Controller • SD-Card - Non-Volatile memory card format • Very popular and common (Cameras, Embedded Systems) • Fat - File System

  9. USB 2.0 • Definition: A specification to establish communication between devices and a host controller. • Main Uses • Device Classes • Mass Storage Device • Human Interface Device (HID) • Physical Layer • Host/Device Topology

  10. USB Mass Storage Class • USB Protocol - UFI Layer • USB Floppy Interface • USB method for file transfers • Based on SCSI Commands • Data packet encapsulation • Uses USB low level driver

  11. USB Mass Storage Class • USB UFI level Implementation main commands: • Write Command: • Read Command:

  12. USB Mass Storage Class • USB Bulk level : • Command/Data/Status Flow: • Command Status/Block Wrapper • Packet structure:

  13. Request from the file system to write 512B logical block USBDISK_WriteBlock512 Request from the file system to write a physical block (equal or less than 512B) USBDISK_ BOT_Write10 Sending the command to the device, same to read & write USBDISK_ BOT_execute Changing datagram with the device Port_BulkIN Port_BulkOut Port_AltIn Port_AltOut USB Mass Storage Class • USB Write Function Structure • This function writes 512Bytes block using the USB.

  14. Technical Background: • USB 2.0- Standard for peripheral devices • The USB mass storage device class • ISP1761 - single-chip Hi-Speed Universal Serial Bus (USB) On-The-Go (OTG) Controller • SD-Card - Non-Volatile memory card format • Very popular and common (Cameras, Embedded Systems) • Fat - File System

  15. SD-Card • SD-Card Protocol • SD Mode (1 or 4bits) vs. SPI Mode • Bus Protocol basic operation: • Command Packet Format • Data Packet Format

  16. SD-Card • SD-Card Implementation: • Initialization flow:

  17. SD-Card • SD-Card Implementation: • Write Flow: • Read Flow:

  18. Request from the file system to write 512B logical block SD_write_block SD_DAT0_LOW SD_DAT0_HIGH Sending the command executing the command send_cmd SD_CLK_HIGH SD_CLK_LOW SD_CMD_HIGH SD_CMD_LOW SD-Card • SD-Card Write Function Structure:

  19. Technical Background: • USB 2.0- Standard for peripheral devices • The USB mass storage device class • ISP1761 - single-chip Hi-Speed Universal Serial Bus (USB) On-The-Go (OTG) Controller • SD-Card - Non-Volatile memory card format • Very popular and common (Cameras, Embedded Systems) • Fat - File System

  20. FAT File System • Amethod of storing and organizing computer files and their data • FAT Fundamentals: • Sectors and Clusters • Volume Structure: • MBR:

  21. FAT File System • Implementation – Open Source File System • Support for: • SD-Card • USB – Mass Storage Device • Application Interface: • f_mount - Register/Unregister a work area • f_open - Open/Create a file • f_write - Write file • f_read - Read file • f_opendir - Open a directory • f_getfree - Get free clusters

  22. FAT File System • Files organization on storage device • Cluster Chains example

  23. Technical Background: • USB 2.0- Standard for peripheral devices • The USB mass storage device class • ISP1761 - single-chip Hi-Speed Universal Serial Bus (USB) On-The-Go (OTG) Controller • SD-Card - Non-Volatile memory card format • Very popular and common (Cameras, Embedded Systems) • Fat - File System

  24. Encountered Difficulties: • SD Card: • Signals Timing issues – Driver development. • USB: • Software bugs in the Terasic DE-3 examples code. • FAT: • Had to search for reliable open source code. • Complex integration of the FAT and the interfaces.

  25. From Prototype to Product: • ASIC vs. FPGA • Board Design • Increase SD Card throughput • Support for different memory cards • USB 3.0 • NTFS File system support • Low power design considerations • User interface • Product package

  26. Thank You • Questions?

More Related