This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5 SDK 15 HID Keyboard example Endpoint transfer types?

How to select endpoint transfer type in hid keyboard example?

I am using nRF5 v15 with a nRF52832 and Soft Device s132 and the reports keep being sent as a bulk transfer rather than an interrupt, I can't seem to change it.

Cheers, Ash

Parents
  • Hi,

    Why do you believe it's using bulk transfer and not interrupt?

    Both mouse and keyboard endpoints are setup with transfertype interrupt. To send mouse reports more frequently you may change:

    /**
    * @brief Mouse move repeat time in milliseconds
    */
    #define CONFIG_MOUSE_MOVE_TIME_MS (1) // Instead of 5ms

    Best regards,
    Kenneth

    GetDescriptor (Configuration)

    Configuration descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    CONFIGURATION

    2

    0x02

    00000010

    wTotalLength

    59 bytes

    59

    0x003B

    00000000
    00111011

    bNumInterface

    2

    2

    0x02

    00000010

    bConfigurationValue

    1

    1

    0x01

    00000001

    iConfiguration

    4

    4

    0x04

    00000100

    bmAttributes. Reserved

    Zero

    0

    0x00

    00000

    bmAttributes. RemoteWakeup

    Supported

    1

    0x1

    1

    bmAttributes. SelfPowered

    Yes

    1

    0x1

    1

    bmAttributes. Reserved7

    One

    1

    0x1

    1

    bMaxPower

    500 mA

    250

    0xFA

    11111010

    Interface descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    INTERFACE

    4

    0x04

    00000100

    bInterfaceNumber

    0

    0

    0x00

    00000000

    bAlternateSetting

    0

    0

    0x00

    00000000

    bNumEndpoints

    1

    1

    0x01

    00000001

    bInterfaceClass

    Human Interface Device (Find out more online)

    3

    0x03

    00000011

    bInterfaceSubClass

    Boot Interface

    1

    0x01

    00000001

    bInterfaceProtocol

    Mouse

    2

    0x02

    00000010

    iInterface

    0

    0

    0x00

    00000000

    Unknown descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    Class: 0x21

    33

    0x21

    00100001

    Remaining descriptor data

    7 bytes

     

     

     

    Endpoint descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    7

    0x07

    00000111

    bDescriptorType

    ENDPOINT

    5

    0x05

    00000101

    bEndpointAddress

    1 IN

    129

    0x81

    10000001

    bmAttributes. TransferType

    Interrupt

    3

    0x3

    11

    bmAttributes. Reserved

    Zero

    0

    0x00

    000000

    wMaxPacketSize

    64 bytes

    64

    0x0040

    00000000
    01000000

    bInterval

    1 frame (1000 us)

    1

    0x01

    00000001

    Interface descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    INTERFACE

    4

    0x04

    00000100

    bInterfaceNumber

    1

    1

    0x01

    00000001

    bAlternateSetting

    0

    0

    0x00

    00000000

    bNumEndpoints

    1

    1

    0x01

    00000001

    bInterfaceClass

    Human Interface Device (Find out more online)

    3

    0x03

    00000011

    bInterfaceSubClass

    Boot Interface

    1

    0x01

    00000001

    bInterfaceProtocol

    Keyboard

    1

    0x01

    00000001

    iInterface

    0

    0

    0x00

    00000000

    Unknown descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    Class: 0x21

    33

    0x21

    00100001

    Remaining descriptor data

    7 bytes

     

     

     

    Endpoint descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    7

    0x07

    00000111

    bDescriptorType

    ENDPOINT

    5

    0x05

    00000101

    bEndpointAddress

    2 IN

    130

    0x82

    10000010

    bmAttributes. TransferType

    Interrupt

    3

    0x3

    11

    bmAttributes. Reserved

    Zero

    0

    0x00

    000000

    wMaxPacketSize

    64 bytes

    64

    0x0040

    00000000
    01000000

    bInterval

    1 frame (1000 us)

    1

    0x01

    00000001

Reply
  • Hi,

    Why do you believe it's using bulk transfer and not interrupt?

    Both mouse and keyboard endpoints are setup with transfertype interrupt. To send mouse reports more frequently you may change:

    /**
    * @brief Mouse move repeat time in milliseconds
    */
    #define CONFIG_MOUSE_MOVE_TIME_MS (1) // Instead of 5ms

    Best regards,
    Kenneth

    GetDescriptor (Configuration)

    Configuration descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    CONFIGURATION

    2

    0x02

    00000010

    wTotalLength

    59 bytes

    59

    0x003B

    00000000
    00111011

    bNumInterface

    2

    2

    0x02

    00000010

    bConfigurationValue

    1

    1

    0x01

    00000001

    iConfiguration

    4

    4

    0x04

    00000100

    bmAttributes. Reserved

    Zero

    0

    0x00

    00000

    bmAttributes. RemoteWakeup

    Supported

    1

    0x1

    1

    bmAttributes. SelfPowered

    Yes

    1

    0x1

    1

    bmAttributes. Reserved7

    One

    1

    0x1

    1

    bMaxPower

    500 mA

    250

    0xFA

    11111010

    Interface descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    INTERFACE

    4

    0x04

    00000100

    bInterfaceNumber

    0

    0

    0x00

    00000000

    bAlternateSetting

    0

    0

    0x00

    00000000

    bNumEndpoints

    1

    1

    0x01

    00000001

    bInterfaceClass

    Human Interface Device (Find out more online)

    3

    0x03

    00000011

    bInterfaceSubClass

    Boot Interface

    1

    0x01

    00000001

    bInterfaceProtocol

    Mouse

    2

    0x02

    00000010

    iInterface

    0

    0

    0x00

    00000000

    Unknown descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    Class: 0x21

    33

    0x21

    00100001

    Remaining descriptor data

    7 bytes

     

     

     

    Endpoint descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    7

    0x07

    00000111

    bDescriptorType

    ENDPOINT

    5

    0x05

    00000101

    bEndpointAddress

    1 IN

    129

    0x81

    10000001

    bmAttributes. TransferType

    Interrupt

    3

    0x3

    11

    bmAttributes. Reserved

    Zero

    0

    0x00

    000000

    wMaxPacketSize

    64 bytes

    64

    0x0040

    00000000
    01000000

    bInterval

    1 frame (1000 us)

    1

    0x01

    00000001

    Interface descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    INTERFACE

    4

    0x04

    00000100

    bInterfaceNumber

    1

    1

    0x01

    00000001

    bAlternateSetting

    0

    0

    0x00

    00000000

    bNumEndpoints

    1

    1

    0x01

    00000001

    bInterfaceClass

    Human Interface Device (Find out more online)

    3

    0x03

    00000011

    bInterfaceSubClass

    Boot Interface

    1

    0x01

    00000001

    bInterfaceProtocol

    Keyboard

    1

    0x01

    00000001

    iInterface

    0

    0

    0x00

    00000000

    Unknown descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    9

    0x09

    00001001

    bDescriptorType

    Class: 0x21

    33

    0x21

    00100001

    Remaining descriptor data

    7 bytes

     

     

     

    Endpoint descriptor

     

    Name

    Value

    Dec

    Hex

    Bin

    bLength

    Valid

    7

    0x07

    00000111

    bDescriptorType

    ENDPOINT

    5

    0x05

    00000101

    bEndpointAddress

    2 IN

    130

    0x82

    10000010

    bmAttributes. TransferType

    Interrupt

    3

    0x3

    11

    bmAttributes. Reserved

    Zero

    0

    0x00

    000000

    wMaxPacketSize

    64 bytes

    64

    0x0040

    00000000
    01000000

    bInterval

    1 frame (1000 us)

    1

    0x01

    00000001

Children
Related