<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Trouble with usbd_hid_get_report_trigger on STM32F4</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/30894/trouble-with-usbd_hid_get_report_trigger-on-stm32f4</link><description> 
Hello 
I am having some issues with usbd_hid_get_report_trigger on a
STM3241G-EVAL board. If I write too much too fast it ends up looping
in a hidden function inside USB_CM3.lib. 

 
I have done some software usb tracing in Windows, and it looks
that</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Trouble with usbd_hid_get_report_trigger on STM32F4</title><link>https://community.arm.com/thread/116922?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2012 01:14:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ed4e164a-4a46-4d36-b116-b948673c5ff7</guid><dc:creator>Milorad Cvjetkovic</dc:creator><description>&lt;p&gt;&lt;p&gt;
Can you report to Keil support.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble with usbd_hid_get_report_trigger on STM32F4</title><link>https://community.arm.com/thread/119756?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2012 04:12:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0e211b16-e475-4274-9e2b-b9f62e52e286</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;usbd_hid_get_report only gets called after many many calls to
usbd_hid_get_report_trigger(). From then on it is called after every
usbd_hid_get_report_trigger().&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
While enumeration of the device is going on, no transaction occurs
on the HID interrupt IN endpoint. Maybe, you are seeing this
period.&lt;/p&gt;

&lt;p&gt;
RL-ARM User&amp;#39;s Guide tells about usbd_hid_get_report_trigger(),&lt;br /&gt;
&lt;i&gt;&lt;a href="http://www.keil.com/support/man/docs/rlarm/rlarm_usbd_hid_get_report_trigger.htm"&gt;
&lt;a href="http://www.keil.com/support/man/docs/rlarm/rlarm_usbd_hid_get_report_trigger.htm"&gt;www.keil.com/.../rlarm_usbd_hid_get_report_trigger.htm&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;

BOOL usbd_hid_get_report_trigger(...)&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;Return Value: A boolean value indicating whether the trigger
function executed successfully.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
It means that this function fails until the last transaction
finishes.&lt;br /&gt;
But your finding suggests that overwrite to the endpoint buffer
occurs on STM32 implementation. Most likely, it&amp;#39;s a bug of the
library.&lt;br /&gt;
No one can fix it without library source code.&lt;br /&gt;
Contact to Keil support.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble with usbd_hid_get_report_trigger on STM32F4</title><link>https://community.arm.com/thread/106237?ContentTypeID=1</link><pubDate>Sun, 29 Jul 2012 23:11:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6cf2658b-e932-4d62-aaf4-5b286c75a967</guid><dc:creator>Baard K</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for your comment. I actually had this in mind and tested
this, but for some reason usbd_hid_get_report only gets called after
many many calls to usbd_hid_get_report_trigger(). From then on it is
called after every usbd_hid_get_report_trigger(). I find this a bit
strange, and dont see any reasonable explaination for this.&lt;/p&gt;

&lt;p&gt;
Anyways, I am just evaluating the Professional license including
RL-USB, but my first impression is not that well, and it turns out
the sourcecode isnt even included in the Pro license.&lt;/p&gt;

&lt;p&gt;
I&amp;#39;ll probably go on and evaluate other USB stacks for my project.
I&amp;#39;ll be happy to receive comments on this if anyone has good
experience with USB drivers for the STM32F4. Next out is USBX from
rtos.com I think.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble with usbd_hid_get_report_trigger on STM32F4</title><link>https://community.arm.com/thread/91642?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2012 10:31:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2750571b-1958-4b13-b7b3-bf00aa9d5b20</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
I&amp;#39;m not using Keil RL-USB lib, so, this is just my impression.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; If I write too much too fast&lt;br /&gt;
&amp;gt; it looks that this happens when Windows encounter a
USBD_STATUS_XACT_ERROR on the interrupt transfer&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Sound like usbd_hid_get_report_trigger() overwrites the interrupt
IN endpoint, before the last transaction completes on this EP. And
then, corrupted packet has sent to host. It results in
USBD_STATUS_XACT_ERROR (transaction error) on host.&lt;/p&gt;

&lt;p&gt;
You would be better to contact with Keil support on this issue, to
let them know usbd_hid_get_report_trigger() implementation requires
to see transaction completion.&lt;/p&gt;

&lt;p&gt;
Temporarily, try this workaround.&lt;/p&gt;

&lt;p&gt;
usbd_hid_get_report() raise a flag, which means the interrupt
endpoint is available.&lt;/p&gt;

&lt;pre&gt;
volatile U8 hid_int_ep_available = TRUE;

int usbd_hid_get_report (U8 rtype, U8 rid, U8 *buf, U8 req) {

  switch (rtype) {
    case HID_REPORT_INPUT:
      switch (rid) {
         case 0:
          switch (req) {
            ...
            case USBD_HID_REQ_EP_INT:
              hid_int_ep_available = TRUE;   // transaction completes on the interrupt IN EP
              break;
          }
           break;
      }
      break;
  }
  return (0);
}
&lt;/pre&gt;

&lt;p&gt;
Before usbd_hid_get_report_trigger() call, refer to this flag.&lt;/p&gt;

&lt;pre&gt;
if ( hid_int_ep_available ) {
  hid_int_ep_available = FALSE;
  usbd_hid_get_report_trigger( ... );        // put another report to the IN EP
}
&lt;/pre&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble with usbd_hid_get_report_trigger on STM32F4</title><link>https://community.arm.com/thread/60965?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2012 08:05:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:184a71f1-6d12-4a5b-8894-abf98ec9c7a7</guid><dc:creator>Baard K</dc:creator><description>&lt;p&gt;&lt;p&gt;
That assembly dump got wrong, it looks like this:&lt;br /&gt;
0x0800269A B198 CBZ r0,0x080026C4&lt;br /&gt;
0x0800269C 8862 LDRH r2,[r4,#0x02]&lt;br /&gt;
0x0800269E 2A00 CMP r2,#0x00&lt;br /&gt;
0x080026A0 D1FB BNE 0x0800269A&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>