markymarc35
Posts: 10
Joined: Tue Oct 02, 2012 11:09 pm

Baking PI Input01 and 02

Wed Feb 27, 2013 8:03 pm

Hi all,

After beeing rescued for the screen tutorials, i am facing another issue.
The input01 and input02 tutorials do not seems to get the key pressed from my keyboard.

Input02 does show the text on screen (now) but nothing from the keyboard.

My keyboard is a USB Logitech G110
I have 3 lines in my config.text:
hdmi_mode=8
disable_overscan=1
kernel_old=1

Any help would be apreciated.

Thank you

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 1:53 am

The way the keyboard driver works, is not implemented in every keyboard, i would say it works with about 40% of usb keyboards.
The only thing to do is get a different keyboard.
Here are the ones i have found to work

"Logitech classic keyboard200"
"perixx periboard-203" http://www.perixx.com/en/
"saitek cyborg v1"
Batteries not included, Some assembly required.

markymarc35
Posts: 10
Joined: Tue Oct 02, 2012 11:09 pm

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 2:48 am

Bummer ....

There must be a way to do this.
I was under the impression that there was at lease the common keys that would work as every keyboard will work on a pc bootup even before the OS (Windows, Linux or whatever) a started. That includes the keyboard that i have here.

Once the OS is on, the drivers take over and you get all the specialty keys.

Thing that make you go mmmmmmmmmmmmmm......

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 3:08 am

markymarc35 wrote:Bummer ....

There must be a way to do this.
I was under the impression that there was at lease the common keys that would work as every keyboard will work on a pc bootup even before the OS (Windows, Linux or whatever) a started. That includes the keyboard that i have here.

Once the OS is on, the drivers take over and you get all the specialty keys.

Thing that make you go mmmmmmmmmmmmmm......
The problem is that keyboard makers interpret the usb hid spec as they read it, some this way, other that way, normally there is many layers to a USB stack that catch one of these, so it works.
But its a big task to write a usb stack with little info, so that usb stack is the bare minimum, which means it does not work with all keyboard.
I was lucky 3 of mine work, even a £5 cheapo one.
I am sure people will add to it to make it work with all in time.
Batteries not included, Some assembly required.

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 7:18 am

DexOS wrote:The problem is that keyboard makers interpret the usb hid spec as they read it, some this way, other that way
No, the problem is that csud only implements part of the HID boot protocol. It's enough for some keyboards, ones which aren't too picky, to work with it, but not for others. This is not a criticism of chadderz's coding; it's a "non-trivial" task to get even a partial USB implementation up on something where you have no documentation beyond picking someone else's spaghetti loops code apart.

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 8:15 am

tufty wrote:
DexOS wrote:The problem is that keyboard makers interpret the usb hid spec as they read it, some this way, other that way
No, the problem is that csud only implements part of the HID boot protocol. It's enough for some keyboards, ones which aren't too picky, to work with it, but not for others. This is not a criticism of chadderz's coding; it's a "non-trivial" task to get even a partial USB implementation up on something where you have no documentation beyond picking someone else's spaghetti loops code apart.
I can see little difference, between what i put and what you have wrote.
If something works on one device, but not on another, when they use the same spec.
Then they must have interpretive the spec differently, which one interpretive the spec right, is a different matter.
Batteries not included, Some assembly required.

markymarc35
Posts: 10
Joined: Tue Oct 02, 2012 11:09 pm

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 12:46 pm

Thank you guys you have given me somthing to think about :D

markymarc35
Posts: 10
Joined: Tue Oct 02, 2012 11:09 pm

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 6:36 pm

in the tutorial input01 there is mention of the USB drivers that were done and that they would be available in the download section.

I cannot seem to find them ....

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Baking PI Input01 and 02

Thu Feb 28, 2013 7:18 pm

DexOS wrote:
tufty wrote:
DexOS wrote:The problem is that keyboard makers interpret the usb hid spec as they read it, some this way, other that way
No, the problem is that csud only implements part of the HID boot protocol. It's enough for some keyboards, ones which aren't too picky, to work with it, but not for others. This is not a criticism of chadderz's coding; it's a "non-trivial" task to get even a partial USB implementation up on something where you have no documentation beyond picking someone else's spaghetti loops code apart.
I can see little difference, between what i put and what you have wrote.
If something works on one device, but not on another, when they use the same spec.
Then they must have interpretive the spec differently, which one interpretive the spec right, is a different matter.
The difference is in where the "fault" lies. A bit like the issue of certain keyboards not working on the Pi under Linux, which seems to be mostly a software issue on the Pi side, rather than an issue with the keyboards as such. If I have, say, 3 keyboards, /all/ of which work on every other machine I try, but which don't work using Linux on the Pi, it's hard to start pointing the finger of blame at the keyboard manufacturers (but we may end up erroneously pointing it instead at PSUs, or polyfuses, or whatever). In this case, it's probably not even an interpretation of HID boot that is causing the problem, but rather a (usually valid) assumption that there will be a more-or-less fully featured USB stack underneath the HID layer; something which CSUD doesn't even pretend to be (for the moment).

CSUD needs to be understood and accepted for what it is. "Buy another keyboard" is not a valid solution to what is almost certainly a software problem.

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking PI Input01 and 02

Fri Mar 01, 2013 12:46 am

markymarc35 wrote:in the tutorial input01 there is mention of the USB drivers that were done and that they would be available in the download section.

I cannot seem to find them ....
See here:
https://github.com/Chadderz121/csud
But theres also compiled vers in the full zips

@tufty, yes its software as in the firmware for the keyboards.
Anyone that has coded stuff like USB stacks, knows that you need to write them in such away as to gets around the different interpretation of the spec.
That's why linux had so many problems with USB in the beginning.
Just because you see this and that working 100% with all keyboards, does not mean that someone as not had to work around the different interpretation of the spec in code, i have and its a night mare for a single coder.

Easy example, take the PI firmware, your write code to boot your hobby OS and it works fine, than someone tries it with some newer firmware and it does not work, have you code your hobby OS wrong no.
To get around it you may make your kernel position Independent etc.
Batteries not included, Some assembly required.

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Baking PI Input01 and 02

Fri Mar 01, 2013 7:12 am

DexOS wrote:@tufty, yes its software as in the firmware for the keyboards.
Incorrect, Dex.

The HID boot documentation clearly states, and I quote:
On receipt of an 8-byte report on the Interrupt In endpoint, ...
...and, from the CSUD readme
Does not have interrupt transfers, limiting support severely
...
At present, only USB control transfers are supported by the hcd and usbd, which
is very limiting. Supporting interrupt transfers would be a major benefit, as
most devices require at least these two.
Alex knows where the problem is, but resolving it without hardware documentation is - ummm - "hard". CSUD is a major step forward, but it's not perfect yet.

markymarc35
Posts: 10
Joined: Tue Oct 02, 2012 11:09 pm

Re: Baking PI Input01 and 02

Fri Mar 01, 2013 12:24 pm

Thank you Dex

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking PI Input01 and 02

Fri Mar 01, 2013 9:16 pm

markymarc35 wrote:Thank you Dex
Your welcome and theres been some mouse support add too.

@tufty, you should also see theres implementation spec for
"Non-Boot Keyboard" so boot-keyboard is only a option.
Batteries not included, Some assembly required.

Return to “Bare metal, Assembly language”