Spontaneous numlock - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111) +--- Forum: General Discussion on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=112) +--- Thread: Spontaneous numlock (/showthread.php?tid=13576) |
RE: Spontaneous numlock - dsimic - 04-20-2021 As @slyecho noted above, it would be advisable to try flashing the reverse-engineered version of the keyboard firmware. Even if you end up with using 50% of the available writes (four out of eight), it would be worth a try, IMHO. Edit: I would strongly suggest that you try using "showkey -s" and "showkey -k" on a virtual console to capture the scan codes and keycodes, respectively, for the troublesome Fn keys. Then, we can compare those codes with the ones recorded for the same keys on my PineBook Pro. RE: Spontaneous numlock - ab1jx - 04-20-2021 I'd already done the showkey thing, and dumpkeys, and something else similar. Anyway this is all Fn-NumLk. Code: kb mode was UNICODE RE: Spontaneous numlock - dsimic - 04-21-2021 Below are the scan codes returned by "showkey -s" on my PineBook Pro, for pressing and releasing Fn+NumLock a total of three times (more precisely, for keeping Fn pressed, and pressing and releasing NumLock three times, but I also tested the "full-fat" version of pressing Fn, pressing NumLock, releasing NumLock and releasing Fn, and as expected there was no difference in the scan codes): Code: 0x9c Somehow, the press scan codes (0x45 vs. 0x46) and release scan codes (0xc5 vs. 0xc6) for Fn+NumLock seem to be off by one on your keyboard. However, the release scan code (0x9c) for Enter seems to be correct. RE: Spontaneous numlock - ab1jx - 04-21-2021 Another wacky thing is that Fn Priint Screen and Pause have the same scan code. The F7 one for turning off the touchpad really turns off the touchpad, and Fn-F8 insert really works. This is holding down the Fn and going through F1 through Power. Esc/Z tries to suspend but it's not set up. Code: kb mode was UNICODE But again the only reason I noticed this was that 3 times my num lock got turned on and pressing Fn-NumLk didn't turn it off, it's on 2 other keys instead. RE: Spontaneous numlock - KC9UDX - 04-21-2021 Reported earlier, the "unshifted" F keys are correct. It's only when they are "shifted" with Fn that they are wrong. This is why I suggest it has to be the firmware. Unless there's another level of abstraction between the microcontroller in question and the physical switches, there can be nothing wrong with the keyboard, or the "unshifted" keys would be wrong. RE: Spontaneous numlock - ab1jx - 04-21-2021 Anybody run this hex code through a disassembler? http://plit.de/asem-51/dis51.html Well ok, it disassembles to 95 k bytes, too much to post here. Try it. Just a sample: Code: L0358: 8051 instruction set summary http://ww1.microchip.com/downloads/en/DeviceDoc/doc0509.pdf RE: Spontaneous numlock - dsimic - 04-21-2021 It would take a lot of time to go through that much assembly code, with questionable end results because no datasheet is available for the keyboard controller. I'll look into the source code of the firmware update utility and see if it's possible to implement an option to read the current firmware and save it to a file. That would allow a much better insight into the "untouched" and troublesome keyboards. RE: Spontaneous numlock - ab1jx - 04-21-2021 Possibly, about half of it is just DB statements defining constants though. If you do a grep -v DB there's 47K left. The sh61f63 datasheet says "instruction set compatible with standard 8051". It might be possible. I don't have an untouched one to look at. I was trying to see if it was possible that it only works with 16 k chips and not 14 k. But there's a #define MAX_BINLEN (14*1024) in there. Looked like it read back and checked the touchpad code more than the keyboard code though. RE: Spontaneous numlock - KC9UDX - 04-21-2021 That's a ton of code for a keyboard and touchpad! I'm wondering, if this is on the main board, how is it proprietary to the keyboard and touchpad? I wish I had time; it shouldn't be terribly difficult to reverse engineer the whole works and write new firmware from scratch. But then, I'd rather not get my head into 8051... RE: Spontaneous numlock - ab1jx - 04-21-2021 The pbp has how many usb busses and hubs? And only 2 for the user. Try lsusb -v. Somebody said earlier in this thread that it's on the mainboard right next to something. From dsimic: "According to page 20 of the PineBook Pro schematic, the SH68F83Q IC is located on the main board. The schematic puts it behind the J6 connector (#7 in the picture), which receives the keyboard's ribbon cable." Sounds like a job for hexcmp. Windows only I think but it might work under WINE. https://duckduckgo.com/?q=hexcmp&t=fpas&iar=images&iax=images&ia=images I think disassembling both and feeding them into diff would be better, that way the differences are in assembly, not hex. Diff is used to make source code patch files. |