usb 2.0 to sd-card file transfer using nios ii and de-3
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 PresentationTRANSCRIPT
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
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
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
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
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
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
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
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
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
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
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
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
Debug: Download SW to NIOS II System on DE3
Board Run / Debug SW on DE3 Refine SW & HW
Step 6: Debug
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