usb 2.0 to sd-card file transfer using nios ii and de-3

14
USB 2.0 to SD-Card File transfer Using NIOS II and DE-3 USB to SD Project By: Nadav Haklai & Noam Rabinovici Supervisors: Mike Sumszyk & Roni Lavi Semester: Spring 2010

Upload: giza

Post on 08-Feb-2016

113 views

Category:

Documents


0 download

DESCRIPTION

USB 2.0 to SD-Card File transfer Using NIOS II and DE-3. USB to SD Project. By: Nadav Haklai & Noam Rabinovici Supervisors: Mike Sumszyk & Roni Lavi Semester:Spring 2010. Background. USB 2.0- Standard for peripheral devices The USB mass storage device class - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

USB to SD Project

By: Nadav Haklai & Noam RabinoviciSupervisors: Mike Sumszyk & Roni LaviSemester: Spring 2010

Page 2: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

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

Page 3: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Project Goal

Create a stand alone bridge between the USB and SD-Card interfaces Transfer files easily between the devices. No computer is needed. Hardware - ALTERA Stratix III FPGA and SOPC

Core

Page 4: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Development Tools Software:

Quartus II 9.1 SP1 SOPC Builder NIOS II IDE 9.1

Hardware: Altera DE3 Board▪ Stratix III FPGA▪ Soft NIOS II Core▪ USB Controller - ISP1761

Page 5: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Design Flow

1. Study system devices and technologies in depth

2. Analyze System Requirements 3. Create Soft NIOS Core in SOPC Builder4. Develop HW environment5. Develop SW using NIOS II IDE

1. SD Card Driver2. FAT File System3. USB Driver

6. Debug & Improvements

Page 6: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Step 3: Create Soft NIOS Core

Specify target FPGA and clock settings

Adding peripherals: NIOS II core On-chip memory USB ISP 1761 core SD-Card Core

Generating systemSD-Card Socket

Page 7: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Step 4: Develop HW environment Use DE3 System Builder to generate project

Pin assignments and board configuration Integrate SOPC Builder into Quartus II

project Integrate custom HW modules Set design constrains:

Timing requirements Compiling HW design for DE3 board

Analysis & Synthesis Place & Route

Page 8: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Step 5: Develop SW environment USB SW design

Layers:

NIOS II PIO

ISP 1761 HAL

USB HOST Controller

USB Protocol

USB mass storage device

Driver

FAT File System

Program

NIOS II PIO

SD-Card Driver

FAT File System

Program

SD-Card SW design Layers:

- Ready- Not Ready- Examples Code - Ready

Page 9: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

DE3 Design examples: The DE3 offers USB Host and SD-Card code examples The interfaces examples support read-only mode from the

USB or SD devices The examples are not documented and messy.

SW Development The examples were used as a starting point. USB and SD drivers are modified to add write support. FAT File system was implemented to allow the work with files

on the SD-Card and the USB mass storage device. Design the high program layer

Step 5: Develop SW environment

Page 10: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

FAT Fundamentals: Sectors and Clusters LBA and MBR Mount and Initialization Logical vs. Physical Drives File Locations – Cluster Chains

Implementation – Open Source File System SD-Card USB – Mass Storage Device

Step 5: FAT File System

Page 11: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

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

Step 5: SD-Card Driver

Page 12: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

UFI Commands Based on SCSI Commands Learn examples commands implementations Write Command:

Interface between USB Protocol and File System

Step 5: USB Mass Storage Class

Page 13: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Debug: Download SW to NIOS II System on DE3

Board Run / Debug SW on DE3 Refine SW & HW

Step 6: Debug

Page 14: USB 2.0 to SD-Card File transfer Using NIOS II and DE-3

Project Milestones

Status: Estimated Time:

Goal:

Done 3 weeks Study the protocols and examplesDone 1 week Design SOPC CoreDone 1 week Design HW

14.6.10 Midterm PresentationDone 2 weeks Design SW – SD DriverIn Progress

2 weeks Design SW – Fat File System

In Progress

1 month Design SW – USB Driver

1 week Design SW – Top Layer Program2 weeks Debug and improvements? Final Presentation