eventCode 4 Device Not Supported in FRDM-K22 Keyboard Demo

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eventCode 4 Device Not Supported in FRDM-K22 Keyboard Demo

1,631 Views
stevenlutz
Contributor II

I am running the frdmk22f_host_hid_mouse_keyboard_bm demo and when I plug in a macro keyboard, the demo immediately echo's "device not supported", regular keyboards are ok but I need macro keypads to be supported too.

I have looked through the code and see that there is a variable called eventCode which is set to 3 when a device is supported and set to 4 when it is not.

Where is the eventCode Variable set? It seems I need to modify some things to support this macro keypad. Any advice would be helpful

Thank you.

0 Kudos
10 Replies

1,613 Views
stevenlutz
Contributor II

Thank you.

But I can't seem to find where the allowed Class codes and allowed subclass codes are defined
Can you supply additional details?

 

I'm trying to use a device with the following:
ClassID: 0x3
SubClassID: 0x0
Protocol: 0x0

 

0 Kudos

1,498 Views
bobpaddock
Senior Contributor III

You might find porting TinyUSB easier than digging through the morass of NXP USB code.
It comes with example for the KL25.

https://www.tinyusb.org

 

Investing in Jan's "USB Complete" book would be wise.
Get the 5th edition.
It explains the whole USB process (and makes you wonder what insane person through it was the way to do it back when Intel came up with it)..

http://janaxelson.com/usbc.htm


1,472 Views
stevenlutz
Contributor II

I hope this book is the key to understanding the madness! Ordering now. 

I'll take a look at TinyUSB however I do need to use the K22 as it has CANBUS support as well. 
I'm climbing a bit of a mountain here. 

I really appreciate you chiming in and please, if there is anything else that I think will help, please send it my way. 


0 Kudos

1,623 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @stevenlutz ,

When USB device attached, USB stack will check device's class. Please see in host_keyboard.c. USB_HostHidKeyboardEvent() will check CLASS, SUBCLASS and protocol. If number is not equal, it will return kStatus_USB_NotSupported.

You can modify the code here to fit your keyboard.

Regards,

Jing

0 Kudos

1,602 Views
stevenlutz
Contributor II

By making the change to allow this keyboard to be viewed an accepted type, when I press keys, nothing insprinted. it must be using a different protocol. 
I have been looking for USB documentation reagrding the various protocol options. Do you know where I can find it?

Also, where in this example does it parse the data coming from the keyboard?

0 Kudos

1,597 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @stevenlutz ,

You can search in usb.org, for example https://www.usb.org/sites/default/files/hid1_11.pdf.

The usb stack will not parse the device descriptor. Descriptor is parsed by host_keyboard.c via a callback mechanism. You can put a breakpoint at here to see what happen.

 

Regards,

jing

0 Kudos

1,513 Views
stevenlutz
Contributor II

Do you know of a compatible reprogramable keyboard encoder IC that is compatible with the K22 sample driver?

 

I'm still having trouble getting programmable macro keypads to work with these driver examples. 

 

Is there additional support that i could get through NXP? 

0 Kudos

1,502 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @stevenlutz ,

1. No, I don't know.

2. NXP has professional support. 

https://www.nxp.com/support/support/nxp-engineering-services/professional-support-for-processors-and...

 

Regards,

Jing

0 Kudos

1,586 Views
stevenlutz
Contributor II

I have previously seen that document but it doesn't seem out give the details of the protocol options. 

0 Kudos

1,486 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @stevenlutz ,

We haven't documents about other protocol. 

If you modify the CLASS and SUBCLASS to the keyboard's value, can you receive any data from keyboard?

 

Regards,

Jing

0 Kudos