2014-04-11 09:21 AM
Hello All,
I am using the STM32F4 discovery board. I am using USB as a VCP and EXTI for detecting the rising edge of my signal. The USB and the EXTI work good when operated independently but don't work when both modules are used. Can u please help me on this. Thanks. #vcp #usb #stm32 #stm322014-04-11 09:47 AM
Sounds like your EXTI interrupts are doing something inappropriate.
2014-04-11 12:29 PM
Thanks clive, I figured that out.... But I have another Question, when I am transmitting my buffer arrays why does it happen the array is received in random manner, means buffer[5] is received before buffer[1]. Can u please help me on this.
Thanks2014-04-11 04:06 PM
I don't think ST put much thought into the buffering on the VCP, it was adequate for a simple USART attachment example, but would need more thought and management if larger or more frequent transfers were need. You'll need to review how the buffer to the USB side is filled, dispatched, and how to determine when the next one can be sent.
2014-04-14 12:10 PM
Hello Clive,
I am trying to send 10000 size array over the VCP but unfortunatelyI seem to be losing data erratically. I dont know what parameters to set in usbd_conf.h
Thanks for your help.
2014-04-15 01:18 AM
Hi
I assume (since you are using an F4 part) that you are using the USB OTG library. '' I am trying to send 10000 size array over the VCP but unfortunatelyI seem to be losing data erratically. I dont know what parameters to set in usbd_conf.h
'' I do not think your problem is to do with the configuration. Your problem is more likely to be to do with the way the VCP code deals with the buffer for transmitting data to the PC. Search for ''APP_Rx_Buffer'' ''APP_Rx_ptr_in'' and ''APP_Rx_length'' To send data to the PC - the data is put into APP_Rx_Buffer and the 'pointer' ''APP_Rx_ptr_in'' is updated. However, if you look at the code that access and transmits the data - there is no proper buffer overflow detect and no proper way to detect when data is ready to send.