#RP2040-zero split keyboard Full-duplex target connected but slave only sends encoder keys

96 messages · Page 1 of 1 (latest)

frank hawk
#

I am trying to flash my split keyboard, rp2040-zero in both halves. Each with one encoder. Physically Rx-Tx of each half are connected (confirmed as it works using KMK and RMK).
However, split connection does not happen with the following:
I get

SPLIT: receiving handshake failed
Failed to execute slave_matrix
Target disconnected, throttling connection attempts

rules.mk

MCU = RP2040
BOOTLOADER = rp2040
SPLIT_KEYBOARD = yes
SERIAL_DRIVER = vendor
ENCODER_ENABLE = yes
CONSOLE_ENABLE = yes

config.h (Changing master_left and right accordingly)

#define MASTER_LEFT
/* #define MASTER_RIGHT */

#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_USART_TX_PIN GP0  / Tx from rp2040
#define SERIAL_USART_RX_PIN GP1  / Rx from rp2040
#define SPLIT_USB_DETECT
#define SERIAL_DEBUG
#define SPLIT_WATCHDOG_ENABLE

Funny thing is I get target connected with following config:
However, when connected, the slave does not send keys from matrix but only the encoder actions (VolUp, VolDown):

rules.mk

MCU = RP2040
BOOTLOADER = rp2040
SPLIT_KEYBOARD = yes
SERIAL_DRIVER = vendor
ENCODER_ENABLE = yes
CONSOLE_ENABLE = yes

config.h (Changing master_left and right accordingly)

#define MASTER_LEFT
/* #define MASTER_RIGHT */

#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_USART_TX_PIN GP1  / Rx from rp2040 (used as Tx ?)
#define SERIAL_USART_RX_PIN GP0  / Tx from rp2040 (used as Rx ?)
#define SPLIT_USB_DETECT
#define SERIAL_DEBUG
#define SPLIT_WATCHDOG_ENABLE
vital stag
#

Tried decreasing the uart speed?

frank hawk
#

Tried, but none of the speed makes a difference.

earnest tulip
frank hawk
# earnest tulip What do you mean by "changing master_left and right accordingly"? The option nee...

I mistakenly read somewhere it was needed to be defined by each halve. However, it still does not work
Both halves wont connect with this:

#define MASTER_LEFT

#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_USART_TX_PIN GP0  / Tx from rp2040
#define SERIAL_USART_RX_PIN GP1  / Rx from rp2040
#define SPLIT_USB_DETECT
#define SERIAL_DEBUG
#define SPLIT_WATCHDOG_ENABLE

And still I get target connected with this, but the slave only send the encoder actions not the matrix keys:

#define MASTER_LEFT

#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_USART_TX_PIN GP1  / Rx from rp2040 (used as Tx ?)
#define SERIAL_USART_RX_PIN GP0  / Tx from rp2040 (used as Rx ?)
#define SPLIT_USB_DETECT
#define SERIAL_DEBUG
#define SPLIT_WATCHDOG_ENABLE
echo panther
#

I do have a question that is probably unrelated to your issue

#

did you use single slashes for the comments?

#

since these are macros, it is probably better to use /* comment */

#

also

#

normally you should be able to flash the same firmware to both sides of your split keyboard

#

the #define MASTER_LEFT tells the keyboard that the side plugged into USB must be the left side

frank hawk
#

I dont have the comment in my actual files. Just put them here.
Still nothing is working. It works in kmk and rmk, so it should not be a wiring problem. Dont know what else to do.

echo panther
#

if you compiled separate firmware for each side of the keyboard, do they have the same keymap?

vital stag
#

wait, do you have it wired tx <--> rx?

#

if not, you need:

#define SERIAL_USART_PIN_SWAP
#

also, might be worth trying with:

#define SERIAL_USART_SPEED 115200

or lower

frank hawk
frank hawk
earnest tulip
#

This is a long shot, but are you using a custom matrix implementation by any chance?

frank hawk
#

No, i am not using a custom matrix. Just regular col2row scan.

earnest tulip
#

I don't see anything wrong with your config, could you post the full setup somehow, maybe in a repo?

vital stag
#

have LTO enabled?

frank hawk
frank hawk
vital stag
#

does it work fine if you use mainline qmk, and not vial's fork?

earnest tulip
#

I think its a problem with the layout, none of the right half keys appear in it? It's incorrectly formatted for split keyboards, the right half sits below the left half in the matrix

vital stag
#

yeah, that too

#

compile it, and look at the default_keyboard.h file that it generates

#

that should have 8 rows, and only a handful of XXX in those spots

#
#define LAYOUT(k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0J, k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1J, k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2J, k3C, k3D, k3E, k3F, k3G, k3H) { \
    { k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0J }, \
    { k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1J }, \
    { k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2J }, \
    { XXX, XXX, k3C, k3D, k3E, k3F, k3G, k3H, XXX, XXX }, \
    { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \
    { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \
    { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \
    { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \
}
#

yeah, layout is wrong

#

left would work, right wouldn't

#

@frank hawk reformat the layout macro so it's like this ^

earnest tulip
#

@frank hawk Try something like this, it's too long for me to post in chat directly without nitro 🙁

frank hawk
frank hawk
earnest tulip
#

The layout was definitely wrong but apparently not the only part. Do both encoders still work?

vital stag
frank hawk
vital stag
#

do you have bare controllers

#

and to make sure, you're compiling from the main qmk repo?

frank hawk
earnest tulip
earnest tulip
#

Are you flashing the VIAL keymap or the default one?

frank hawk
#

either defalut or vial is the same result.

#

compiling from the QMK git repo or from vial repo, does not make a difference either.

earnest tulip
#

And just to be sure, when you're switching from the normal keymap to the VIAL keymap you're always flashing both halves again?

#

Normally you don't need the same keymap on both halves, but using a VIA/VIAL keymap changes the transport options so at the very least both halves need to be on the same page about that

frank hawk
earnest tulip
#

Here's the updated vial.json, since that needs to be updated also (might need to take a look at the encoder section, don't know how to configure those properly):

frank hawk
#

Let me try

earnest tulip
# frank hawk Let me try

If it didn't work with the default qmk after updating the layout then there's something else going on that the json won't fix, but if you tested with the vial keymap then maybe

frank hawk
#

No, it did not work. still no connection between halves.

#

It does no seem to be a layout problem.

earnest tulip
# frank hawk please see this

Well yes, that would be expected with the previous layout definition, as it had all right half keys marked as empty positions, so only the encoders would get synced. The config.h looks fine.

frank hawk
#

But if i put TX as GP0 and RX as GP1, the halves never connect, even with the new layout definition.

earnest tulip
frank hawk
#

so i have to remove the MASTER_LEFT declaration?

earnest tulip
#

You'll have to replace it with another handedness option, the easiest would likely be EE_HANDS

frank hawk
#

Ok ok, I will try.

earnest tulip
#

The first time you flash each half with the EE_HANDS config, make sure to use the -bl flag correctly

#

In this case it would be qmk flash -kb sweek -km vial -bl uf2-split-left

#

Though I haven't checked vial just yet

frank hawk
#

I have compiled vial with github actions setting #define EE_HANDS, want the uf2?

#

Ooh no, sorry i compiled only the default keymap. Then ill test once i arrive home.

earnest tulip
earnest tulip
frank hawk
#

would this work make sweek:vial:uf2-split-left make sweek:vial:uf2-split-right ?

earnest tulip
#

Yes, though compilation takes forever for me, the -j flag doesn't seem to work

frank hawk
#

No luck, Same thing: Setting TX = GP0 RX=GP!, halves never connect. Setting TX=GP1 RX=GP0, halves connect but slave never send keys from matrix only encoder action.

vital stag
#

what rp2040 are you using?

#

pics?

frank hawk
#

rp2040-zero clone.

earnest tulip
#

Interesting, I was using a couple pico clones (not the zero though) when testing and it worked fine. Could you maybe flash this config, using the vial-qmk fork and vial keymap? That's the specific config that worked for me

#

And maybe send a uf2 that I could flash?

frank hawk
#

fuckin hell compiled with your files and it worked.

earnest tulip
#

Oh huge

frank hawk
#

I compiled with qmk git. Let me try vial

earnest tulip
#

I tested vial as well, the configuration worked for me

#

I couldn't test the encoders though

frank hawk
#

Oh vial is not working. halves do not connect.

#

dude I dont know what the fuck was going on. I did a clean build with your config files and all of the sudden vial also works. Many times I did a clean flash and none of my config worked.

earnest tulip
#

Well, I'd recommend an exorcism for your PC then, but I'm glad it works 🙂

#

Also looking at the VIAL docs I think that encoder_map is needed? Not entirely sure though, if yes then that needs to be added still

frank hawk
#

Yeah i will fix details on the encoder and layers and more, I just wanted to make it work first.

#

Thanks a lot!! I still do not know what was different.

vital stag
#

qmk clean -a is sometimes a good idea

#

it cleans all of the build artifacts which can sometimes cause weird issues

#

sometimes the generated files don't get regenerated correctly

frank hawk
#

Yeah i was doing that all the time. But my guess is that having two rules.mk was causing issues, one at keyboard level and one at keymap level. The files that vermilion shared only have one rules.mk at keymap level

vital stag
#

multiple rules.mk files won't affect things, unless one is turning off something it shouldn't. lord knows if that was a problem, none of my keymaps would ever compile (kb level, keymap level, userspace level, and module level, plus post_rules.mk at most of those levels too)

#

if anything, it may be that the cleaned up version from vermilion doesn't have some problematic setting that we've missed.