USB Mass Storage Firmware... User Guide

Similar documents
AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. C51 Bootloaders. C51 General Information about Bootloader and In System Programming. Overview. Abreviations

8-bit Microcontroller. Application Note. AVR222: 8-point Moving Average Filter

General Porting Considerations. Memory EEPROM XRAM

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

AT89C5131A Starter Kit... Software User Guide

8-bit RISC Microcontroller. Application Note. AVR182: Zero Cross Detector

AVR106: C functions for reading and writing to Flash memory. 8-bit Microcontrollers. Application Note. Features. Introduction

AT91 ARM Thumb Microcontrollers. AT91SAM CAN Bootloader. AT91SAM CAN Bootloader User Notes. 1. Description. 2. Key Features

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR. 8-bit Microcontrollers. Application Note. Features.

AT91 ARM Thumb Microcontrollers. Application Note. Interfacing a PC Card to an AT91RM9200-DK. Introduction. Hardware Interface

Quick Start Guide. CAN Microcontrollers. ATADAPCAN01 - STK501 CAN Extension. Requirements

8-bit RISC Microcontroller. Application Note. AVR236: CRC Check of Program Memory

AVR245: Code Lock with 4x4 Keypad and I2C LCD. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

How to Calculate the Capacitor of the Reset Input of a C51 Microcontroller 80C51. Application Note. Microcontrollers. Introduction

Application Note. USB Mass Storage Device Implementation. USB Microcontrollers. References. Abbreviations. Supported Controllers

3-output Laser Driver for HD-DVD/ Blu-ray/DVD/ CD-ROM ATR0885. Preliminary. Summary

Tag Tuning/RFID. Application Note. Tag Tuning. Introduction. Antenna Equivalent Circuit

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter

8-bit Microcontroller. Application Note. AVR105: Power Efficient High Endurance Parameter Storage in Flash Memory

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

8-bit Microcontroller. Application Note. AVR314: DTMF Generator

8-bit. Application Note. Microcontrollers. AVR282: USB Firmware Upgrade for AT90USB

8-bit RISC Microcontroller. Application Note. AVR155: Accessing an I 2 C LCD Display using the AVR 2-wire Serial Interface

AVR32110: Using the AVR32 Timer/Counter. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR034: Mixing C and Assembly Code with IAR Embedded Workbench for AVR. 8-bit Microcontroller. Application Note. Features.

Application Note. Migrating from RS-232 to USB Bridge Specification USB Microcontrollers. Doc Control. References. Abbreviations

8-bit Microcontroller. Application Note. AVR201: Using the AVR Hardware Multiplier

8-bit Microcontroller. Application. Note. AVR204: BCD Arithmetics. Features. Introduction. 16-bit Binary to 5-digit BCD Conversion bin2bcd16

AVR32100: Using the AVR32 USART. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR32701: AVR32AP7 USB Performance. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR270: USB Mouse Demonstration

8-bit. Application Note. Microcontrollers. AVR273: USB Mass Storage Implementation. Features. 1. Introduction

Application Note. 8-bit Microcontrollers. AVR280: USB Host CDC Demonstration. 1. Introduction

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

AVR442: PC Fan Control using ATtiny13. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

USB 2.0 Full-Speed Host/Function Processor AT43USB370. Summary. Features. Overview

AVR1318: Using the XMEGA built-in AES accelerator. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Using CryptoMemory in Full I 2 C Compliant Mode. Using CryptoMemory in Full I 2 C Compliant Mode AT88SC0104CA AT88SC0204CA AT88SC0404CA AT88SC0808CA

AVR115: Data Logging with Atmel File System on ATmega32U4. Microcontrollers. Application Note. 1 Introduction. Atmel

AVR1922: Xplain Board Controller Firmware. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR241: Direct driving of LCD display using general IO. 8-bit Microcontrollers. Application Note. Features. Introduction AVR

AVR287: USB Host HID and Mass Storage Demonstration. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Two-wire Automotive Serial EEPROM AT24C01A AT24C02 AT24C04 AT24C08 (1) AT24C16 (2)

8-bit Microcontroller. Application Note. AVR461: Quick Start Guide for the Embedded Internet Toolkit. Introduction. System Requirements

AVR120: Characterization and Calibration of the ADC on an AVR. 8-bit Microcontrollers. Application Note. Features. Introduction

Application Note. 8-bit Microcontrollers. AVR272: USB CDC Demonstration UART to USB Bridge

Atmel AVR4920: ASF - USB Device Stack - Compliance and Performance Figures. Atmel Microcontrollers. Application Note. Features.

Atmel AVR4921: ASF - USB Device Stack Differences between ASF V1 and V2. 8-bit Atmel Microcontrollers. Application Note. Features.

AVR1600: Using the XMEGA Quadrature Decoder. 8-bit Microcontrollers. Application Note. Features. 1 Introduction. Sensors

AVR353: Voltage Reference Calibration and Voltage ADC Usage. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR033: Getting Started with the CodeVisionAVR C Compiler. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

3-output Laser Driver for HD-DVD/ Blu-ray/DVD/ CD-ROM ATR0885. Preliminary. Summary. Features. Applications. 1. Description

Application Note. 8-bit Microcontrollers. AVR293: USB Composite Device

AVR32138: How to optimize the ADC usage on AT32UC3A0/1, AT32UC3A3 and AT32UC3B0/1 series. 32-bit Microcontrollers. Application Note.

2-wire Serial EEPROM AT24C1024. Advance Information

Two-wire Serial EEPROM AT24C1024 (1)

AVR2006: Design and characterization of the Radio Controller Board's 2.4GHz PCB Antenna. Application Note. Features.

USB Test Environment ATUSBTEST- SS7400. Summary

2-Wire Serial EEPROM AT24C32 AT24C64. 2-Wire, 32K Serial E 2 PROM. Features. Description. Pin Configurations. 32K (4096 x 8) 64K (8192 x 8)

Atmel AVR4903: ASF - USB Device HID Mouse Application. Atmel Microcontrollers. Application Note. Features. 1 Introduction

AT91SAM ARM-based Flash MCU. Application Note

AVR1301: Using the XMEGA DAC. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR1510: Xplain training - XMEGA USART. 8-bit Microcontrollers. Application Note. Prerequisites. 1 Introduction

AT86RF230 (2450 MHz band) Radio Transceiver... User Guide

Application Note. Atmel ATSHA204 Authentication Modes. Prerequisites. Overview. Introduction

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

Application Note. 8-bit Microcontrollers. AVR091: Replacing AT90S2313 by ATtiny2313. Features. Introduction

How To Use An Atmel Atmel Avr32848 Demo For Android (32Bit) With A Microcontroller (32B) And An Android Accessory (32D) On A Microcontroller (32Gb) On An Android Phone Or

DIP Top View VCC A16 A15 A12 A7 A6 A5 A4 A3 A2 A1 A0 I/O0 I/O1 I/O2 GND A17 A14 A13 A8 A9 A11 A10 I/O7 I/O6 I/O5 I/O4 I/O3. PLCC Top View VCC A17

AVR32788: AVR 32 How to use the SSC in I2S mode. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

How To Prevent Power Supply Corruption On An 8Bit Microcontroller From Overheating

8-bit Microcontroller. Application Note. AVR410: RC5 IR Remote Control Receiver

APPLICATION NOTE. Atmel LF-RFID Kits Overview. Atmel LF-RFID Kit. LF-RFID Kit Introduction

AT91 ARM Thumb Microcontrollers. Application Note. GNU-Based Software Development on AT91SAM Microcontrollers. 1. Introduction. 2.

ATF15xx Product Family Conversion. Application Note. ATF15xx Product Family Conversion. Introduction

Table of Contents. Section 1 Introduction Section 2 Getting Started Section 3 Hardware Description

AVR444: Sensorless control of 3-phase brushless DC motors. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

8051 Flash Microcontroller. Application Note. A Digital Thermometer Using the Atmel AT89LP2052 Microcontroller

Application Note. 8-bit Microcontrollers. AVR307: Half Duplex UART Using the USI Module

Atmel AVR1017: XMEGA - USB Hardware Design Recommendations. 8-bit Atmel Microcontrollers. Application Note. Features.

Step Motor Controller. Application Note. AVR360: Step Motor Controller. Theory of Operation. Features. Introduction

APPLICATION NOTE. Secure Personalization with Transport Key Authentication. ATSHA204A, ATECC108A, and ATECC508A. Introduction.

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

Application Note. 8-bit Microcontrollers. AVR435: BLDC/BLAC Motor Control Using a Sinus Modulated PWM Algorithm. 1. Features. 2.

Application Note. USB Microcontrollers. USB PC Drivers Based on Generic HID Class. 1. Introduction

AT88CK490 Evaluation Kit

AVR055: Using a 32kHz XTAL for run-time calibration of the internal RC. 8-bit Microcontrollers. Application Note. Features.

APPLICATION NOTE. Atmel AT02985: User s Guide for USB-CAN Demo on SAM4E-EK. Atmel AVR 32-bit Microcontroller. Features. Description.

APPLICATION NOTE. Atmel AT04389: Connecting SAMD20E to the AT86RF233 Transceiver. Atmel SAMD20. Description. Features

Application Note. Atmel CryptoAuthentication Product Uses. Atmel ATSHA204. Abstract. Overview

8-bit RISC Microcontroller. Application Note. AVR335: Digital Sound Recorder with AVR and DataFlash

2-wire Serial EEPROM AT24C512

AVR2004: LC-Balun for AT86RF230. Application Note. Features. 1 Introduction

8-bit RISC Microcontroller. Application Note. AVR910: In-System Programming

AVR068: STK500 Communication Protocol. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Transcription:

USB Mass Storage Firmware... User Guide

Section 1 Introduction... 1-1 1. References...1-1 2. Abbreviations...1-1 3. Supported Controllers...1-1 4. Introduction...1-1 Section 2 Memory General Management... 2-3 5. Example: add the DataFlash memory support...2-4 Section 3 Configure the Nand Flash driver... 3-5 Section 4 Configure the Data Flash driver... 4-7 USB Mass Firmware Storage User Guide 1

Section 1 Introduction 1. References Universal Serial Bus Specification, revision 2.0 Universal Serial Bus Class Definition for Communication Devices, version 1.1 USB Mass Storage Overview, revision 1.2 USB Mass Storage Bulk Only, revision 1.0 2. Abbreviations USB: Universal Serial Bus VID: Vendor Identifier PID: Product Identifier LUN: Logical Unit Number 3. Supported Controllers AT89C5130/31A & AT8xC5122D 4. Introduction The aim of this document is to describe the way to use different memories with the USB Mass Storage firmware. Refer to the USB Mass Storage device application note for more information. USB Mass Firmware Storage User Guide 1-1

Section 2 Memory General Management By default, the memory supported is the Nand Flash memory (2K). You can use either the DataFlash memory or the virtual memory (internal memory) instead. Each memory has its own LUN (Logic Unit Number), so to select the memory that you want to use you have to enable the related LUN and disable the others. You will find the LUN definition In the conf_access.h file: enable or disable the memory: // Active the Logical Unit #define LUN_0 // virtual memory #define LUN_1 ENABLE // NF (2k) memory #define LUN_2 // NF (512) memory #define LUN_3 // DF memory #define LUN_4 #define LUN_5 #define LUN_6 #define LUN_7 define the memory interface: // LUN 0 DEFINE #if (LUN_0 == ENABLE) #define VIRTUAL_MEM ENABLE #else #define VIRTUAL_MEM #endif #define LUN_0_INCLUDE "lib_mem\virtual_mem\virtual_mem.h" #define Lun_0_test_unit_ready() virtual_test_unit_ready() #define Lun_0_read_capacity(nb_sect) virtual_read_capacity(nb_sect) #define Lun_0_wr_protect() virtual_wr_protect() #define Lun_0_removal() virtual_removal() #define Lun_0_read_10(ad, sec) virtual_read_10(ad, sec) #define Lun_0_usb_read() virtual_usb_read() #define Lun_0_write_10(ad, sec) virtual_write_10(ad, sec) #define Lun_0_usb_write() virtual_usb_write() USB Mass Firmware Storage User Guide 2-3

Memory General Management 5. Example: add the DataFlash memory support In this example, we add the DataFlash memory. 1. Include the drivers in the project. Check if the DataFlash drivers (df_mem.c, df.c, spi_drv.c) are included in the project. Then, check if they are declared as C files (or A51) in order for them to be compiled (file options > file type > C source file): 2. Put the Nand Flash files (nf_mem.c, nf.c, nf_drv.c, nf_drv_load.a51) in text document file state in order to avoid it to be compiled(file options > file type > text document file). 3. In the conf_access.h file, enable the LUN 3 and disable the others: // Active the Logical Unit #define LUN_0 // virtual memory #define LUN_1 // NF (2k) memory #define LUN_2 // NF (512) memory #define LUN_3 ENABLE // DF memory #define LUN_4 #define LUN_5 #define LUN_6 #define LUN_7 2-4 USB Mass Firmware Storage User Guide

Section 3 Configure the Nand Flash driver The following Nand Flash files have to be included into the project : nf_mem.c nf.c nf_drv.c nf_drv_load.a51 There is no configuration for the Nand Flash driver. Just select the correct one corresponding to the page size of the Nand Flash: 512 Bytes or 2 kbytes. Nand Flash Size Auto-detection All drivers support nand flash size autodetection. This feature can be activated by defining NF_CAPACITY_AUTO_DETECT to TRUE, in board.h. If you want to optimize code generation, define NF_CAPACITY_AUTO_DETECT to FALSE. In this case, total memory size must be defined in board.h from NF_16 (16Mbytes) to NF_512 (512Mbytes) Reserved Zone This one permits to divided the NF memory in two memory space : - normal zone - reserved zone It's possible to define a reserved zone for application inside nand-flash memory. This reserved zone can not be modified by an operating system when application is in mass storage mode, except by set application in update mode. To set application in update mode, set flag reserved_disk_space (see nf_mem.c for definition) to TRUE. The "MEM_RESERVED_SIZE" value define the size of reserved zone (unit sector = unit 512B). This one must be modulo a cluster (max cluster size = 32*64). Size of reserved space is defined in config.h file. For example following line USB Mass Firmware Storage User Guide 3-5

Configure the Nand Flash driver #define MEM_RESERVED_SIZE1024 will keep a reserved space on nand flash with a size of 1024 sectors (512bytes for all drivers). Logical starting address of this reserved space is stored in the variable nf_reserved_space_start. Reserved zone can be read/write with all low level functions (nf_read_open, nf_read_write,...). normal zone size = total memory space - reserved zone size. To access at these zones, you must change the value "nf_reserved_zone_selected" and reinit the memory. Sample in tool_task.c : case TOOL_SELECT_RSVD: { nf_reserved_zone_selected = TRUE; mem_chip_select(); break; } case TOOL_SELECT_NORMAL: { nf_reserved_zone_selected = FALSE; mem_chip_select(); break; } Full Chip Erase Define NF_FULL_CHIP_ERASE determines how the function nf_erase_all_block will erase block during a format. If NF_FULL_CHIP_ERASE is set to TRUE, then all physicals blocks, except bad block, specific block and reserved block will be erased. If NF_FULL_CHIP_ERASE is set to FALSE, then only blocks that contains LUT will be erased. 3-6 USB Mass Firmware Storage User Guide

Section 4 Configure the Data Flash driver The following Data Flash files have to be included into the project : df_mem.c df.c spi_drv.c In the conf_df.h file, select the memory type to support: #define DF_TYPE DF_X_MB_TYPE // DF_4_MB_TYPE, DF_8_MB_TYPE, DF_X_MB_TYPE The memory type can be: DF_4_MB for AT45DB321 memories, DF_8_MB for AT45DB642 memories, DF_X_MB for AT45DB002, AT45DB004 and AT45DB008 removable memories USB Mass Firmware Storage User Guide 4-7

Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131 Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Regional Headquarters Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland Tel: (41) 26-426-5555 Fax: (41) 26-426-5500 Asia Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimshatsui East Kowloon Hong Kong Tel: (852) 2721-9778 Fax: (852) 2722-1369 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan Tel: (81) 3-3523-3551 Fax: (81) 3-3523-7581 Atmel Operations Memory 2325 Orchard Parkway San Jose, CA 95131 Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 Microcontrollers 2325 Orchard Parkway San Jose, CA 95131 Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 La Chantrerie BP 70602 44306 Nantes Cedex 3, France Tel: (33) 2-40-18-18-18 Fax: (33) 2-40-18-19-60 ASIC/ASSP/Smart Cards Zone Industrielle 13106 Rousset Cedex, France Tel: (33) 4-42-53-60-00 Fax: (33) 4-42-53-60-01 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906 Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 RF/Automotive Theresienstrasse 2 Postfach 3535 74025 Heilbronn, Germany Tel: (49) 71-31-67-0 Fax: (49) 71-31-67-2340 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906 Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123 38521 Saint-Egreve Cedex, France Tel: (33) 4-76-58-30-00 Fax: (33) 4-76-58-34-80 e-mail literature@atmel.com Web Site http://www.atmel.com Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically providedotherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel satmel s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. Atmel Corporation 2005. All rights reserved. Atmel, logo and combinations thereof, are registered trademarks, and Everywhere You Are are the trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. Printed on recycled paper. /xm