C55XX CSL EXAMPLE

- Main Page
- Related Pages
- Data Structures

CSL USB EXAMPLE DOCUMENTATION

## USB EXAMPLE1 - POLL MODE TEST

### TEST DESCRIPTION:

This test is to verify the operation of the CSL USB module. This test runs in poll mode. In the poll mode interrupt registers are read continuously in a while loop. If there is any interrupt observed it will be served and test continues to poll for the next interrupts.

This USB test can be verified by a host USB tool(c5505usb_ep_diag.exe) which can send or receive 64 bytes of data to the USB device. This tool should be installed on the host PC. This tool requires Jungo USB driver which can be downloaded from the link www.jungo.com. inf file should be installed for the C5505/C5515 USB device using driver wizard of the windriver. This installation is required only when running this example for the first time.

NOTE: IN THE CURRENT CODE EP1 IS CONFIGURED FOR IN TRANSACTIONS(COMMNAD 4-->1, 0x81) AND EP2 IS CONFIGURED FOR OUT TRANSACTIONS(COMMAND 4-->2, 0x02). APPROPRIATE COMMANDS SHOULD BE SENT FROM THE HOST APPLICATION, OTHERWISE TEST WILL NOT WORK. STARTS THE DATA COMMANDS WITH DATA READ FOR PROPER SYNCHRONIZATION.

NOTE: THIS TEST HAS BEEN DEVELOPED TO WORK WITH CHIP VERSIONS C5505 AND C5515. MAKE SURE THAT PROPER CHIP VERSION MACRO IS DEFINED IN THE FILE c55xx_csl\inc\csl_general.h.

### TEST PROCEDURE:

- Open the CCS and connect the target (C5505/C5515 EVM)
- Open, build and load the USB program to the target
- Set the PLL frequency to 100MHz
- Run the program loaded on to the target
- Open the Windriver driver wizard and install the inf file for the USB device (Only when running for first time)
- Run the c5505usb_ep_diag.exe application. It displays following message

      		DeviceAttach: received and accepted attach for vendor id 0x451, product id 0x901
      		0, interface 0, device handle 0x00392AD8

      		Main Menu (active Dev/Prod/Interface/Alt. Setting: 0x451/0x9010/0/0)
      		----------
      		1. Display device configurations
      		2. Change interface alternate setting
      		3. Reset Pipe
      		4. Read/Write from pipes
      		6. Selective Suspend
      		7. Refresh
      		99. Exit
      		Enter option:

- Numbers from 1 to 99 should be entered to execute the operation given against each number
- For read and write operations command number should be selected depending on the end points configured for IN and OUT USB transfers. In the Current code EP1 is configured for IN transactions and EP2 is configured for OUT transactions. So 4-->2 is the command for write operation and 4-->1 is the command for read operation.
- USB host application gives zero bytes of data for the first read. This is a known behavior. So the first command should be read followed by write-read... for the proper synchronization of host and target USB device.
- Data transferred from the host will be copied to "usbDataBuffer".
- Data in the "usbDataBuffer" will be sent to host when host sends a read command
- For verifying the USB operations send write command from host and then read command. check whether the data sent by the host is transmitted back by the target or not.
- During read/write operations data will be displayed by the host USB tool
- USB device can be suspended using command 6. No operation will occur when USB is in suspended state
- A wakeup signal can be given to USB using "STOP" button in the EVM. For verifying self wakeup send command 6 from c5505usb_ep_diag.exe which will suspend the USB device. After device suspension no data transfer will succeed. To take the USB device out of suspension press STOP key in the EVM keypad. This will generate a self wakeup signal.After USB wakeup data transfer will happen normally. It is recommanded to use the self wakeup only at higher clock frequencies - 75, 100 and 120MHz

### TEST RESULT:

- USB device should be detected by the host PC and should be accessible through the host application c5505usb_ep_diag.exe
- Data written and data read should match in the host application
- USB Wakeup signal should be triggred by the "STOP" button of C5505/C5515 EVM key pad.

============================================================================

## USB EXAMPLE2 - INTERRUPT MODE TEST

### TEST DESCRIPTION:

This test is to verify the operation of the CSL USB module.This test runs in interrupt mode. USB interrupts are configured and ISR is registered using CSL INTC module. After initializing and configuring the USB module test waits on a while loop. When there is any request from the USB host application USB ISR is triggered and the requested operation is performed inside the ISR.

This USB test can be verified by a host USB tool(c5505usb_ep_diag.exe) which can send or receive 64 bytes of data to the USB device. This tool should be installed on the host PC. This tool requires Jungo USB driver which can be downloaded from the link www.jungo.com. inf file should be installed for the C5505/C5515 USB device using driver wizard of the windriver. This installation is required only when running this example for the first time.

NOTE: IN THE CURRENT CODE EP1 IS CONFIGURED FOR IN TRANSACTIONS(COMMNAD 4-->1, 0x81) AND EP2 IS CONFIGURED FOR OUT TRANSACTIONS(COMMAND 4-->2, 0x02). APPROPRIATE COMMANDS SHOULD BE SENT FROM THE HOST APPLICATION, OTHERWISE TEST WILL NOT WORK. STARTS THE DATA COMMANDS WITH DATA READ FOR PROPER SYNCHRONIZATION.

NOTE: THIS TEST HAS BEEN DEVELOPED TO WORK WITH CHIP VERSIONS C5505 AND C5515. MAKE SURE THAT PROPER CHIP VERSION MACRO IS DEFINED IN THE FILE c55xx_csl\inc\csl_general.h.

### TEST PROCEDURE:

- Open the CCS and connect the target (C5505/C5515 EVM)
- Open, build and load the USB program to the target
- Set the PLL frequency to 100MHz
- Run the program loaded on to the target
- Open the Windriver driver wizard and install the inf file for the USB device (Only when running for first time)
- Run the c5505usb_ep_diag.exe application. It displays following message

      		DeviceAttach: received and accepted attach for vendor id 0x451, product id 0x901
      		0, interface 0, device handle 0x00392AD8

      		Main Menu (active Dev/Prod/Interface/Alt. Setting: 0x451/0x9010/0/0)
      		----------
      		1. Display device configurations
      		2. Change interface alternate setting
      		3. Reset Pipe
      		4. Read/Write from pipes
      		6. Selective Suspend
      		7. Refresh
      		99. Exit
      		Enter option:

- Numbers from 1 to 99 should be entered to execute the operation given against each number
- For read and write operations command number should be selected depending on the end points configured for IN and OUT USB transfers. In the Current code EP1 is configured for IN transactions and EP2 is configured for OUT transactions. So 4-->2 is the command for write operation and 4-->1 is the command for read operation.
- USB host application gives zero bytes of data for the first read. This is a known behavior. So the first command should be read followed by write-read... for the proper synchronization of host and target USB device.
- Data transferred from the host will be copied to "usbDataBuffer".
- Data in the "usbDataBuffer" will be sent to host when host sends a read command
- For verifying the USB operations send write command from host and then read command. check whether the data sent by the host is transmitted back by the target or not.
- During read/write operations data will be displayed by the host USB tool
- USB device can be suspended using command 6. No operation will occur when USB is in suspended state
- A wakeup signal can be given to USB using "STOP" button in the EVM. For verifying self wakeup send command 6 from c5505usb_ep_diag.exe which will suspend the USB device. After device suspension no data transfer will succeed. To take the USB device out of suspension press STOP key in the EVM keypad. This will generate a self wakeup signal.After USB wakeup data transfer will happen normally. It is recommanded to use the self wakeup only at higher clock frequencies - 75, 100 and 120MHz

### TEST RESULT:

- USB device should be detected by the host PC and should be accessible through the host application c5505usb_ep_diag.exe
- Data written and data read should match in the host application
- USB Wakeup signal should be triggred by the "STOP" button of C5505/C5515 EVM key pad.

============================================================================

## USB EXAMPLE3 - DMA MODE TEST

### TEST DESCRIPTION:

This test is to verify the operation of the CSL USB module.This test runs in DMA mode. USB controller is having DMA module internal to it. This DMA can be used to exchange the data between USB FIFO and the CPU memory. USB interrupt are used to indicate the arrival of request from the host. USB interrupts are configured and ISR is registered using CSL INTC module. After initializing and configuring the USB module test waits on a while loop. When there is any request from the USB host application USB ISR is triggered and the requested operation is performed inside the ISR. Inside the ISR FIFO read and write operations are performed using CPPI DMA module.

This USB test can be verified by a host USB tool(c5505usb_ep_diag.exe) which can send or receive 64 bytes of data to the USB device. This tool should be installed on the host PC. This tool requires Jungo USB driver which can be downloaded from the link www.jungo.com. inf file should be installed for the C5505/C5515 USB device using driver wizard of the windriver. This installation is required only when running this example for the first time.

NOTE: IN THE CURRENT CODE EP1 IS CONFIGURED FOR IN TRANSACTIONS(COMMNAD 4-->1, 0x81) AND EP2 IS CONFIGURED FOR OUT TRANSACTIONS(COMMAND 4-->2, 0x02). APPROPRIATE COMMANDS SHOULD BE SENT FROM THE HOST APPLICATION, OTHERWISE TEST WILL NOT WORK. STARTS THE DATA COMMANDS WITH DATA READ FOR PROPER SYNCHRONIZATION.

NOTE: THIS TEST HAS BEEN DEVELOPED TO WORK WITH CHIP VERSIONS C5505 AND C5515. MAKE SURE THAT PROPER CHIP VERSION MACRO IS DEFINED IN THE FILE c55xx_csl\inc\csl_general.h.

### TEST PROCEDURE:

- Open the CCS and connect the target (C5505/C5515 EVM)
- Open, build and load the USB program to the target
- Set the PLL frequency to 100MHz
- Run the program loaded on to the target
- Open the Windriver driver wizard and install the inf file for the USB device (Only when running for first time)
- Run the c5505usb_ep_diag.exe application. It displays following message

      		DeviceAttach: received and accepted attach for vendor id 0x451, product id 0x901
      		0, interface 0, device handle 0x00392AD8

      		Main Menu (active Dev/Prod/Interface/Alt. Setting: 0x451/0x9010/0/0)
      		----------
      		1. Display device configurations
      		2. Change interface alternate setting
      		3. Reset Pipe
      		4. Read/Write from pipes
      		6. Selective Suspend
      		7. Refresh
      		99. Exit
      		Enter option:

- Numbers from 1 to 99 should be entered to execute the operation given against each number
- For read and write operations command number should be selected depending on the end points configured for IN and OUT USB transfers. In the Current code EP1 is configured for IN transactions and EP2 is configured for OUT transactions. So 4-->2 is the command for write operation and 4-->1 is the command for read operation.
- USB host application gives zero bytes of data for the first read. This is a known behavior. So the first command should be read followed by write-read... for the proper synchronization of host and target USB device.
- Data transferred from the host will be copied to "usbDataBuffer".
- Data in the "usbDataBuffer" will be sent to host when host sends a read command
- For verifying the USB operations send write command from host and then read command. check whether the data sent by the host is transmitted back by the target or not.
- During read/write operations data will be displayed by the host USB tool
- USB device can be suspended using command 6. No operation will occur when USB is in suspended state
- A wakeup signal can be given to USB using "STOP" button in the EVM. For verifying self wakeup send command 6 from c5505usb_ep_diag.exe which will suspend the USB device. After device suspension no data transfer will succeed. To take the USB device out of suspension press STOP key in the EVM keypad. This will generate a self wakeup signal.After USB wakeup data transfer will happen normally. It is recommanded to use the self wakeup only at higher clock frequencies - 75, 100 and 120MHz

### TEST RESULT:

- USB device should be detected by the host PC and should be accessible through the host application c5505usb_ep_diag.exe
- Data written and data read should match in the host application
- USB Wakeup signal should be triggred by the "STOP" button of C5505/C5515 EVM key pad.

============================================================================

## USB EXAMPLE6 - USB CDC TEST

### TEST DESCRIPTION:

This test is to verify the operation of the CSL USB and CDC ACM module. This test runs in interrupt mode. USB interrupts are configured and ISR is registered using CSL INTC module. After initializing and configuring the USB module, the test program waits on a while loop. When there is any input from the USB host application USB ISR is triggered and the requested operation is performed inside the ISR.

This USB CDC test can be verified by any terminal program (such as HyperTerminal) which can send or receive data via the virtual COM port for the USB CDC. The attached INF file (C5515_CDC_ACM.inf) is required. The INF file only be installed for the C5515 USB CDC device for the first time, when the using driver wizard of the windriver. This installation is required only when running this example for the first time.

NOTE: IN THE CURRENT CODE EP1 IN IS CONFIGURED FOR COMMUNICATION CLASS INTERFACE EP2 OUT (BULK OUT) AND EP3 (BULK IN) IN ARE CONFIGURED FOR DATA CLASS INTERFACE THOSE CAN BE CHANGED IN CSL_CDC.H

NOTE: THIS TEST HAS BEEN DEVELOPED TO WORK WITH CHIP VERSIONS C5505 AND C5515. MAKE SURE THAT PROPER CHIP VERSION MACRO IS DEFINED IN THE FILE c55xx_csl\inc\csl_general.h.

### TEST PROCEDURE:

- Connect the C5505/15 EVM with a PC via USB cable
- Open the CCS and connect the target (C5505/C5515 EVM)
- Open, build and load the USB program to the target
- Set the PLL frequency to 100MHz
- Run the program loaded on to the target
- Install the inf file for the USB device (Only when running for first time)
- After the proper USB enumeration, check the Control Panel-->System-->Hardware--> Device Manager-->Ports (COM & LPT) looking for C5515_CDC_ACM_device. A COM port will be assigned to the CDC ACM device, says COM16
- Run the HyperTerminal. Create a new connection to COM16
- Configure the new connection to the desired baud rate, parity, number of bits etc.
- The test program is acting as an echo device, whatever you input in the HyperTerminal, it will be echo them back. The user input to the HyperTerminal will be sent to the C5515 EVM via CSL_CDC_BULK_OUT_EP (EP2 OUT) and the data output from C5515 EVM to the will be sent to HyperTerminal via USB CSL_CDC_BULK_IN_EP (EP3 IN). You can change the actual port number in csl_cdc.h

### TEST RESULT:

- USB CDC ACM device should be detected by the host PC and should be accessible through a terminal application (HyperTerminal)
- Data typed in using keyborad and data displayed on the terminal window should match

============================================================================