Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Custom USB Desc RawHid + Mouse Not working at the same time

  1. #1
    Junior Member
    Join Date
    Feb 2018
    Posts
    4

    Custom USB Desc RawHid + Mouse Not working at the same time

    I created a custom usb desc item as follows:

    Code:
    #elif defined(USB_RAWHID_HID)
      #define VENDOR_ID		0x16C0
      #define PRODUCT_ID		0x0486
      
      #define RAWHID_USAGE_PAGE	0xFFAB  // recommended: 0xFF00 to 0xFFFF
      #define RAWHID_USAGE		0x0200  // recommended: 0x0100 to 0xFFFF
      #define MANUFACTURER_NAME	{'D','o','n','g','l','o','v','e','r'}
      #define MANUFACTURER_NAME_LEN	9
      #define PRODUCT_NAME		{'I','n','d','u','s','t','r','i','e','s'}
      #define PRODUCT_NAME_LEN	10
      #define EP0_SIZE		64
      #define NUM_ENDPOINTS         6
      #define NUM_USB_BUFFERS	20
      #define NUM_INTERFACE		3
      #define RAWHID_INTERFACE      0	// RawHID
      #define RAWHID_TX_ENDPOINT    3
      #define RAWHID_TX_SIZE        64
      #define RAWHID_TX_INTERVAL    1
      #define RAWHID_RX_ENDPOINT    4
      #define RAWHID_RX_SIZE        64
      #define RAWHID_RX_INTERVAL    1
      #define SEREMU_INTERFACE      1	// Serial emulation
      #define SEREMU_TX_ENDPOINT    1
      #define SEREMU_TX_SIZE        64
      #define SEREMU_TX_INTERVAL    1
      #define SEREMU_RX_ENDPOINT    2
      #define SEREMU_RX_SIZE        32
      #define SEREMU_RX_INTERVAL    2
      #define MOUSE_INTERFACE       2	// Mouse
      #define MOUSE_ENDPOINT        5
      #define MOUSE_SIZE            8
      #define MOUSE_INTERVAL        2
      #define ENDPOINT1_CONFIG	ENDPOINT_TRANSIMIT_ONLY
      #define ENDPOINT2_CONFIG	ENDPOINT_RECEIVE_ONLY
      #define ENDPOINT3_CONFIG	ENDPOINT_TRANSIMIT_ONLY
      #define ENDPOINT4_CONFIG	ENDPOINT_RECEIVE_ONLY
      #define ENDPOINT5_CONFIG	ENDPOINT_TRANSIMIT_ONLY

    Code:
    teensy36.menu.usb.rawhid=Raw HID
    teensy36.menu.usb.rawhid.build.usbtype=USB_RAWHID
    teensy36.menu.usb.rawhid.fake_serial=teensy_gateway
    teensy36.menu.usb.rawhid=Raw HID + MOUSE
    teensy36.menu.usb.rawhid.build.usbtype=USB_RAWHID_HID
    teensy36.menu.usb.rawhid.fake_serial=teensy_gateway

    but when i start using the mouse and the rawhid at the same time the program freezes until i disconnect from the rawhid. Did i do anything wrong in the usb_desc that could have caused this? Could it be a hardware limitation? Or is it definitely a problem in my code.
    Last edited by desu; 02-09-2018 at 08:48 PM.

  2. #2
    Junior Member
    Join Date
    Feb 2018
    Posts
    4
    so i just noticed that if i stop sending rawhid packets to the computer the mouse works. Is there some sort of limit that stops both from sending at the same time?

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,422
    If it were me I would try your code on one of the standard usb configurations, that contain both the items you want and see if that works. If it works than probably something incorrect in your configuration ...
    Last edited by KurtE; 02-09-2018 at 10:26 PM.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,574
    If you're (trying) sending more than 1000 per second, perhaps you're filling all the USB buffers?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •