usb keyboards not recognized on "Raspberry PI A+"

Think you found a bug? Report it here.
Ron
Posts: 21
Joined: Sun Mar 20, 2016 11:36 am

usb keyboards not recognized on "Raspberry PI A+"

Postby Ron » Fri Apr 01, 2016 11:18 am

I use 3 different Keyboards on "Raspberry PI B" (2 pieces) and on "Raspberry PI 2" and all working without a problem.
But at my "Raspberry PI A+" (new device) works none of the 3 keyboards.
I have attempts it with your demo "04-Keyboard Input" and with a newly created Project (tested several times).
The device "Raspberry PI A+" itself is in order, under "Raspbian" all 3 keyboards are recognized.
What am I doing wrong? Can you help me?

Many thanks in advance!
User avatar
Ultibo
Site Admin
Posts: 1895
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: usb keyboards not recognized on "Raspberry PI A+"

Postby Ultibo » Sat Apr 02, 2016 4:02 am

Hi, All of the example projects were tested on Raspberry Pi A+ (as well as B, 2B and 3B) and were working correctly including USB keyboard for example 04.

The only Raspberry A+ we have to test with won't be accessible for a couple of days, as soon as I have it back I will rerun all of the tests on it.

If you try with the demo image download, at the end of the demo it puts a logging window on the console. At this point you should be able to plug in or unplug a USB keyboard and it should report that on the logging window, if it does but shows as unrecognized then it could be an issue with the type of keyboard. If it doesn't report the keyboard being attached or detached then it might be an issue with the USB driver instead.

I do remember some discussion on the Raspberry Pi forums very recently about changing the firmware so that the Pi Zero could boot in USB device mode rather than host mode and I think the change would have also applied to the A+ if it went ahead.

When I get the A+ back I'll follow up further but if you have any extra info that would be great.
Ultibo.org | Make something amazing
https://ultibo.org
Ron
Posts: 21
Joined: Sun Mar 20, 2016 11:36 am

Re: usb keyboards not recognized on "Raspberry PI A+"

Postby Ron » Tue Apr 05, 2016 6:29 pm

Hi Admin,

Please excuse that I needed a few days to reply.
I wanted to write a unit to direct the display of status messages on the screen to a imagefile (ScreenShot).
Now I can show my error messages better. The results of my tests you can see on this website.

http://www.daleske.de/projekte/prog/12_ ... RPI_en.htm

But I can not see what the error is.
Could you help once more?

many thanks
User avatar
Ultibo
Site Admin
Posts: 1895
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: usb keyboards not recognized on "Raspberry PI A+"

Postby Ultibo » Wed Apr 06, 2016 1:20 am

Hi again, nice screenshots!

We have an RPi A+ again and I spent several hours yesterday looking into this, you'll be pleased to know that I get the same errors shown in your screenshot.

What I have found so far is that there are 3 issues when USB devices are connected directly to the USB port on an A+ (same would apply to RPi Zero as well), if you connect a hub to the A+ and then connect other devices like keyboards, mice and flash drives to the hub then everything works correctly.

The 3 issues are:
  1. The DWCOTG USB controller in the RPi does not set the connected change bit in the port status when a device is unplugged (it clears the connected flag but only sets the enabled change bit).
  2. When a full speed or low speed device (like most keyboards) is connected directly to the port on the RPi the USB controller does not support split transactions, even though the USB specification says that it should.
  3. When a device is disconnected from the port on the RPi the USB controller does not fail any outstanding requests to that device, those requests need to be cancelled instead.
Items 1 and 2 have been fixed by minor changes to the DWCOTG driver (thanks to the folks at FreeBSD for the answer to the second one), with these 2 fixes keyboards that are directly connected to the A+ now work correctly.

I am in the process of working out the details of the third issue and how to correctly cancel any outstanding requests when a device is unplugged, this was required anyway because some USB devices simply fail to respond if they are sent a request that is unsupported or invalid (both Linux and FreeBSD have a timeout mechanism for USB requests to prevent them hanging).

Once these are all tested I will push the changes to GitHub so you can try them out and confirm they work for you as well.

Thanks.
Ultibo.org | Make something amazing
https://ultibo.org
Ron
Posts: 21
Joined: Sun Mar 20, 2016 11:36 am

Re: usb keyboards not recognized on "Raspberry PI A+"

Postby Ron » Wed Apr 06, 2016 7:56 am

Hi,
many thanks for the quick processing of my inquiry. I am waiting for the update of GitHub.

post script:
I am working for several weeks with the "ultibo core" and still excited about this project. Many thanks to all who are involved in this project.
it's a great work, and it may be the use of single board computers (such as the raspberry pi) are fundamentally changing.
User avatar
Ultibo
Site Admin
Posts: 1895
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: usb keyboards not recognized on "Raspberry PI A+"

Postby Ultibo » Fri Apr 08, 2016 5:54 am

Hi,

The updates for this issue have now been posted to GitHub, see the announcement here viewtopic.php?f=4&t=67 for more details.

If you can test and confirm these changes that would be really great, thanks for reporting this one it is a very good issue to get resolved.

Ron wrote:I am working for several weeks with the "ultibo core" and still excited about this project.

I have been working with Ultibo core for just over 12 months now and I'm more excited about it every day. Even though I wrote every line of code so far I sometimes still find myself impressed with how well it all works. :o

Thanks again for your support.

PS. Any chance you might consider making your screenshot code available for download?
Ultibo.org | Make something amazing
https://ultibo.org
Ron
Posts: 21
Joined: Sun Mar 20, 2016 11:36 am

Re: usb keyboards not recognized on "Raspberry PI A+"

Postby Ron » Fri Apr 08, 2016 7:32 pm

problem solved :D

Hi Admin,

many thanks for the updates of ultibo core on GitHub and for solving the problem. I'v tested all my programs with
the update, and the keyboard has always been recognized. The keyboard was detected when it was directly connected to the raspberrypi and also when it ran through a hub.
I am very happy.

The Raspberry PI A+ is a good device to start bare metal programming with ultibo core.

PS. Any chance you might consider making your screenshot code available for download?


Yes, of course. But let me still revise the source code a bit.

Basically it works as follows:
- create a new function "FramebufferConsoleGetPixel(Console:PConsoleDevice;X,Y:LongWord):LongWord;" in console.pas to read a Pixel from Framebuffer
- read all Pixel in a MemoryStream
- convert the MemoryStream to TBitmap-Structure (in a new Unit "Graphics.pas")
- save the ScreenShot as Bitmap to the SD-Card
(more in some days)

Return to “Bug reports”

Who is online

Users browsing this forum: No registered users and 0 guests