AN1475
APPLICATION NOTE
DEVELOPING AN ST7265x
MASS STORAGE APPLICATION
By Microcontroller Division Applications
INTRODUCTION
This application note describes how to develop a USB Mass Storage application using an
ST7265x microcontroller.
The proposed solution includes a generic USB Mass Storage Layer (MSL) compliant with the
USB Mass Storage Class that can be used for all types of storage media (FLASH memory
cards, hard disk drive, etc.) and a dedicated Media Access Layer (MAL) add-in for each type
of storage media.
The MSL and the MAL modules are available to ST customers on request. C ontact your ST
sales office to obtain the ST7265 Mass Storage software.
The MSL and the MAL must be considered as function libraries and therefore cannot be modified by the user. The softwa re interfaces of these function l ibraries provide the us er with the
required flexibility for designing his application:
– type and number of media,
– insertion/withdrawal management,
– protection management,
– user interface.
Note that the MAL requires the use of certain fixed MCU pins to interface with the various mediums. As a res ult, a specific app lication hardwa re configur ation is requ ired when us ing the
MAL.
AN1475/0202 1/8
1
DEVELOPING AN ST 7265x M ASS STORAGE A PPLICATION
1 SOFTWARE ARCHITECTUR E
The ST7265 software is designed in modules. Each module has a unique and clearly defined
interface. This architecture enables the user to easily replace any module and to reuse the individual module in other projects. This architecture provides maximum flexibility so users are
able to cust omize t heir ap plicati on as th ey wan t. The mo dule softwa re desi gn is show ed in
Figure 1.
Figure 1. ST7265 Mass Storage Application Architecture
LUN Assignment
USB Mass Storage Layer
User Application
Status
Information
Media Configuration
Media Access Layer
Storage
Media
= ST provided module
All the components des cribed above are grouped into a pr oject. The “Status Informa tion” in terface enables the user to monitor the execution of the software. The “Med ia Configuration”
interface enables the user to customize the application configuration.
Medium-independent Medium-dependent
2/8
2
DEVELOPING AN ST7265x MASS STORAGE APPLICATION
2 PROJECT CONTENT
Files required for the various modules are grouped into different directories. Most files are
user application independent; i.e. they are not des igned to be modified by the user application.
Other files are application dependent and can be modified by the user. Table 1 explain s the
usage of the files included in the project.
Table 1. Application Files
Directory Path/File Usage
Appli.c, Appli.h
Descript.c, Descript.h
MCL
(Application
specific)
MAS
Sto
USBlib All files.
MAL_Func.c
Mconfig.h
Int_7265.c, Int_7265.h
Micro
MAL
Class All files
Condcomp.h
Main.c
User_lib.c,
User_lib.h
Application-related routines (called from main.c) to be
developed by the user.
These files contain all the descriptors for the USB enumeration. These files are designed to be modified by
the user depending on the user application.
This file contains the global Media Access Library settings. These files are designed to be modified by the
user depending on the user application.
Definitions of the software interface described in the
document. These files are designed to be modified by
the user depending on the user application.
Groups all interrupt routines. These files areto be modified by the user depending on the user application.
Conditional compilation definitions. This file is used to
configure the USB behaviour. This file is not designed
to be modified by the user.
Main software entry point. This file is not designed to be
modified by the user (see Appli.c)
USB routines related to this application. These files are
not designed to be modified by the user.
Media Access Library. These files are not designed to
be modified by the user.
Files related to the standard Mass Storage operation.
These files are not designed to be modified by the user.
Files related to the standard USB operations. These
files are not designed to be modified by the user.
3/8