FreeBSD build support

I’ve spent a couple days a while ago getting everything to build properly on FreeBSD, and have been using this toolchain for about a month now without issue on both Linux and (primarily) FreeBSD.

If you’re interested, the fruits of my labor are available at github. There’s a PR in the main repo for it, and I’ve updated the wiki as well.

If you’ve got a FreeBSD box to test this stuff on I’d appreciate it. Particularly the install instructions, since a lot of that is from memory and may be incorrect.

As a side note: it felt a little weird to update the wiki with the instructions. I know it’s a wiki, but it still felt like I was being presumptuous. Was it ok to add the documentation there, or is there a better channel to go through for getting stuff put in?

3 Likes

I think the Wiki is the perfect place for it, and updating it was the right call. Thank you!

This is probably old news, but Freebsd ports change the arudino support to remove board-manager. (For reasons that appear dumb to me). So it won’t be possible to build on FreeBSD via ardunio. It would be nice to have a command line version. to complie/flash from freebsd. Its possible I could submit a PR against FreeBSD to get the port fixed. (The didn’t want extra compiler tool sets being installed, as far as I can tell, so the disabled board manager and library manager) There is no make/port option to re-enable those, which is probably what I’d make as a PR

The instructions I put on the wiki were for CLI building. I think I may have used the Arduino IDE to build the firmware once, just to see how it works, but I find Makefiles and the command line tools easier to work with, so that’s what I used.

You still need arduino-builder, I think, as part of the general firmware build process, but AFAIK all the required code lives in the Kaleidoscope git repositories, so the board-manager shouldn’t be required, provided you’ve got avr-gcc somewhere.

All that said, since I’ve moved back to Linux full-time, I haven’t tried a build on FreeBSD in some months, so I’m not sure if anything’s broken.

Did you need to do anything special just to use this under FreeBSD? I plugged the keyboardio in, and I see it in dmesg:

uhub2: 21 ports with 21 removable, self powered
ugen2.2: <Keyboardio Model 01> at usbus2
[32] umodem0 numa-domain 0 on uhub4
[32] umodem0: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 1> on usbus2
[32] umodem0: data interface 1, has no CM over data, has break
[32] uhid0 numa-domain 0 on uhub4
[32] uhid0: <Keyboardio Model 01, class 239/2, rev 2.00/1.00, addr 1> on usbus2

But, at least under X, I can’t use it at all. Tried 12.1R and 13.0-CURRENT equally.

Just for completeness, I needed to flash the firmware with a small modification to have this keyboard working under FreeBSD 12.1R and 13.0-CURRENT. This should take ~ 5 minutes total time to do using the excellent instructions https://github.com/keyboardio/Kaleidoscope/wiki/Install-Arduino-support-on-FreeBSD and the discord community https://discordapp.com/ a small diff is required to set the default keyboard protocol, noted at the bottom of the above wiki page.

Thanks @bjc for getting it all working & documented.

1 Like