📄 release notes for upsd34xx usb_disc demo.txt
字号:
Release Notes for the uPSD34xx USB_disc demo
Version: March 23, 2005 -- Version 1.0
Development Environment: The reference design was built using Keil抯 uVision IDE.
Description: The reference design emulates a USB flash disc with read only memory. A uPSD34xx, when programmed with the reference code and connected to a host computer via USB, will enumerate as a flash disc, and using the mass storage class device driver, will appear as an available drive on the system. The emulated flash disc has various read only files.
Purpose: This USB_disc demo is intended to demonstrate USB functionality and provide example code for using the full speed USB module within the uPSD34xx. This example uses bulk transfers on endpoints 1 and 3. Enumeration for a different target application only requires changes to the descriptors. The remaining modifications to the example code include application specific processing of host commands and loading and unloading the FIFOs with data as required by the application.
Limitations: This version of the reference design doesn抰 provide support for the USB-IF Chapter 9 test.
Silicon errata: Please check ST抯 website at: http://www.st.com/micropsd for any known errata related to the uPSD34xx device.
Main contents of USB_disc demo zip file:
1. Source code files
- main.c
- fs_0.c
- upsd3400_usb_app.c
- upsd3400_upsd_usb.c
2. Header files
- upsd3400_usb_desc.h
- upsd3400_usb.h
- upsd3400_upsd_usb.h
- upsd3400_usb_app.h
- upsd3400.h
- upsd3400_hardware.h
3. Startup related files
- startup34.a51
4. Keil抯 uVision project and firmware (hex) files
- DK3400.uv2
- DK3400.hex
- fs_x.hex (9 files with x = 0 through 8)
5. PSDsoft project and object files (in the PSDsoft folder)
- project.ini
- project.obj
Detailed description of files:
startup34.a51 - this file contains the typical initializations that are performed in a system before jumping to the main program. Also included in the startup file is the initialization of the BUSCON register to maximize the performance of the uPSD34xx. The settings for the BUSCON register are based on the frequency and voltage operation of the target device as specified in the upsd3400_hardware.h file. It is important that the device specific settings in this header file match the target device for optimal run time performance. The settings in this example are set for a 5V uPSD3434 running at 40MHz.
main.c - The USB peripheral is initialized from main() as well as some counters used for tracking USB ISR interrupts. Port PD1 is initialized and is used to drive a red LED on the DK3400 that provides a visual indication of USB ISR activity. Main() also copies the disk directory and FAT content to SRAM that is used in this example. In addition, it sets up a timer interrupt that periodically interrupts the main while(1) loop that turns the LED on/off in such a fashion as to appear as though the LED is varying in intensity.
upsd3400_upsd_usb.c - this file contains a number of basic USB functions that include those used in the enumeration process and are not specific to a particular application (flash disc in this case) that exchanges data with a host over USB. Functions include USB initialization, reset, suspend, and resume processing. Other functions include those used in the enumeration process such as reading, decoding and processing setup packets.
In targeting a different USB application, changes to this file will be minimal. Initially, the most important function to review and make changes to is the UsbInitialize() function. The uPSD34xx uses a PLL to generate a 48MHz clock derived from the main oscillator that is required by the USB SIE to properly receive and send packets over USB. The settings for the PLL are dependent on the main oscillator used with the uPSD34xx. This function includes PLL settings for the most typically used main oscillator frequencies and the appropriate setting should be uncommented.
The USB reset processing function, OnUsbReset(), may require modifications to enable the appropriate USB related interrupts and FIFOs that will be used by other applications.
upsd3400_usb_app.c - this file contains the USB ISR plus functions related to the flash disc application. In this specific implementation, all USB and flash disc related functions are processed from the ISR found in the function named UsbIsr(). It is most likely that the USB ISR in other applications will only manage interrupt and state flags based on USB events and that code from the main loop will handle moving data to/from the FIFOs and setting control bits as appropriate.
fs_0.c - this file contains the default flash disc initialization information and is specific only to the flash disc application.
upsd3400_usb_desc.h - this file contains the USB descriptors for the flash disc application. Descriptors are used during the enumeration process to describe to the host PC what the USB device is, the manufacturer, the number/direction of endpoints, the type of data transfers, etc. For other applications, the descriptors in this file require appropriate modification.
upsd3400_usb.h - this file contains USB structures and constant definitions.
upsd3400_upsd_usb.h - this is the header file for the upsd3400_upsd_usb.c file.
upsd3400_usb_app.h - this file contains flash disk application related definitions.
upsd3400.h - this file contains definitions for the SFRs and the PSD registers within the uPSD34xx.
upsd3400_hardware.h - this file contains definitions for the target uPSD34xx device. Of particular importance is the FREQ_OSC and uPSD_5V #defines that are used by startup34.a51 in setting the BUSCON register appropriately for optimal performance of the uPSD34xx. The base address for the PSD module (CSIOP) registers is also defined in this file.
DK3400.uv2 - this file is Keil抯 uVision IDE project file. It contains information used by uVision to build the code for the flash disc application.
DK3400.hex - this file contains the compiled/linked/located USB reference firmware in hex format.
fs_x.hex (9 files with x = 0 through 8) - these files contain the read only content on the emulated flash disc.
project.ini (in the PSDsoft folder) - this file contains information regarding the hardware configuration of the uPSD34xx. Such information includes memory mapping of the flash segments and some I/O and CPLD configuration. It also includes information that is used in loading firmware hex files to specific flash memory segments.
project.obj (in the PSDsoft folder) - this file contains the object file that is programmed into the uPSD34xx. It includes the firmware hex file merged with the PSD module configuration information. If Keil抯 uVision is not available for programming the uPSD34xx, then PSDsoft with FlashLink or RLINK-ST can be used to program the object file into the device.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -