# Flashing from Arduino IDE (which worked before) now giving bad keymap

**URL:** https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770
**Category:** Programming
**Created:** [October 17, 2022, 2:11am UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770 "2022-10-17T02:11:55Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![forrcaho](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/forrcaho/32/4337_2.png) [@forrcaho](https://community.keyboard.io/u/forrcaho)
#### Post date: [October 17, 2022, 2:11am UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/1 "2022-10-17T02:11:55Z")

</div>

I have been successful using Arduino IDE to flash custom firmware onto my Model 100 from Win11 sometime last week: I defined some keys using the CharShift plugin which I then assigned in Chrysalis.

Today, I tried flashing custom firmware, but the key mapping was very messed up. To make sure it wasn’t my code, I then used Arduino IDE to reinstall the default firmware, and got the same mapping.

Here’s what Layer 0 of that mapping looked like in Chrysalis:

 ![layer0](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/0/02ea8ccc460abb1f8da4c9b8735e6f699dcb531b.png)

Fortunately I was able to re-flash in Chrysalis to get back to a usable keyboard, but I can’t get my CharShift keys back unless I can build my own firmware again.

I tried restoring factory settings in Chrysalis, thinking that might help based on something I read on your Discord server, but I still got the same result.

What’s going on? Can anyone help?

---

<div class="post-metadata">

### Author: ![mefistophel](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mefistophel](https://community.keyboard.io/u/mefistophel)
#### Post date: [October 17, 2022, 9:17pm UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/2 "2022-10-17T21:17:04Z")

</div>

Hi there! Same issue, when trying to add some macros. Was using [official .ino](https://github.com/keyboardio/Chrysalis-Firmware-Bundle/blob/master/Keyboardio/Model100/Model100.ino)  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/b/b5ec48e5b2ff5d710cb77077f422d84b9be2c01d.png)

---

<div class="post-metadata">

### Author: ![MatthewHunt84](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/matthewhunt84/32/4425_2.png) [@MatthewHunt84](https://community.keyboard.io/u/MatthewHunt84)
#### Post date: [October 17, 2022, 10:13pm UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/3 "2022-10-17T22:13:07Z")

</div>

Just flashed to 0.90.6-snapshot.57 and all the maps on my Model 100 are gibberish.  
None of my backups are being saved to the keyboard either, about to try a hard reset…

 ![Screen Shot 2022-10-17 at 3.44.07 PM](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/9/9eee146e3b56ff01c28d24b05b016dbf1759b38d.png)

Update: Just flashed to 0.90.6-snapshot.58 and was able to restore from a backup again!  
(dynamic macros are all wiped unfortunately)

---

<div class="post-metadata">

### Author: ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)
#### Post date: [October 17, 2022, 10:53pm UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/4 "2022-10-17T22:53:11Z")

</div>

Sorry about that, .57 ended up having an unfortunate bug in it.

Out of curiosity, what operating system are you on? Is it macOS, by any chance?

---

<div class="post-metadata">

### Author: ![MatthewHunt84](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/matthewhunt84/32/4425_2.png) [@MatthewHunt84](https://community.keyboard.io/u/MatthewHunt84)
#### Post date: [October 18, 2022, 2:02pm UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/5 "2022-10-18T14:02:42Z")

</div>

Yessir, my work machine is macOS 11.6.1

---

<div class="post-metadata">

### Author: ![mefistophel](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mefistophel](https://community.keyboard.io/u/mefistophel)
#### Post date: [October 25, 2022, 8:56pm UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/6 "2022-10-25T20:56:40Z")

</div>

Ok, I’ve managed to flash Keyboardio 100 correctly with my custom .ino by adding after Layer.move(EEPROMSettings.default\_layer());:  
**EEPROMSettings.ignoreHardcodedLayers(false);**

Layout & Colormap now not available in Chrystalis, but firmare still there, so its enough for me.

---

<div class="post-metadata">

### Author: ![pylon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/pylon/32/4070_2.png) [@pylon](https://community.keyboard.io/u/pylon)
#### Post date: [October 26, 2022, 12:41pm UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/7 "2022-10-26T12:41:05Z")

</div>

I am also having trouble to use `make flash` with the Model 100 on a Mac which resulted in a totally random key alignment. I ended up with using the `.bin`-file from `make compile` and used it as “Custom firmware” in Chrysalis. The trick was, to enable “Factory reset” as well, so that everything on the EEPROM gets deleted and will not be restored.

---

<div class="post-metadata">

### Author: ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)
#### Post date: [October 26, 2022, 6:50pm UTC](https://community.keyboard.io/t/flashing-from-arduino-ide-which-worked-before-now-giving-bad-keymap/5770/8 "2022-10-26T18:50:08Z")

</div>

The random key alignment is due to the EEPROM layout changing between firmware versions (which can happen for all kinds of reasons). The firmware can’t automatically migrate from one layout to another, so if the eeprom layout changes, you need to do the migration manually. Taking a structured dump of the eeprom before flashing, and restoring it after is pretty much all it takes.

Chrysalis does this when it flashes new firmware, but the same thing can be accomplished by using the `bin/eeprom-backup.sh` and `bin/eeprom-restore.sh` scripts in Kaleidoscope’s source tree.
