rgoulter / keyboard-labs

Repo with my PCB designs and keyboard firmware
136 stars 11 forks source link

Unable to compile firmware, qmk want a defined matrix and keyberon gives generic errors #6

Closed definitely-not-a-t-rex closed 2 years ago

definitely-not-a-t-rex commented 2 years ago

I built the first half of the mini f4_36 keyboard and have the parts ready for the second one and I wanted to try and building the firmware first, I tried building both qmk and keyberon but neither works, qmk wants me to define a matrix (which makes no sense as the keyboard has a pin per key) and keyberon gives me a generic error. I don't know what to try anymore, I tried 10+ times starting from scratch with qmk, how did you get yours to work?

rgoulter commented 2 years ago

Ah, I'm sorry for the bad experience.

The qmk directory in this repository has drifted out of sync from the code I use.

For QMK, I like to keep my code on the rgoulter-keyboards-and-layouts branch in rgoulter/qmk_firmware. https://github.com/rgoulter/qmk_firmware/tree/rgoulter-keyboards-and-layouts (Though, do note that I have no qualms about rebasing + force-pushing this branch; but at the same time, I don't often fetch the latest qmk/qmk_firmware's develop).

It's almost certainly going to be easier to go with QMK tbh.


In terms of the Keyberon firmware.. I use nix, and just run nix build .#keyberon-firmware-uf2. Perhaps this doesn't work outside of NixOS though.

The other instructions in the readme describe setting up the cargo toolchain. https://github.com/rgoulter/keyboard-labs/tree/master/firmware/keyberon#prerequisites which are essentially the same instructions as for the keyberon-f4 https://github.com/TeXitoi/keyberon-f4

definitely-not-a-t-rex commented 2 years ago

Ah, I'm sorry for the bad experience.

The qmk directory in this repository has drifted out of sync from the code I use.

For QMK, I like to keep my code on the rgoulter-keyboards-and-layouts branch in rgoulter/qmk_firmware. https://github.com/rgoulter/qmk_firmware/tree/rgoulter-keyboards-and-layouts (Though, do note that I have no qualms about rebasing + force-pushing this branch; but at the same time, I don't often fetch the latest qmk/qmk_firmware's develop).

It's almost certainly going to be easier to go with QMK tbh.

In terms of the Keyberon firmware.. I use nix, and just run nix build .#keyberon-firmware-uf2. Perhaps this doesn't work outside of NixOS though.

The other instructions in the readme describe setting up the cargo toolchain. https://github.com/rgoulter/keyboard-labs/tree/master/firmware/keyberon#prerequisites which are essentially the same instructions as for the keyberon-f4 https://github.com/TeXitoi/keyberon-f4

I tried using this one with msys after deleting the old folder with qmk setup rgoulter/qmk_firmware but it doesn't like it and gives me errors Cloning into '/c/Users/ange9/qmk_firmware/lib/chibios'... Cloning into '/c/Users/ange9/qmk_firmware/lib/chibios-contrib'... Cloning into '/c/Users/ange9/qmk_firmware/lib/googletest'... Cloning into '/c/Users/ange9/qmk_firmware/lib/lufa'... Cloning into '/c/Users/ange9/qmk_firmware/lib/printf'... Cloning into '/c/Users/ange9/qmk_firmware/lib/ugfx'... Cloning into '/c/Users/ange9/qmk_firmware/lib/vusb'... Submodule path 'lib/chibios': checked out '313416b8fda90d9973a749a0a35970956852c286' Submodule path 'lib/chibios-contrib': checked out 'e3a3a24047717af33b098266e11c2e4e5102206a' Submodule path 'lib/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780' Submodule path 'lib/lufa': checked out 'ce10f7642b0459e409839b23cc91498945119b4d' Submodule path 'lib/printf': checked out 'd3b984684bb8a8bdc48cc7a1abecb93ce59bbe3e' Submodule path 'lib/ugfx': checked out '40b48f470addad6a4fb1177de1a69a181158739b' Submodule path 'lib/vusb': checked out '9a42d205eb60faca494ff4eabce8d59f0ec0fc7f' Ψ Successfully cloned https://github.com/rgoulter/qmk_firmware to C:/Users/ange9/qmk_firmware! Ψ Added https://github.com/qmk/qmk_firmware as remote upstream. Error: %s: %s ('ImportError', ImportError("cannot import name 'format_ansi' from 'milc' (C:/QMK_MSYS/mingw64/lib/python3.10/site-packages/milc/__init__.py)")) Traceback (most recent call last): File "C:/QMK_MSYS/mingw64/lib/python3.10/site-packages/qmk_cli/script_qmk.py", line 76, in main import qmk.cli # noqa File "C:/Users/ange9/qmk_firmware/lib/python/qmk/cli/__init__.py", line 13, in <module> from . import doctor File "C:/Users/ange9/qmk_firmware/lib/python/qmk/cli/doctor.py", line 13, in <module> from qmk.questions import yesno File "C:/Users/ange9/qmk_firmware/lib/python/qmk/questions.py", line 4, in <module> from milc import cli, format_ansi ImportError: cannot import name 'format_ansi' from 'milc' (C:/QMK_MSYS/mingw64/lib/python3.10/site-packages/milc/__init__.py)

I have no idea on how to select branches from msys as [ange9@Mjolnir ~]$ qmk setup rgoulter/qmk_firmware/tree/rgoulter-keyboards-and-layouts ☒ Could not find qmk_firmware! Would you like to clone rgoulter/qmk_firmware/tree/rgoulter-keyboards-and-layouts to C:/Users/ange9/qmk_firmware? [y/n] y Cloning into '/c/Users/ange9/qmk_firmware'... fatal: repository 'https://github.com/rgoulter/qmk_firmware/tree/rgoulter-keyboards-and-layouts/' not found ☒ git clone exited 128 seems broken

don't know where to bash my head against anymore, I thought building the actual kb would be the hardest part, it's my first attempt and I'm probably making some dumb mistake with github, msys or both but I really don't get why it has to be so convoluted. I really liked your idea of a split kb with everything you could ask for while remaining very small tho.

rgoulter commented 2 years ago

I have no idea on how to select branches [with qmk]

Check qmk setup --help.

Which Which would suggest:

qmk setup --branch rgoulter-keyboards-and-layouts rgoulter/qmk_firmware

I don't think qmk is smart enough to set this up properly if qmk setup has run with a different branch; though you can use the --home argument to change where it sets it up, and then run qmk from that directory.

I'm probably making some dumb mistake with github, msys or both

A lot of programming stuff works better with Linux or macOS than Windows. MSYS is a way of having an environment in Windows that works similar to a Linux system.

The problems you're facing are related to git. -- Git's a notoriously difficult tool, but is also widespread & popular, since it's good enough at doing what it does.

The qmk command itself tries to be a nice and friendly program so that you don't have to know about these details. Which is nice when it works, but rather opaque when it doesn't work.

In this case, I've got the code on some branch on some other repository. But, because qmk setup isn't being run with both the right fork / branch, it's not finding the code.

In qmk_firmware, you'll want git remote -v to mention https://github.com/rgoulter/qmk_firmware.git, and git branch to have * rgoulter-keyboards-and-layouts.

Then the compile command is qmk compile --keyboard rgoulter/x_2/rev2021.1/blackpill_f401 --keymap rgoulter.

I really don't get why it has to be so convoluted.

This one's partly my fault. If I'd shared my code with qmk/qmk_firmware, it would 'just work' with the MSYS setup that QMK provides. -- Though, my latest experience sharing code with qmk/qmk_firmware has been "no response for months, & my code doesn't get accepted", so I'm not keen on interacting with qmk/qmk_firmware. :shrug:

definitely-not-a-t-rex commented 2 years ago

In qmk_firmware, you'll want git remote -v to mention https://github.com/rgoulter/qmk_firmware.git, and git branch to have * rgoulter-keyboards-and-layouts.

I have no idea what it means but I guess it references your command

qmk setup --branch rgoulter-keyboards-and-layouts rgoulter/qmk_firmware

This one's partly my fault. If I'd shared my code with qmk/qmk_firmware, it would 'just work' with the MSYS setup that QMK provides. -- Though, my latest experience sharing code with qmk/qmk_firmware has been "no response for months, & my code doesn't get accepted", so I'm not keen on interacting with qmk/qmk_firmware. 🤷

they don't seem the easiest os project to work with, can't really blame you for that.

Then the compile command is qmk compile --keyboard rgoulter/x_2/rev2021.1/blackpill_f401 --keymap rgoulter.

THIS ONE FINALLY WORKED (with minif4_36 and rev2021.5), THANK YOU SOOO MUCH I have to figure out which keymap I like and everything else but I have a flashable file and my keyboard won't be a brick for much longer, I really appreciate your help, thank you again!