groupUrl: https://ez.analog.com/dsp/blackfin-processors/
Analog.com Analog Dialogue Wiki English
Analog.com Analog Dialogue Wiki 简体中文
EngineerZone
EngineerZone
  • Site
  • User
  • Site
  • Search
  • User
EngineerZone
EngineerZone
  • Log in
  • Site
  • Search
  • Log in
  • Home
  • Blogs ⌵
    • EZ Spotlight
    • The Engineering Mind
  • Browse ⌵
    • All Groups
    • All Members
  • Support ⌵
    • 3D ToF Depth Sensing
    • A2B
    • Aerospace and Defense (ADEF)
    • Amplifiers
    • Analog Microcontrollers
    • Analysis Control Evaluation (ACE) Software
    • Audio
    • Clock and Timing
    • Condition-Based Monitoring
    • Data Converters
    • Design Tools and Calculators
    • Direct Digital Synthesis (DDS)
    • Embedded Vision Sensing
    • Energy Monitoring and Metering
    • FPGA Reference Designs
    • Industrial Ethernet
    • Interface and Isolation
    • Low Power RF Transceivers
    • MEMS Inertial Sensors
    • Motor Control Hardware Platforms
    • Optical Sensing
    • Power Management
    • Precision Technology Signal Chains
    • Processors and DSP
    • Reference Circuits
    • RF and Microwave
    • Signal Chain Power (SCP)
    • Switches/Multiplexers
    • Temperature Sensors
    • Video
    • Wide Band RF Transceivers
    • Wireless Sensor Networks Reference Library
  • About EZ
  • More
  • Cancel
  • 主页
  • 浏览 ⌵
    • 收件箱
    • 个人设置
    • 会员
    • 专区列表
  • 论坛专区 ⌵
    • 放大器专区
    • 精密转换器专区
    • 音频专区
    • ADE电能计量专区
    • MEMS和传感器专区
    • 接口和隔离专区
    • Power 中文专区
    • ADUC微处理器专区
    • 锁相环专区
    • 开关和多路复用器专区
    • 温度传感器
    • 基准电压源专区
    • 资源库
    • 论坛使用指南
    • 技术支持参考库
    • 在线研讨会
    • 论坛社群活动
    • 论坛激励活动
  • More
  • Cancel
Blackfin Processors
  • Processors and DSP
Blackfin Processors
Documents How to Transfer Data Across Two EZ-KITs via USB
  • Q&A
  • Discussions
  • Documents
  • File Uploads
  • Sub-Groups
  • Tags
  • Reports
  • Managers
  • More
  • Cancel
  • New
Blackfin Processors requires membership for participation - click to join
  • +Documents
  • ADSP-BF537 - Memory test
  • Anomaly (05-00-0495) affecting ADSP-BF50x revision 0.0
  • Blackfin GPIO Open-Drain Functionality
  • BLACKFIN PROCESSORS
  • Booting an application from internal flash in BF50xF processors
  • Controlling multiple ADCs with the ACM
  • DAS U-BOOT FOR BLACKFIN SUPPORT COMMUNITY
  • FAQ: ADSP-BF527 Multi dxe boot
  • FAQ: ADSP-BF592 SPI loopback
  • FAQ: BF51x OTP memory read and write on GP space using CCES
  • FAQ: BF592 SPORT Example code
  • FAQ: Does ADI has BF702 USB Device Examples without using uCOS?
  • FAQ: Example code for ADSP-BF548 UART Full duplex communication across two Ez-kits
  • FAQ: Get total code and data size from Blackfin linker
  • FAQ: How do I reconcile Blackfin SPI serial clock phase control (CPHA) settings with potentially conflicting hardware/software slave select modes, when both these attributes are managed by the same control bit?
  • FAQ: How do I restore the original SDP image to flash on my SDP board?
  • FAQ: How do you generate safe and strong keys in Lockbox?
  • FAQ: How to access global variables for multi cores
  • FAQ: I have a Blackfin based USB application for which I've enabled (unmasked) the Connect and Disconnect interrupts, however, when I plug and unplug the USB cable no interrupt is generated. Why is this?
  • FAQ: I'm interested in the Blackfin processor family but don’t know where to start?
  • FAQ: Lockbox on EZ-Kits
  • FAQ: One .ldf file for release and debug
  • FAQ: USB:: Disabling Double Buffering
  • FAQ: Using the Blackfin SDP-B as a BF527 Evaluation Platform
  • FAQ: VisualDSP++ Workaround for SPI Boot Anomaly 05-00-0490
  • FAQ: What is Lockbox?
  • FAQ:  Blackfin and IEEE 1588
  • FAQ:  Can the ADC in BF506F be powered at 5V while interfacing to 3.3V signals?
  • FAQ:  CLI and "Target option Mask interrupts during step"
  • FAQ:  Connecting I2S via SPORT
  • FAQ:  External vs. Internal Voltage Regulator
  • FAQ:  How is the internal flash of BF50xF processors programmed?
  • FAQ:  How to boot the BF537?
  • FAQ:  Slow down start-up of internal regulator of BF525C processor
  • FAQ:  Unused PPI port pins
  • FAQ:  USB hub use with BF54x/BF52x USB controller
  • Floating point to integer conversion error
  • How Can I Boot A Blackfin Processor from an Atmel DataFlash SPI Memory Device?
  • How to create a bootable LDR file of Lockbox Security example?
  • How to Transfer Data Across Two EZ-KITs via USB
  • image processing demo for BF527
  • Impact of New On-Chip Flash for BF51xF Designs
  • Is There A Recommended DHCP Server Test for Blackfin and LwIP?
  • SDRAM Discontinuation
  • suggest me for correct datasheet
  • Trouble Transferring16-Bit Data on Blackfin SPORT
  • USB VBUS PROTECTION
  • What training is available for ADI DSPs
  • Where Can I Find the Blackfin assembly code for Cordic Algorithm?

How to Transfer Data Across Two EZ-KITs via USB

The attached code sets up two ADSP-BF527 EZ-KITs with one acting as  a USB Device and the other as a USB Host. This has been tested on revision 0.2 silicon with VisualDSP++ 5.0 Update 9. Application data transfer happens through BULK IN and OUT endpoints.You need to run the device first and then the host.

The device code uses ADI Bulk Class and has two BULK endpoints for data in and data out. The descriptors are programmed through the VSBulkConfigure() function in the adi_usb_bulkadi.c file when the application calls the command: ADI_USB_CMD_CLASS_CONFIGURE.  The Device has to wait for a command block from the host to call the right API for write or read.

The Device has the opened endpoints information, but the host doesn't. The following may be employed to retrieve this data at the Host end:

1.  The Host reuses the known/published Endpoint IDs to communicate with the Device:

g_ReadEpID  = 0x5;
g_WriteEpID = 0x6;

2.  It is however possible to retrieve the complete descriptor info, including which endpoints are configured at the Device. During enumeration, the event adi_usb_otg_SetConfiguration(1) is called to set the configuration number to be used by the Device. This function uses adi_usb_GetObjectFromID  to get the configuration object which the Host is going to activate for the Device. The Host stores this configuration object as its active configuration Object. This configuration object can be used to find out which BULK Endpoints are currently used by the Device.

case ADI_USB_OTG_EVENT_ENUMERATION_COMPLETE:     
          
         printf("\nenumeration event\n");
         usberrorcheck(adi_usb_otg_SetConfiguration(1));     


         pDevO = (PDEVICE_OBJECT)pArg;
         pCfgO = pDevO->pConfigObj;
         pEpO  = pCfgO->pActiveEpObj;
         pActiveEpO = pEpO;
        
         while(pActiveEpO != NULL)
         {
             /* BULK endpoints ONLY */
             if(pActiveEpO->pEndpointDesc->bAttributes == USB_BULK_MODE)
             {
                 if((pActiveEpO->pEndpointDesc->bEndpointAddress & 0x80))
                 {
                     g_ReadEpID   = pActiveEpO->ID;
                 }
                 else
                 {
                     g_WriteEpID   = pActiveEpO->ID;
                 }
             }

            pActiveEpO = pActiveEpO->pNextActiveEpObj;
         }
        
            g_bUsbenumerated = TRUE;
            break;

3.. Turn on the USB_OTG_PRINT_DESCRIPTOR and USB_DEBUG macros for USB driver libraries and rebuild them. This prints out the complete descriptor info to the console.

4. If the object IDs and endpoints (see the function ParseConfigurationMemory() in the adi_usb_otg.c file) are already known, you could do something similar to what the above macros do. If the info is not known, use method #2 to retrieve it and pass it to adi_usb_PrintDeviceDescriptor();


#ifdef DEBUG_DESCRIPTORS
   PDEVICE_OBJECT pDevO;
   PCONFIG_OBJECT pCo;
   PINTERFACE_OBJECT pIo;
   PENDPOINT_OBJECT pEpO1,pEpO2;   
  
   adi_usb_GetObjectFromID(1,USB_DEVICE_OBJECT_TYPE,(void*)&pDevO);
   adi_usb_PrintDeviceDescriptor(pDevO); printf("\n\n");
   adi_usb_GetObjectFromID(1,USB_CONFIGURATION_OBJECT_TYPE,(void*)&pCo);
   adi_usb_PrintConfigDescriptor(pCo);printf("\n\n");
   adi_usb_GetObjectFromID(0,USB_INTERFACE_OBJECT_TYPE,(void*)&pIo);
   adi_usb_PrintInterfaceDescriptor(pIo);printf("\n\n");
   adi_usb_GetObjectFromID(g_ReadEpID,USB_ENDPOINT_OBJECT_TYPE,(void*)&pEpO1);
   adi_usb_PrintEndpointDescriptor(pEpO1);printf("\n\n");
   adi_usb_GetObjectFromID(g_WriteEpID,USB_ENDPOINT_OBJECT_TYPE,(void*)&pEpO2);
   adi_usb_PrintEndpointDescriptor(pEpO2);printf("\n\n");
#endif

Common functions like WriteMemory() and ReadMemory() are used for data transfer. The Host uses SendCommand() while the Device uses ReadCommand().

Please refer to the below references for further details and more accurate info of API usage.

--Prasanth.

Further reference:

Host example: ...\Blackfin\Examples\ADSP-BF527 EZ-KIT Lite\Services\File System\VDK\shell_browser

 

Device example: ...\Blackfin\Examples\ADSP-BF527 EZ-KIT Lite\Drivers\usb\bulk_loopback_app

 

Driver Docs: ...\Blackfin\docs\drivers\usb

USB Descriptors: http://www.beyondlogic.org/usbnutshell/usb5.shtml

Here are some screenshots:

Device: 

Host:

Descriptors:

This FAQ was generated from the following discussion: How to transfer data across two EZ-KITs through USB?

Attachments:
1732.Device.zip
4278.Host.zip
  • usb
  • Share
  • History
  • More
  • Cancel
Comments
Anonymous
Related
 
社交网络
快速链接
  • 关于ADI
  • Partners
  • 模拟对话
  • 职业
  • 联系我们
  • 投资信息
  • 新闻中心
  • 质量和可靠性
  • 办事处与代理商
  • Analog Garage
语言
  • English
  • 简体中文
  • 日本語
  • Руccкий
电子快讯

欲获得最新ADI产品、设计工具、培训与活动的相关新闻与文章,请从我们的在线快讯中选出您感兴趣的产品类别,每月或每季度都会发送至您的收件箱。

订阅
Switch to mobile view
Analog Logo
© 1995 - 2022 Analog Devices, Inc. All Rights Reserved 沪ICP备09046653号-1
  • ©
  • 1995 - 2022 Analog Devices, Inc. All Rights Reserved
  • 沪ICP备09046653号-1
  • 网站地图
  • 隐私和保密政策
  • 隐私设置
  • 使用条款
 
Social
Quick Links
  • About ADI
  • Partners
  • Analog Dialogue
  • Careers
  • Contact us
  • Investor Relations
  • News Room
  • Quality & Reliability
  • Sales & Distribution
  • Analog Garage
Languages
  • English
  • 简体中文
  • 日本語
  • Руccкий
Newsletters

Interested in the latest news and articles about ADI products, design tools, training and events? Choose from one of our 12 newsletters that match your product area of interest, delivered monthly or quarterly to your inbox.

Sign Up
Switch to mobile view
Analog Logo
© 1995 - 2022 Analog Devices, Inc. All Rights Reserved 沪ICP备09046653号-1
  • ©
  • 1995 - 2022 Analog Devices, Inc. All Rights Reserved
  • 沪ICP备09046653号-1
  • Sitemap
  • Privacy & Security
  • Privacy Settings
  • Terms of use
EngineerZone Uses cookies to ensure you get the best experience in our community. For more information on cookies, please read our Privacy & Security Statement.