#Attempting to put a Shift Register on a Xiao Plus
1 messages Β· Page 1 of 1 (latest)
This is where having a local (docker) dev environment really helps.. you have all the build artifacts so you can trace where along the way the chain broke.
There are a bunch of temp files (especially the .config under build/zephyr/.config iirc)
In this case.. a linker error.. so the c file compiled, so the header did offer up the symbol, but the matching implementation (C) file is missing. I had similar, had to look at the appropriate CMakeLists.txt, the C file would be protected by a CONFIG_* variable I missed.. rinse and repeat.. (which is also way easier on a local setup)
But __dts* is some generated device from the device tree.. Zephyr is an absolute magic at C preprocessor, so hard to guess, but maybe thats enough of a clue?
Thats me going off 'first principles'; somebody knowing more about ZMK code..
Indeed, it looks like CONFIG_SPI isn't enabled
You can check in this file https://github.com/WainingForests/ZMK-XIAOv4-SR/actions/runs/13175254915/job/36773049834#step:12:18
Still doing it π¦ https://github.com/WainingForests/ZMK-XIAOv4-SR/actions/runs/13195802994/job/36836846902#step:11:360
I have SPI enabled in a couple of places.
It's now currently based on this:
https://github.com/WainingForests/ZMK-XIAOv4-Std/
Which builds fine. The only changes are the addition of the shift register. Which is based off the working code here: https://github.com/WainingForests/ZMK-XIAOv4-SR/tree/Working-No-studio-support
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 3)>,
<NRF_PSEL(SPIM_MOSI, 1, 5)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 3)>,
<NRF_PSEL(SPIM_MOSI, 1, 5)>;
low-power-enable;
};
};
};
&spi0 {
status = "okay";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
shifter: 595@0 {
compatible = "zmk,gpio-595";
status = "okay";
gpio-controller;
spi-max-frequency = <200000>;
reg = <0>;
#gpio-cells = <2>;
ngpios = <8>;
};
};
and then the swap of the pinouts for columns:
&kscan0 {
col-gpios // SR 0-7
= <&shifter 0 GPIO_ACTIVE_HIGH>
, <&shifter 1 GPIO_ACTIVE_HIGH>
, <&shifter 2 GPIO_ACTIVE_HIGH>
, <&shifter 3 GPIO_ACTIVE_HIGH>
, <&shifter 4 GPIO_ACTIVE_HIGH>
, <&shifter 5 GPIO_ACTIVE_HIGH>
// , <&shifter 6 GPIO_ACTIVE_HIGH>
// , <&shifter 7 GPIO_ACTIVE_HIGH>
;
};
boards/shields/skreecustom/skreecustom.conf is not read by the build process. I would put it in boards/shields/skreecustom/Kconfig.defconfig next to config ZMK_SPLIT like
config SPI
default y
boards/shields/skreecustom/skreecustom_left.conf and ..._right.conf would also work
Okay! I thought non-left/right .conf basically acted as a 'on both' and then left/right.conf was 'specifically on this build'
I originally had the boardname.conf in the config file
Gotcha! I'll give it a go thanks so much!
IIRC boards/shields/<name>/<name>.conf has higher priority and can't be overridden by users in config/<name>.conf
Yep! That got it to build!
I've spent quite a bit of time arguing with the build recently.. two useful tricks (on a local build) to see if a config variable is on/off and why..
- build/zephyr/.config contains all the config variables merged from all the sources
- if you add
-t menuconfigto your build command, you can then search for the symbol. It lists where the symbol gets turned on (i.e. filename of the source config file)
Common mistakes I had made myself..
- if you duplicate an Kconfig option, it overrides the imply/select from the original file, missing things like imply SPI or imply USB..
- imply is better then select (keeps dependencies), but.. it can also not actually turn on the option (then you need the menuconfig to track down the conflicts that ignore the imply)
- select turns on options without dependencies..
And sooo many more π
I've been doing a 'novel' thing and creating bunch of SHIELD_* config options.. that way my top-level config only needs one bool option to turn on the whole set:
https://github.com/vpaprots/zmk-config/blob/main/boards/shields/ferne/Kconfig.shield
Now I 'just' need to get dual trackball working, spying on @fast ether π
I don't know if this still works but it should.
Wylder had a couple dual trackball ZMK builds.
Configs for Nice!Nano and associates. Contribute to WainingForests/zmk-config-nano development by creating an account on GitHub.
oh.. the repos you had showed me helped me a bunch!
I can't use inorichi's driver because he refers to symbols only available to the central half.. but badjeff did seem to have taken care of all of that! (i.e. you cant use inorichi's driver on the periferal). It also doesn't seem to support all the 'input processor' stuff that recently dropped.
I actually threw up my hands.. after a month (or more now??) of the screen and trackball just not working.. I splurged for an osciloscope! finally a valid excuse to get me one of those π SDS804X..
few hours with it.. turns out.. my sck and my mosi were swapped at the jst connector, GRR! now the device initialized in the debug log!
The screen!? also oscilloscope.. noticed reading the SHARP datasheet that the CS line is actually ACTIVE_HIGH (i.e. the referse of the trackball!!?? even more reason you cant have it on the same SPI bus)
Your repo you showed me did have the screen set up correctly, I was just too blind to notice.
Screen works.. trackball.. dunno.. did a lot of refactoring.. might have missed something
This is what I saved as reference: https://github.com/Cyboard-DigitalTailor/zmk-keyboards/tree/main/boards/shields/imprint
That was awesome reference!! have the files open in multiple tabs π
Is there no more driver configuration stuff for the trackball?
What are you looking for? The driver itself will have some options: https://github.com/badjeff/zmk-pmw3610-driver/blob/main/Kconfig
Right, just wasn't sure where the configuration for them went. But this is the new input processor that I'm not used to
Looks like enabling it is in the defconfig and then dtsi handles xy rotation and stuff.
Oh, I mean you can do some of these either on the driver or with input processors
Just simple inversions etc.
I'm just now trying to get up to speed on the new input processor and studio at the same time. Didn't think I'd have this much trouble relearning things but boy am I!