2017-05-30 01:07 AM
hi everybody
I'm using stm32l151 and I want to use usb peripheral in cdc mode. I used stm32 cubeMx to generate the project.
when I connect the boar to PC, I can see the VCP in device manager.however I can't sen any data to PC. The function CDC_Transmit_FS() always return USBD_BUSY.
can anyone help me?
Here is my code:
while (1) { CDC_Transmit_FS(Buffer, 6); HAL_Delay(2000); }
I only added the above code to the project created by STM32cubeMX but it didn't work.
Thanks
Solved! Go to Solution.
2017-05-30 11:37 PM
I found the problem. It was my new terminal monitor software I used to monitor the serial port. it doesn't monitor the serial port unless the port to be read by a software. It just monitor when the port was opened by another software.
Thanks
2017-05-30 03:51 AM
Hi
Hosseinzadeh.Mohamma
,Are you using CDC example from CubeL1 package ?
You can start with a working 'CDC_Standalone' example available under STM32CubeL1 v1.7.0 and get inspired from the functions used todevelop your application.
Imen
2017-05-30 06:03 AM
Hi Imen
Thanks for your attention.
I don't use example project. I created a project using STM32CubeMX and then, I just used the function CDC_Transmit_FS() to send the word 'hello' to the PC, as in the example project of
STM32CubeL1 v1.6.0
. I checked in debug mode, and I understood that the first timeC
DC_Transmit_FS is called it does not return USBD_BUSY, but after that, it return USBD_BUSY.
I think that the transmission of the data, didn't complete.
2017-05-30 11:37 PM
I found the problem. It was my new terminal monitor software I used to monitor the serial port. it doesn't monitor the serial port unless the port to be read by a software. It just monitor when the port was opened by another software.
Thanks