This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB HID Report size

Hi. I'm working with LPC 2368 controller and need to write USB HID application. I'm using Keil's example as base and I need to change it to send more bytes from device to PC at once. I've changed the example next way:

usbdesc.c

    HID_UsagePage(HID_USAGE_PAGE_DEV_CONTROLS),
    HID_UsageMin(0),
    HID_UsageMax(255),
    HID_Usage(0),
    HID_LogicalMin(0),
    HID_LogicalMax(255),
    HID_ReportCount(USB_SIZE),
    HID_ReportSize(8),
    HID_Input(HID_Data | HID_Variable | HID_Absolute),


usbuser.c

BYTE InReport[USB_SIZE];
void USB_EndPoint1 (DWORD event) {
  switch (event) {
    case USB_EVT_IN:
        GetInReport(InReport3)
        USB_WriteEP(0x81, InReport3, USB_SIZE);
      break;
  }
}


So the USB_SIZE is showing amout of bytes send to PC at once. And here is my problem: when USB_SIZE<=4 all works fine. When USB_SIZE>4 - PC receives nothing. Am I doing something wrong? Or somebody know how to do it correctly?
P.S. USB_MAX_PACKET0 is 64

Parents Reply Children
  • The problem is biggest during the European night, when Europe is sleeping and US companies has closed for the day. It seems that if I get a problem when there isn't any activity on the formum, the problem may persist for several hours - I may have to retry a post in the morning. But as soon as there is an activity on the forum, the problem seems to go away.

    Maybe the forum sends out a broken cookie (or a good cookie pointing to a broken machine) to always direct the user to the same server, and it takes other user-action to get the load-balancing solution to give out a cookie to a different (working) machine.

    I can't see why they need load sharing for the forum. If we assume 100 posts/day, a 1000 to 1 read/write ratio and a 10x clumping, the peak load on the server would still only be 11 reads/s and maybe 50 new posts in an hour. Having the forum fully integrated with the full company web site doesn't give it extra redundancy - just significant amounts of downtime or time when it disbehaves. Instead it gets maybe ten times the downtime of a single-server solution. This isn't the first time this forum has done strange things this year.

  • In my case, the trouble was caused by the SPAM filter of this forum engine.

    I usually write posts in a text editor for spell check, because English is not my native language and I'm not so good at English. When I pasted my whole post to the "Message" box and pushed "Preview" button, I saw neither of my message nor "Post" button on the preview page. I've experienced this kind of SPAM filter troubles on other fora. Then, I started to track down the "SPAM word" using this "Preview" test with binary search - split the post into half, and test on each half.

    As you see on my above post, the first half passed the preview test. Then I posted it.
    When I split the latter half again, neither of them didn't pass the preview test. The forum engine picked up multiple "SPAM words" in my post. I was going on the binary search, and lastly found one of the "SPAM word". When I delete just the word from my post, the forum engine accepted my post and showed the preview. I can't write the word here, because the forum engine rejects this post too. See this post on SiLabs Forum.
    "Comment to "USB HID Report size" on KEIL forum"
    www.cygnal.org/.../001445.html

    If it were a word in plain text, I would replace it with a synonym. In this way, I've made my posts pass SPAM filter of other fora. Unfortunately, it was a type name on the code, which is defined in MS HID header file. Then, I made struggle to rewrite the word so that the forum engine passes it, and easily recognized it was replaced. In this struggle, I made 30-40 times of preview test. And finally the forum engine rejected all of my posts, regardless of the contents of the post. My original account was banned by the forum engine.

    I know the SPAM filter is a required function to maintain fora. However, the SPAM filter of this forum is too strict unreasonably. I cannot predict which word is the SPAM word. As I'm not good at English, it takes fair time to make up a post. The rejection of the forum engine of my elaborated post disappoint me so much. Then, I'll never write to this forum any more.



    Anyway, why my account is banned as a spammer? Why me, instead of Andy? (just joke).

    Tsuneo