#Custom RP2040 Split Problems

18 messages · Page 1 of 1 (latest)

sturdy laurel
#

Hi, and thank you for your time. This might take a while ...

I am working on my second split design and am totally stuck with multiple problems mostly regarding split communication.
The special part is that each half has a joystick that i want to be switchable between analog (Gamepad) and digitial (press buttons on matrix).

A few problems to start:

  • Changing RGB Matrix animation does not sync to slave half
  • Saving the value of the joystick mode to EEPROM seems to not work (default after reset)
  • Indicator light of said toggle mode does not work on slave side
  • Plugging in the USB on right half flips reactive buttons (pressing key on right side makes left light up)

More things that do not work, but I have not really looked at:

  • Analog mode is not sent PC (not detected as controller maybe?)
  • Sending slave joystick data to master
  • ADC range seems to be off center

https://github.com/tstrube/qmk_firmware/tree/splittodogu/keyboards/splittodogu/2

GitHub

Open-source keyboard firmware for Atmel AVR and Arm USB families - tstrube/qmk_firmware

sage root
#

rgb animtions should just sync, you shouldn't need to enable anything other than setting how many leds are on each side. which you appear to have.

#

you also don't need firmware_format. if you have the processor and bootloader set to rp2040, it should handle that automatically

#

but for the rgb, if it's not syncing correctly, my guess is that the split comms is having issues (not fast enough, connection issue, etc). And you may want/need to enable debugging to get a better idea of what is going on

#

Eg, #define SERIAL_DEBUG, enable console, and set debug_enable = true somewhere

#

Saving the value of the joystick mode to EEPROM seems to not work (default after reset)
Are you reading the mode during init? If not, you need to, as userspace/keyboard eeprom settings are NOT automatically applied

#

oh, wait, you're reading from an arbitrary address.... you can't just do that. And you're likely triggering a reset of the eeprom in general

#

you should use the kb or user functions for this (and a struct)

#

if you switch to the linked config, that should/will work

#

Indicator light of said toggle mode does not work on slave side
Code has to run on both sides, and the indicator setting would need to be synced between both sides.

Eg, the rgb sync doesn't sync the LED array, but rather syncs the config (mode, hsv, speed, flags), and syncs a software timer. That information is used to run the animation and indicrtor code.

#

so if you have custom settings, you need to use the custom data sync. And using a struct for the eeprom settings makes things simple, since you can sync that too

#

Plugging in the USB on right half flips reactive buttons (pressing key on right side makes left light up),
If you aren't defining handedness or are using master left/right, then this will happen. No define == master left. And both the master left and master right means that the side that the USB is plugged into is the left/right side. Plugging in the wrong half will flip things

sturdy laurel
#

Oh wow, I did not expect such an in depth answer. Thank you for looking through my code and your comments, it helps a lot. I will work on the eeprom and serial communication (key presses and modifier work fine) tomorrow.

but one follow up regarding the master. i have a handedness pin, which works as expected. i was planning on having the possibility to use either side as master, since this keyboard can be used as macro pad (one half). is it not possible to have "dynamic" master?

sage root
#

welcome.

#

master isn't the same as handedness. They're two separate concepts, but some of the handedness is based on which master (usb) detection

#

and split pin is one of the ones that works no matter which side is plugged into usb, provided that one side is wired high, and side is wired low