2025-05-30 10:40 AM - last edited on 2025-05-30 10:45 AM by mƎALLEm
Hey all,
I’m working on integrating a PS/2 trackball into a custom PCB using QMK, and I’ve hit a weird snag. My MCU is an STM32F072 (custom PCB, project repo here: https://github.com/vuckale/takt11800/tree/master/Firmware. I’m following the official https://docs.qmk.fm/features/ps2_mouse and using the “interrupt” version for the mouse interface.
Here’s the issue:
- Sometimes after flashing, the trackball works perfectly.
- If I unplug and plug the keyboard back into the PC, the trackball usually stops working. Sometimes after multiple re-plugs or after waiting a while, it comes back, but it’s super inconsistent.
I’ve tried:
- Different pin combos for clock/data (B3/A15, A0/A1, B10/B11)—all with 4.7k pull-ups to 5V except A0/A1 which are not 5V tolerant and I pull them up with 10k resistors to 3.3V.
- If I add #define PS2_MOUSE_USE_REMOTE_MODE in config.h, then the trackball is detected every time after replug… but the cursor goes crazy—jumps around the screen, and left/right click events randomly fire by themselves.
What’s really odd:
I’ve implemented almost the same code on a Blackpill STM32 (STM32F103) https://github.com/vuckale/compaq_mx_11800_qmk_via/tree/main/handwired and it works perfectly every time with the same kind of trackball.
Would love any troubleshooting tips, especially from anyone who’s gotten a QMK PS/2 mouse reliably working on STM32F0 series. I know this might not be the best place to ask since it’s pretty technical, but the folks at the QMK forums haven’t been able to help, and at this point I suspect it might be more of a hardware/electrical issue than just firmware. Any ideas are welcome!
Thanks in advance!
Trackball in question: https://imgur.com/a/Ejsuc9h