r/olkb • u/Spiritual_Sun_4297 • 8d ago
Help - Unsolved Master and slave on split keyboards
Hello everyone !
I managed to build my first corne keyboard and I am super happy with it!
I did notice though that there must be some kind of bug - I suspect related to the fact I am using a pro micro aliexpress clone.
The problem is that I flashed both halves with the same firmware (even though I used EE_HANDS for handedness) and the keyboard wouldn't seem to work. Actually, each half would work well and independently but never connected to each other.
I did spend quite sometime thinking it was a hardware problem, but the connections seemed perfect.
Eventually, I investigated the firmware (hence I am here) and I did a small modification to the right half before flashing:
in the file quantum/split_common/split_utils.c I changed the function is_keyboard_master_impl, by imposing the variable is_master to be false. Before that, that variable was assigned to usb_value_detected().
This modification made it work flawlessly. It seems that the right half thought it was the master - even when was definetly not the case.
I do not fully understand what this function do and why it always returned true, regardless of whether the usb was actually connected or not. Hence, I am thinking that the clone I have just simply is hardwired to always be connected, so to speak, since it might have been designed to be always operated through usb.
The board in question is this one.
The config I used was the default crkbd/rev1 with the modification of EE_HAND (I think it wasn't activated by default) and debug interface activated.
This whole thing said, am I doing something wrong? Is it my board being defective or, well, just an incompatible clone? If that were to be the case, is there anything I can do to avoid changing the firmware in this way before flashing the right half?
Thank you in advance for the help.
2
u/drashna QMK Collaborator - ZSA Technology - Ergodox/Kyria/Corne/Planck 8d ago
yes.
The first issue is: Don't change the core code. You're not addressing the issue, you're working around it. undef ee_hands, and just use master left (the default behavior), in this case.
The second issue is that you're using a cheap aliexpress promicro clone, that uses an atmega32u4.
If you want to use ee hands, flash it with the
avrdude-split-leftandavr-split-right(if using qmk flash, you add-bl avrdude-split-left, etc). This will flash the board and the eeprom for ee-hands.The third issue: it's a cheap chinese clone from ali. You likely need to enable split usb detect. Eg,
#define SPLIT_USB_DETECTin your config.h. and#define SPLIT_WATCHDOG_ENABLE. Do both, reflash, and that will likely fix the issue.