This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于F28377S usb转串口的程序的问题



我最近在做一个通过串口调试的上位机软件,需要发送的数据量很大,发送频率也很高。下位机用的芯片是F28377S。

问题一:

我希望可以将设备的速度设为高速模式,但是在usb.h的文件里面只找到了全速和低速模式,有没有办法设置为高速模式呢?就算是全速模式,最高的发送频率也只能1帧每毫秒,我想要可以支持更高的发送频率。

// usb.h

//*****************************************************************************
//
// The following are values that are returned from USBSpeedGet().
//
//*****************************************************************************
#define USB_UNDEF_SPEED         0x80000000  // Current speed is undefined
#define USB_FULL_SPEED          0x00000001  // Current speed is Full Speed
#define USB_LOW_SPEED           0x00000000  // Current speed is Low Speed

 

问题二 :

有没有办法将USB FIFO 的大小设置超过64bytes?当我在usbdcdc.c文件中把设置USB FIFO 大小的宏定义设置大于64bytes后,自带usb3.0的电脑可以识别,但是老平台只有usb2.0的电脑就没法识别这么串口设备,显示如下:





我看到在usb.h文件中,有这么一段宏定义


// usb.h

//*****************************************************************************
//
// The following are values that can be passed to USBFIFOConfigSet() as the
// ui32FIFOSize parameter.
//
//*****************************************************************************
#define USB_FIFO_SZ_8           0x00000000  // 8 byte FIFO
#define USB_FIFO_SZ_16          0x00000001  // 16 byte FIFO
#define USB_FIFO_SZ_32          0x00000002  // 32 byte FIFO
#define USB_FIFO_SZ_64          0x00000003  // 64 byte FIFO
#define USB_FIFO_SZ_128         0x00000004  // 128 byte FIFO
#define USB_FIFO_SZ_256         0x00000005  // 256 byte FIFO
#define USB_FIFO_SZ_512         0x00000006  // 512 byte FIFO
#define USB_FIFO_SZ_1024        0x00000007  // 1024 byte FIFO
#define USB_FIFO_SZ_2048        0x00000008  // 2048 byte FIFO
#define USB_FIFO_SZ_4096        0x00000009  // 4096 byte FIFO

在usbdcdc.c里面更改设置的宏定义,把USB_FIFO_SZ_64改成了USB_FIFO_SZ_1024

//*****************************************************************************
//
// Maximum packet size for the bulk endpoints used for serial data
// transmission and reception and the associated FIFO sizes to set aside
// for each endpoint.
//
//*****************************************************************************
// #define DATA_IN_EP_FIFO_SIZE    USB_FIFO_SZ_64
// #define DATA_OUT_EP_FIFO_SIZE   USB_FIFO_SZ_64

#define DATA_IN_EP_FIFO_SIZE    USB_FIFO_SZ_1024
#define DATA_OUT_EP_FIFO_SIZE   USB_FIFO_SZ_1024
#define CTL_IN_EP_FIFO_SIZE     USB_FIFO_SZ_16

情况:

当USB FIFO大小设置为1024bytes时,只有支持USB3.0的windows电脑可以识别,只支持USB2.0的电脑无法识别,此外,Linux系统,不管是USB3.0还是2.0,都无法识别。

当USB FIFO大小设置为默认的64bytes时,USB不管2.0或者3.0都可以识别,此外Linux也可以识别。

请问有没有办法可以把FIFO的大小设置到1024bytes, 又可以让老电脑也可以识别呢