We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
if tested the KEIL USB-HID example for the EK-STM32F. It is working!
But when I change the endpoint IN from 1 to 2 -> it seems that the device will never get any interrupts which should call the void USB_EndPoint2 (U32 event) function.
Do someone know which additional changes I have to do? I've only add the endpoint2 interrupt to USB_EP_EVENT.
best regards Jeeremie
Hi Martin,
I found the mistake - but I'm very appreciate if you could tell me the reason for this behaviour.
In the c-file usbuser.c there's a function installed called "USB_Configure_Event". What is the reason for this function?
Per default - there's an dummy call of USB_WriteEP() - I don't know why... And the strange thing about it is, if I delete this function call USB_WriteEP() then there will be no communication with the endpoint2. That means the function USB_EndPoint2() will be never called.
But if there's the function call in USB_Configure_Event - everything is running.
void USB_Configure_Event (void) { if (USB_Configuration) { /* Check if USB is configured */ GetInReport(); USB_WriteEP(0x82, &InReport, sizeof(InReport)); } }
I hope you could tell me reason for this behaviour.
Thanks in advance!
Hi Jeremie Quolage,
Please see this thread: http://www.keil.com/forum/docs/thread15613.asp
Author: Tsuneo Chinzei Posted: 24-Sep-2009 17:48 GMT Toolset: ARM
USB_Configure_Event() is called when Set_Configuration request comes from host on enumeration. In this routine, an input report is loaded to the EP1 IN buffer using USB_WriteEP(). This report is the first one. When host starts to repeat IN transactions just after enumeration, this report is sent to the host. And then, USB interrupt occurs at the IN EP1.
On this interrupt, USB_EndPoint1() is called. This routine fills the endpoint buffer with a report using USB_WriteEP(). This report is sent to host at the next IN transaction after the specified interval (bInterval). Another endpoint interrupt occurs, and USB_EndPoint1() is called again.
In this way, USB_EndPoint1() is called repeatedly, at bInterval.
If you put nothing to the endpoint buffer in USB_EndPoint1(), what happens? No report is sent to the host, and no endpoint interrupt occurs. The sequence stops, USB_EndPoint1() is never called any more, until you fill the endpoint buffer with USB_WriteEP().
I suppose this is your story, isn't it?