eventCode 4 Device Not Supported in FRDM-K22 Keyboard Demo

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

eventCode 4 Device Not Supported in FRDM-K22 Keyboard Demo

2,598 次查看
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 项奖励
回复
10 回复数

2,580 次查看
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 项奖励
回复

2,465 次查看
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


2,439 次查看
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 项奖励
回复

2,590 次查看
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 项奖励
回复

2,569 次查看
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 项奖励
回复

2,564 次查看
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 项奖励
回复

2,480 次查看
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 项奖励
回复

2,469 次查看
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 项奖励
回复

2,553 次查看
stevenlutz
Contributor II

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

0 项奖励
回复

2,453 次查看
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 项奖励
回复