cancel
Showing results for 
Search instead for 
Did you mean: 

USB (VCP) and EXTI together dont work

manoritesameer
Associate II
Posted on April 11, 2014 at 18:21

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 #stm32
5 REPLIES 5
Posted on April 11, 2014 at 18:47

Sounds like your EXTI interrupts are doing something inappropriate.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
manoritesameer
Associate II
Posted on April 11, 2014 at 21:29

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.

Thanks 

Posted on April 12, 2014 at 01:06

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
manoritesameer
Associate II
Posted on April 14, 2014 at 21:10

Hello Clive,

        I am trying to send 10000 size array over the VCP but unfortunately 

 I seem to be losing data erratically. I dont know what parameters to set in usbd_conf.h

 

 

Thanks for your help.

chen
Associate II
Posted on April 15, 2014 at 10:18

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 unfortunately 

 I 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.