Make flash for Atreus

I’ve been working with my Model01 on the command line for some time, and updated my dev environment in preparation for receiving and Atreus this week. (related: I found a nice solution for Fn+Shift to access a second layer, if anyone’s interested.)

Now that the Atreus arrived though, I’m at a loss. I would like to continue using my preferred tooling and use make flash to build and install firmware. But it seems like support for doing anything but the Arduino IDE has been removed. Is that right? If not, is there an analogue of the Model01-Firmware repo to start from?

I…m a little confused, since it is building before flashing for me.

➜  Atreus git:(streamline-travis) make flash
BOARD_HARDWARE_PATH="/Users/jesse/Documents/Arduino/hardware" /Users/jesse/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building ./Atreus
- Size: firmware/Atreus/Atreus-0.0.0.elf
  - Program:   20980 bytes (73.2% Full)
  - Data:        911 bytes (35.6% Full)

To update your keyboard's firmware, hold down the key in the lower left corner of your Atreus.


When you're ready to proceed, press 'Enter'.

Oh. I wonder if you’re running into your build having been cached, so it sees a working firmware and (incorrectly and my fault) doesn’t build the firmware first.

https://github.com/keyboardio/Kaleidoscope/pull/918 should mostly fix this issue when merged.

In the meantime,

$ make build flash

should do what you want

1 Like

Oh, I for sure stumbled on that one! :slight_smile: I took to just clobbering the firmware and re-running; I keep that command in mind. Also: my environment was setting a CXX environment variable, which caused me trouble with freshest Kaleidoscope (because my Arduino install has avr-g++ but not g++ in it…) That was a fun little debug.

But my core issue isn’t this at all!

I’ve had a checkout of a fork of Model01-Firmware, and an ~/Arduino directory set up with Kaleidoscope and the Firmware-Bundle. That’s where I’ve been building my firmware - not in the submodule checkout of Model01. I think I could change that, if I dig into the submodules system and fork Kaleidoscope. All told, I’d vote for the separate project with library code, though.

What I don’t understand is how to do something analogous for the Keyboard.io Atreus. Everything I’ve found so far points me to the docs, which are pretty focused on using the Arduino GUI. Is that all that’s supported now?

It looks like you’re building in a project directory there, but it’s unclear from the capture what directory you’re in or what repos are in the remotes.

Ah, that’s examples/Devices/Keyboardio/Atreus in the Kaleidoscope repo.

You should be able to grab that dir and make a repo for your own fork

2 Likes

Interested - tell me!

Check it: https://github.com/nyarly/Model01-Firmware/blob/main/Model01-Firmware.ino#L298-L342

So how does this work? What does it do?

It replaces the normal ShiftToLayer on Fn with a macro definition. The macro effectively does ShiftToLayer, but also checks to see if either shift is held down. Which layer it shifts to depends on if shift is depressed.

There’s some other nuance there - making sure that the shift is only recognized for layer shifting; you can’t also modify keys on those layers with that shift key, but it means that keys on those layers are treated as normal. Also making sure that no matter how you enter or leave the chord, the behavior is the same and predictable. But that’s the gist of it.

I’m not sure if I’ll have time, but I’m tempted to try to make a plugin from it.

I did a filter-repo of Kaliedoscope and have pushed it here.