# Make flash for Atreus

**URL:** https://community.keyboard.io/t/make-flash-for-atreus/4175
**Category:** Programming
**Created:** [October 7, 2020, 3:58pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175 "2020-10-07T15:58:33Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![nyarly](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nyarly/32/3434_2.png) [@nyarly](https://community.keyboard.io/u/nyarly)
#### Post date: [October 7, 2020, 3:58pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/1 "2020-10-07T15:58:33Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)
#### Post date: [October 7, 2020, 8:44pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/2 "2020-10-07T20:44:02Z")

</div>

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

```auto
➜ 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.

---

<div class="post-metadata">

### Author: ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)
#### Post date: [October 7, 2020, 8:59pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/3 "2020-10-07T20:59:30Z")

</div>

[https://github.com/keyboardio/Kaleidoscope/pull/918](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

---

<div class="post-metadata">

### Author: ![nyarly](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nyarly/32/3434_2.png) [@nyarly](https://community.keyboard.io/u/nyarly)
#### Post date: [October 7, 2020, 9:42pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/4 "2020-10-07T21:42:05Z")

</div>

Oh, I for sure stumbled on that one! 🙂 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.

---

<div class="post-metadata">

### Author: ![nyarly](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nyarly/32/3434_2.png) [@nyarly](https://community.keyboard.io/u/nyarly)
#### Post date: [October 7, 2020, 9:47pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/5 "2020-10-07T21:47:41Z")

</div>

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](http://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.

---

<div class="post-metadata">

### Author: ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)
#### Post date: [October 7, 2020, 10:04pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/6 "2020-10-07T22:04:16Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fire](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@fire](https://community.keyboard.io/u/fire)
#### Post date: [October 8, 2020, 10:26pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/7 "2020-10-08T22:26:24Z")

</div>

> [@nyarly](#):
>
> (related: I found a nice solution for Fn+Shift to access a second layer, if anyone’s interested.)

Interested - tell me!

---

<div class="post-metadata">

### Author: ![nyarly](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nyarly/32/3434_2.png) [@nyarly](https://community.keyboard.io/u/nyarly)
#### Post date: [October 8, 2020, 10:30pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/8 "2020-10-08T22:30:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fire](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@fire](https://community.keyboard.io/u/fire)
#### Post date: [October 8, 2020, 11:17pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/9 "2020-10-08T23:17:09Z")

</div>

So how does this work? What does it do?

---

<div class="post-metadata">

### Author: ![nyarly](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nyarly/32/3434_2.png) [@nyarly](https://community.keyboard.io/u/nyarly)
#### Post date: [October 9, 2020, 1:04am UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/10 "2020-10-09T01:04:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![nyarly](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nyarly/32/3434_2.png) [@nyarly](https://community.keyboard.io/u/nyarly)
#### Post date: [October 14, 2020, 4:44pm UTC](https://community.keyboard.io/t/make-flash-for-atreus/4175/11 "2020-10-14T16:44:22Z")

</div>

I did a `filter-repo` of Kaliedoscope and have pushed it [here](https://github.com/nyarly/keyboardio-atreus).
