Author Topic: STM32F4 USB using endpoint address 0x82  (Read 1362 times)

0 Members and 1 Guest are viewing this topic.

Offline cncjerryTopic starter

  • Supporter
  • ****
  • Posts: 1283
STM32F4 USB using endpoint address 0x82
« on: November 12, 2018, 05:51:50 pm »
I started with cubeMX generated code and have my composite device working one interface at a time (keyboard and encoder).  If I put both interfaces on 0x81, neither works for some reason. If I put one on 0x81 and the second on 0x82, the one on 0x81 works.  I traced the sendreport to 0x82 and it hangs because it never get "busy" reset.  This should happen in the datain stage, which never gets called when 0x82 is used.

I realize the CubeMX USB stack is very basic, etc, etc, but before I move to another stack, I wanted to try to get 0x82 working. Maybe having two addresses will help separate the interfaces, i don't know.  I allocated a fifo buffer to 0x82 in the init code, open it, and as far as I can tell, it should be working, but that interface never goes into DataIn stage so it always looks busy. 

Do I need to expand the class with another datain stage?  I know the report descriptors are correct and I know my config descriptor is correct.  Everything enumerates, etc.  I am using two interfaces with two reportIDs and when both are on 0x81, I can watch the traffic go to the PC with wireshark.   But it looks like both interfaces somehow get handled by my encoder driver instead of the keyboard driver on one, and the encoder on the other.  Looking at device manager, though, it looks like both drivers are assigned correctly to each interface. 

Does anyone have example code or pointers on how to use 0x82?  This is my last attempt with a custom HID using CubeMx.  If it doesn't work I am going to do a major rewrite using another USB stack.

Thanks

Jerry
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: STM32F4 USB using endpoint address 0x82
« Reply #1 on: November 15, 2018, 03:07:54 pm »
You can't have two simultaneously active interfaces using the same endpoint. If one driver receives the data from this endpoint, the data will be consumed and never reach the other driver.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf