cypress usb controller firmware program

这篇博客介绍了如何使用Cypress的USB控制器固件进行编程。内容包括使用Keil uVision3和EZ-USB_devtools_version_261700作为开发工具,编辑program.c文件中的TD_Init和DR_VendorCmnd函数,以及dscr.a51文件中的设备描述符。博主详细解释了如何构建项目生成hex文件,并通过hex2bix命令创建iic文件以供FX2 EEPROM下载。此外,还指导了如何编辑driver.inf文件以匹配Vendor ID和Product ID。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

所需开发工具:

  1. Keil uVision3
  2. EZ-USB_devtools_version_261700

C:/Cypress/USB/Examples/有很多源代码,一般只需要修改部分代码就可以了.

 

 

Edit the program.c file

 

TD_Init(void)

DR_VendorCmnd(void)

 

Edit the dscr.a51 file:

DeviceDscr:  
      db   DSCR_DEVICE_LEN      ;; Descriptor length
      db   DSCR_DEVICE   ;; Decriptor type
      dw   0002H      ;; Specification Version (BCD)
      db   00H        ;; Device class
      db   00H         ;; Device sub-class
      db   00H         ;; Device sub-sub-class
      db   64         ;; Maximum packet size
      dw   8808H      ;; Vendor ID
      dw   0210H      ;; Product ID (Sample Device)
      dw   0000H      ;; Product version ID
      db   1         ;; Manufacturer string index
      db   2         ;; Product string index
      db   0         ;; Serial number string index
      db   1         ;; Number of configurations

 

 

 

build the project make the hex file

 

use follow command make the iic file for FX2 eeprom download

 

c:/cypress/usb/bin/hex2bix -i -f 0xC2 -v 0x0888 -p 0x1002 -o vend_ax.iic vend_ax.hex

 

0x0888 is Vendor ID

0x1002 is Product ID

 

 

 

 

Edit driver.inf file like this

 

[Cypress]
;%VID_VVVV&PID_PPPP.DeviceDesc%=CyUsb, USB/VID_VVVV&PID_PPPP
%VID_04B4&PID_8613.DeviceDesc%=CyUsb, USB/VID_04B4&PID_8613
%VID_0888&PID_1002.DeviceDesc%=CyUsb, USB/VID_0888&PID_1002

 

 

[Strings]
CYPRESS="Cypress"
MfgName="Cypress"
CYUSB_INSTALL="Cypress Generic USB Driver Installation Disk"
;VID_VVVV&PID_PPPP.DeviceDesc="Cypress Generic USB Device"
VID_04B4&PID_8613.DeviceDesc="Cypress Generic USB Device"
VID_0888&PID_1002.DeviceDesc="HJ USB Device"

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值