AnsweredAssumed Answered


Question asked by qian.evan on Dec 17, 2012
Latest reply on Dec 18, 2012 by qian.evan
hi  all,
I have bought a STM32F105R8 demo board,   the board can communicate USART1 to CAN1.  now I want to try the USBD and CAN1 in FS mode, so I downloaded the “STM32_USB-Host-Device_Lib_V2.1.0” from web, and modify the VCP program. I replaced the COM1 code with CAN1 in the "USBD_CDC_VCP.C",  it  show a COM3 on PC host when the stm32f105 board's usb port plug in. but it has a problem when the VCP "com3" send data to CAN1:

step 1. CAN1 ---> COM3 , it  is ok,  the COM3 can continuty received datas from CAN1
step 2. COM3 ---> CAN1 , problem, the CAN1 only received one frame (11 bytes), then it looks like USBD stop.
step 3. if I repleat the "step 1" twice or more,  the COM3 will lost the first frame,  the following data can be received.
step 4. if I done the "step1", and then do "step2", the CAN1 also received one and couldn't get the following data.

the functions "VCP_DataRx" is send USB data to CAN1, the "VCP_DataTx" is send CAN1 data to USB host in the "USBD_CDC_VCP.c".  From the above steps,  I didn't know why the "VCP_DataRx" only be called one time?  the RX will be restored when "VCP_DataTx" be called.  hope you can tell me how to set the config!