fbergama / pigfx

PiGFX is a bare metal kernel for the Raspberry Pi that implements a basic ANSI terminal emulator with the additional support of some primitive graphics functions.
MIT License
278 stars 62 forks source link

USB keyboard feature not working. #66

Closed willtco closed 3 years ago

willtco commented 3 years ago

Downloading the latest PIGFX (as at Aug26th 2021) and USPI 2 - when compiled the pi is not responding to the keyboard inputs. 2 different pi(zero's) and 3 USB keyboards have been tried in various combinations with no effect. CIMG5322

chregu82 commented 3 years ago
willtco commented 3 years ago

I have not tried the pre-compiled binaries. The linked version of USPI I used has modules dated 19/05/20 17?/18:42.

There is no activity on the tx line (which is connected to a known good Z80). when reverting to a previous verision (2019) the keyboard works fine. here is a snapshot of my download dir showing the source's used.

Screenshot from 2021-09-03 14-12-17

If there is a complete pre-compiled kernel I will happily try it But it's important that I download and compile as I wish to modify some of the source code.

willtco commented 3 years ago

Have now downloaded and tried the precompiled - same result no keyboard action.

chregu82 commented 3 years ago

I just tested it with a Pi Zero (without W) using this image https://github.com/fbergama/pigfx/blob/master/bin/kernel.img I connected RX and TX on the Pi and was able to directly write to the screen with the USB keyboard. At the moment I have no idea why it would not work on your setup.

willtco commented 3 years ago

Thats fair enough, all I can say is that it works fine with my 2019 (unaltered) kernel but not with the latest. I'll do a bit more work and report back if I find/cure the problem. Meantime if you can think of anything that has changed and may be significant between 2019 and today it might help.

willtco commented 3 years ago

38.4K - here's a scope trace of what's on the TX line, looks like. It should be a square wave, but it's not being pulled low enough to register logic zero. It could be the TX pin is not properly configured tiup/dn or current capability. - As you can see the scope is set to DC with a x10 probe. Left hand marker is 0v. I get identical results from a second Pi.

CIMG5323

chregu82 commented 3 years ago

Ok I tried doing the same, still the mentioned (new) kernel image, 38400 baud, RX and TX connected together. TX is set to no pull up / no pull down, RX is set to pull up in uart.c. To me this looks absolutely fine. What's your load on the TX line? Do you have a scope of the old software version? It seems that you have some capacitive load on this line. signal-2021-09-04-204014 At least we now know that it's not a USB keyboard related issue.

willtco commented 3 years ago

It may be a few days before I can respond fully, but thanks for the trace & info - your comment about capacitance made me think about the Scope probe I was using, - it's now in the bin. with a second probe the waveform is fine. I need to now take a closer look at the rest of my system. I guess at nearly 70 I should turn my hand to gardening!.

chregu82 commented 3 years ago

You can set the behaviour of CR or LF in pigfx.txt.

willtco commented 3 years ago

Solved, - 3 problems, 1) a dud scope probe, 2) usb kbd appeared not working as there was no echo (2019 had echo?) - 3 I failed to spot CR had been replaced with an LF and I failed to notice it could be swapped in the config file. My thanks to Christian Lehner for pointing me in the right direction.

chregu82 commented 3 years ago

You're welcome. Not sure what you mean with echo. PiGFX should display what gets sent to the RX pin. So it's your system which should echo the characters it receives from the USB keyboard.