background image

 

 

Notice

1.  All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas 

Electronics products listed herein, please confirm the latest product information with a Renesas Electronics sales office. Also, please pay regular and careful attention to additional and different information to 

be disclosed by Renesas Electronics such as that disclosed through our website.

2.  Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or 

technical information described in this document.  No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or 

others.

3.  You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part.

4.  Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples.  You are fully responsible for 

the incorporation of these circuits, software, and information in the design of your equipment.  Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the 

use of these circuits, software, or information.

5.  When exporting the products or technology described in this document, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and 

regulations.  You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military, including but not limited to 

the development of weapons of mass destruction.  Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is 

prohibited under any applicable domestic or foreign laws or regulations.

6.  Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics does not warrant that such information is error free.  Renesas Electronics 

assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein.

7.  Renesas Electronics products are classified according to the following three quality grades:  "Standard", "High Quality", and "Specific".  The recommended applications for each Renesas Electronics product 

depends on the product's quality grade, as indicated below.  You must check the quality grade of each Renesas Electronics product before using it in a particular application.  You may not use any Renesas 

Electronics product for any application categorized as "Specific" without the prior written consent of Renesas Electronics.  Further, you may not use any Renesas Electronics product for any application for 

which it is not intended without the prior written consent of Renesas Electronics.  Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the 

use of any Renesas Electronics product for an application categorized as "Specific" or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics.  

The quality grade of each Renesas Electronics product is "Standard" unless otherwise expressly specified in a Renesas Electronics data sheets or data books, etc.

 

"Standard":  

Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home electronic appliances; machine tools;  

 

 

personal electronic equipment; and industrial robots.

 

"High Quality":  Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anti-crime systems; safety equipment; and medical equipment not specifically  

 

designed for life support.

 

"Specific":   

Aircraft; aerospace equipment; submersible repeaters; nuclear reactor control systems; medical equipment or systems for life support (e.g. artificial life support devices or systems), surgical  

 

implantations, or healthcare intervention (e.g. excision, etc.), and any other applications or purposes that pose a direct threat to human life.

8.  You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics, especially with respect to the maximum rating, operating supply voltage 

range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or damages arising out of the 

use of Renesas Electronics products beyond such specified ranges.

9.  Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and 

malfunctions under certain use conditions. Further, Renesas Electronics products are not subject to radiation resistance design.  Please be sure to implement safety measures to guard them against the 

possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas Electronics product, such as safety design for hardware and software including but not limited to 

redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures.  Because the evaluation of microcomputer software alone is very difficult, 

please evaluate the safety of the final products or system manufactured by you.

10.  Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product.  Please use Renesas Electronics 

products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive.  Renesas Electronics assumes 

no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations.

11.  This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written consent of Renesas Electronics.

12.  Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products, or if you have any other inquiries.

(Note 1)   "Renesas Electronics" as used in this document means Renesas Electronics Corporation and also includes its majority-owned subsidiaries.

(Note 2)  

"Renesas Electronics product(s)" means any product developed or manufactured by or for Renesas Electronics.

http://www.renesas.com

Refer to "http://www.renesas.com/" for the latest and detailed information.

Renesas Electronics America Inc. 

2880 Scott Boulevard Santa Clara, CA 95050-2554, U.S.A.
Tel:  +1-408-588-6000, Fax: +1-408-588-6130

Renesas Electronics Canada Limited

1101 Nicholson Road, Newmarket, Ontario L3Y 9C3, Canada
Tel: +1-905-898-5441, Fax: +1-905-898-3220

Renesas Electronics Europe Limited

Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K
Tel: +44-1628-585-100, Fax: +44-1628-585-900

Renesas Electronics Europe GmbH

Arcadiastrasse 10, 40472 Düsseldorf, Germany   
Tel: +49-211-6503-0, Fax: +49-211-6503-1327 

Renesas Electronics (China) Co., Ltd.

7th Floor, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100083, P.R.China 
Tel: +86-10-8235-1155, Fax: +86-10-8235-7679

Renesas Electronics (Shanghai) Co., Ltd.

Unit 204, 205, AZIA Center, No.1233 Lujiazui Ring Rd., Pudong District, Shanghai 200120, China 
Tel: +86-21-5877-1818, Fax: +86-21-6887-7858 / -7898 

Renesas Electronics Hong Kong Limited

Unit 1601-1613, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong
Tel: +852-2886-9318, Fax: +852 2886-9022/9044

Renesas Electronics Taiwan Co., Ltd.

7F, No. 363 Fu Shing North Road Taipei, Taiwan, R.O.C.
Tel: +886-2-8175-9600, Fax: +886 2-8175-9670

Renesas Electronics Singapore Pte. Ltd. 

1 harbourFront Avenue, #06-10, keppel Bay Tower, Singapore 098632
Tel: +65-6213-0200, Fax: +65-6278-8001

Renesas Electronics Malaysia Sdn.Bhd. 

Unit 906, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia
Tel: +60-3-7955-9390, Fax: +60-3-7955-9510

Renesas Electronics Korea Co., Ltd.

11F., Samik Lavied' or Bldg., 720-2 Yeoksam-Dong, Kangnam-Ku, Seoul 135-080, Korea
Tel: +82-2-558-3737, Fax: +82-2-558-5141

SALES OFFICES

© 2010 Renesas Electronics Corporation. All rights reserved. 

Colophon 1.0

 

Summary of Contents for SH7286

Page 1: ...ich is compliant to the USB mass storage class specification This document and the sample program described are examples of the USB function module and are therefore not guaranteed by Renesas Target Device SH7286 MCU Contents R01AN0063EJ0100 Rev 1 00 Page 1 of 32 Oct 22 2010 1 2 Introduction 2 3 Applications 3 5 USB Mass Storage Class Bulk Only Transport Overview 4 10 Development Environment 5 15 ...

Page 2: ...nt Renesas Electronics High performance Embedded Workshop Ver 4 04 01 C Compiler Renesas Electronics SuperH RISC engine Family C C compiler package Ver 9 01 Release 01 Compiler Options Default setting in the High performance Embedded Workshop cpu sh2a object CONFIGDIR FILELEAF obj debug gbr auto chgincpath errorpath global_volatile 0 opt_range all infinite_loop 0 del_vacant_loop 0 struct_alloc 1 n...

Page 3: ... Internal clock enabled only when EXTAL 12 MHz is selected Power down Mode When a USB cable is not connected less power is consumed by stopping the UDC internal clock Endpoint configuration listed in Table 1 Table 1 Endpoint Configuration Endpoint Number Name Transfer Mode Maximum Packet Size FIFO Buffer Capacity DMA DTC transfer EP0s Setup 8 bytes 8 bytes Endpoint 0 EP0i Control IN 8 bytes 8 byte...

Page 4: ...a to the SDRAM on the SH7286 CPU board and to read data from the SDRAM The USB mass storage class Bulk only Transport device driver can be used which comes standard with the above mentioned operating system This system includes the following features 1 The sample program can be used to evaluate the SH7286 USB module 2 The sample program supports USB control transfer and bulk transfer 3 E10A USB em...

Page 5: ...nsfer USB Mass Storage Class Control Bulk Interrupt CBI Transport uses control transfer bulk transfer and interrupt transfer CBI Transport divided into two data protocols one that uses interrupt transfer and one that does not use interrupt transfer The sample program uses USB Mass Storage Class Bulk Only Transport as its data transport protocol When the host computer uses a device to load or save ...

Page 6: ...transports Start Bulk OUT transfer Bulk OUT transfer Bulk IN transfer Bulk IN transfer End Command Transport CBW Data Transport Status Transport CSW Figure 2 Relationship between the Transfer Type and Transport To notify the host computer to use the Bulk Only Transport protocol describe H 50 in the bInterfaceProtocol field of the Interface descriptor 3 3 1 Command Transport In command transport th...

Page 7: ...in this sample program 3 3 2 Status Transport In status transport the function sends the status of the execution of the command block to the host computer via bulk IN transfer The status packet is defined as the Command Status Wrapper CSW Bulk Only Transport always ends with the CSW The function sends the CSW with a 13 byte packet via the Bulk IN transfer The format of the CSW is listed in Table 4...

Page 8: ...n bmCBWFlags field of the CBW data is 1 and dCBWDataTransferLength field of the CBW data is not 0 Data transport is specified as Bulk IN transfer The function sends the amount of data expected as stated in dCBWDataTransferLength field to the host computer and sends the execution result of the SCSI commands specified in CBWCB field of the CBW data 3 4 Class specific Requests Class specific requests...

Page 9: ...SENSE After an error occurred in the previous command block it provides the information about the error to the host H 12 INQUIRY Reports the information about the drive to the host H 1A MODE SENSE 6 Reports the state of the drive to the host H 1B START STOP UNIT Controls to attach or remove the media device H 1E PREVENT ALLOW MEDIUM REMOVAL Prevents or allows the removal of media H 23 READ FORMAT ...

Page 10: ... the connection diagram R01AN0063EJ0100 Rev 1 00 Page 10 of 32 Oct 22 2010 USB cable Figure 3 Device Connection Diagram 1 SH7286 CPU board This system uses the E10A USB emulator To use the E10A USB emulator on the SH7286 CPU board set the DIP switches SW4 as listed in Table 7 Make sure to turn the power OFF before changing the SW4 setting Table 7 DIP Switches Setting SW4 Setting Mode 6 Description...

Page 11: ...driver which comes standard with the operating system user does not have to install a driver newly 3 E10A USB computer Use Windows 2000 Windows XP Windows Vista or Mac OS9 based computer with the USB port as the E10A USB computer Use a USB cable to connect the E10A USB emulator and the USB connector of the E10A USB computer and use an E10A cable to connect the E10A USB emulator and the CPU board A...

Page 12: ...e Embedded Workshop 4 is installed to use the sample program Figure 4 shows files stored in sh7286_usb_msc folder sh7286_usb_msc folder sh7286_usb_msc hws sh7286_usb_msc folder Intermediate files object files inc folder Collection of include files to share src folder main c common folder Sample programs related to set up the CPU usb folder Sample programs related to USB mass storage class Figure 4...

Page 13: ...am on the SH7286 CPU board 4 3 2 Executing the Program Select Reset Go on the Debug menu to execute the program 4 4 How to Use the RAM Disk This section gives an example to use the RAM disk on Windows XP based computer When executing the program insert a USB series B connector to the SH7286 CPU board series A connector on the other side to the USB host computer After an enumeration using control t...

Page 14: ...This sample program uses 16 MB SDRAM as a RAM disk Alter the SysMemMap h file to modify the amount of RAM disk First specify the total number of bytes of RAM disk 1 by DISK_ALL_BYTE Then specify the beginning and the end of the RAM disk area by RAM_DISK_S and RAM_DISK_E 2 respectively Notes 1 Specify the value bigger than 1 5 MB As the FAT information consumes the RAM disk area the actual amount o...

Page 15: ... USB communication completed Interrupt generated USBFI0 Control transfer Bulk transport USB communication state Reset state Stationary state Figure 5 State Transition Diagram Reset state The SH7286 enters reset state when it is reset at power on or manually reset The sample program mainly configures the SH7286 in reset state Stationary state When configuring the SH7286 is completed the sample prog...

Page 16: ...trol Transfer Control transfer is used to retrieve the device information and set the device state which is executed immediately after the function is connected to the host Control transfer consists of two or three stages Setup stage Data stage and Status stage 5 2 2 Bulk Transfer Bulk transfer is used to transfer large amount of data untimely but without any error Transfer speed is not guaranteed...

Page 17: ...and c Parses and processes SCSI commands CatBOTTypedef h Bulk Only Transport structure definition CatProType h Prototype declaration CatSCSITypedef h SCSI structure definition macro definition to create FAT information CatTypedef h Basic structure definition used by USB firmware SetBOTInfo h Configures variables to support Bulk Only Transport SetMacro h Macro definition SetSCSIInfo h Configures va...

Page 18: ... to the interrupt GetPacket Writes data to RAM transferred from the host controller GetPacket4 Writes data transferred from the host controller to RAM in longwords Ring buffer supported not used in the USB Mass Storage Class GetPacket4S Writes data transferred from the host controller to RAM in longwords Ring buffer not supported high speed PutPacket Writes data to USB module transferred to the ho...

Page 19: ...Only Transport Get Max LUN command returns the maximum number of logical units supported by peripherals As the number of logical units in this sample program is 1 it returns 0 to the host Table 12 DoRequestBOT_StorageClass c File Name Function Name Description DoRequestBOT_ StorageClass c DecBOTClassCommands Handles the USB Mass Storage Class Bulk Only Transport DoControl c When the SETUP TS inter...

Page 20: ...ification Table 15 DoBOTMSClass c File Name Function Name Description ActBulkOnly Detects the current state and divides into stages ActBulkOnlyCommand Controls CBW in the Bulk Only Transport ActBulkOnlyIn Controls Data transport and Status transport in Bulk Only Transport Data Stage direction IN DoBOTMSClass c ActBulkOnlyOut Controls Data transport and Status transport in Bulk Only Transport Data ...

Page 21: ...on boot block as shown in Figure 7 When turning ON the system write the Master boot block and Partition boot block in the RAM disk area on the SDRAM using the initialization routine Master boot block Partition boot block Sector 0 Sector 20 Figure 7 Disk Structure Use the SCSI commands to access from the host computer to the function store data read data User must understand the structure shown in ...

Page 22: ...the host computer When the media cannot be accessed it returns Command failed CSW status H 01 CBW Decodes the command acknowledges it is READ 10 command and prepares for sending the specified number of bytes of data from the read sector in a disk which is executed on SDRAM When the media cannot be accessed LSB of unit_state 0 is 1 the function handles the transfer as with no data and handles it ac...

Page 23: ...s Failed and the sense key of the REQUEST SENSE to NOT READY Data This command does not include the Data transport TEST UNIT READY CSW Sends Command passed to the host computer When the media cannot be accessed it returns Command failed CSW status H 01 CBW Decodes the command acknowledges it is the VERIFY 10 command and prepares for sending Command passed to the host computer When the media cannot...

Page 24: ...Y Data Sends the READ FORMAT CAPACITY information to the host computer When the media cannot be accessed it returns the same number of bytes of data H 00 requested from the host READ FORMAT CAPACITY CSW Sends the command execution result to the host computer When the media cannot be accessed it returns Command failed CSW status H 01 CBW Decodes the command When the command is not supported it sets...

Page 25: ...ata transfer and function intends to transfer no data 2 Host expects no data transfer and function intends to send data to the host 3 Host expects no data transfer and function intends to receive data from the host 4 Host expects to receive data from the function and function intends to transfer no data 5 The amount of data received from the function that the host expected is less than the amount ...

Page 26: ...ent on the USB Data transport is other than 0 and the amount of data specified by the SCSI command is 0 10 When the host issues the READ command it also sends data on the USB Data transport 11 When the host issues the WRITE command the amount of data specified by the SCSI command is less than the data sent on the USB Data transport 13 When the host issues the WRITE command the amount of data speci...

Page 27: ...ction intends 0 CBW data is valid Receive CBW Detect the direction of Data transport by the CBW Set H 02 to the bCSWStatus Stall EP2 Bulk IN transfer on Data transport Bulk OUT transfer on Data transport Receive CSW End Command transport Data transport Status transport Figure 8 Flow Chart for Error Handling on Data Transfer 1 3 R01AN0063EJ0100 Rev 1 00 Page 27 of 32 Oct 22 2010 ...

Page 28: ...host expects Number of data function intends Number of data host expects Number of data function intends Add 0 to reach the number of data host expects Set the number of data added to the dCSWDataResidue Set the number of data not transmitted to the dCSWDataResidue Set H 00 to the bCSWStatus Set H 02 to the bCSWStatus Yes No Yes No Case 6 Case 4 5 Case 7 8 Figure 9 Flow Chart for Error Handling on...

Page 29: ...n the Data transport Set the number of data not transmitted to the dCSWDataResidue Set H 01 to the bCSWStatus Set H 02 to the bCSWStatus Yes No Yes No Case 6 Case 9 11 Case 13 Number of data host expects Number of data function intends Number of data host expects Number of data function intends Set the number of data exceeded to the dCSWDataResidue Dummy read the number of data host expects Case 1...

Page 30: ... to Figure 10 flow charts When there is no error during the data transfer between the host and function the sample program subtracts the number of bytes to transfer from fields dCBWDataTransferLength and dCSWDataTransferResidue every time the data transfer is executed on the Data transport Otherwise the sample program sets the difference between the number of bytes of data the host expects to proc...

Page 31: ...om the Renesas Electronics website Hardware Manual 2 SH7280 Group Hardware Manual Rev 2 00 The latest version of hardware manual can be downloaded from the Renesas Electronics website USB specifications 3 Universal Serial Bus Specification Revision 2 0 4 Universal Serial Bus Mass Storage Class Specification Overview 5 Universal Serial Bus Mass Storage Class Bulk Only Transport USB Implementers For...

Page 32: ... Class R01AN0063EJ0100 Rev 1 00 Page 32 of 32 Oct 22 2010 Website and Support Renesas Electronics Website http www renesas com Inquiries http www renesas com inquiry All trademarks and registered trademarks are the property of their respective owners ...

Page 33: ...A 1 Revision Record Description Rev Date Page Summary 1 00 Oct 22 10 First edition issued ...

Page 34: ...s supplied until the reset process is completed In a similar way the states of pins in a product that is reset by an on chip power on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetting has been specified 3 Prohibition of Access to Reserved Addresses Access to reserved addresses is prohibited The reserved addresses are provi...

Page 35: ...rtificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life 8 You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement...

Reviews: