Author Topic: Atreus firmware help (TMK flipping layout)  (Read 1538 times)

0 Members and 1 Guest are viewing this topic.

Offline G_I_B_B_O_N

  • Thread Starter
  • Posts: 11
Atreus firmware help (TMK flipping layout)
« on: Mon, 11 June 2018, 05:53:48 »
Can anyone help me compiling my Atreus firmware? I've run into an issue where no matter what I do it compiles the layout flipped horizontally.

first of all, uploading the pre-compiled firmware works fine using this command:

avrdude -p atmega32u4 -c avr109 -U flash:w:atreus-qwerty.hex -P /dev/ttyACM0

I'd like to compile and upload the 'qwerty_classic' TMK firmware, but all attempts have lead to a horizontally flipped layout. Here's commands I've tried:

make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0
OPT_DEFS=-DPCBDOWN make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0
OPT_DEFS=-PCBFLIP make upload KEYMAP=qwerty USB=/dev/ttyACM0
OPT_DEFS=-SWAPCOLUMNS make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0

All of these lead to the same layout which is flipped horizontally from what it should be.

I've also attached a txt file with my terminal output when I compile using:
make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0

I'm not a very experienced programmer, but I do know some C. I have less of an idea what i'm doing in the terminal though. Any help is much appreciated.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Atreus firmware help (TMK flipping layout)
« Reply #1 on: Mon, 11 June 2018, 06:30:21 »
Just a thought - are you sure you soldered the switches on the right side of the board?  Looking on the Atreus website I see the switch outlines on the back which is unusual, and the switches can go either way as there are two sets of holes...

There maybe outlines on both sides of the board but that was my first thought.


Seems there are clever options for this board, I'll go back to sleep.
« Last Edit: Mon, 11 June 2018, 06:39:32 by suicidal_orange »
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline JianYang

  • Posts: 114
Re: Atreus firmware help (TMK flipping layout)
« Reply #2 on: Mon, 11 June 2018, 06:38:06 »
Can anyone help me compiling my Atreus firmware? I've run into an issue where no matter what I do it compiles the layout flipped horizontally.

first of all, uploading the pre-compiled firmware works fine using this command:

avrdude -p atmega32u4 -c avr109 -U flash:w:atreus-qwerty.hex -P /dev/ttyACM0

I'd like to compile and upload the 'qwerty_classic' TMK firmware, but all attempts have lead to a horizontally flipped layout. Here's commands I've tried:

make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0
OPT_DEFS=-DPCBDOWN make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0
OPT_DEFS=-PCBFLIP make upload KEYMAP=qwerty USB=/dev/ttyACM0
OPT_DEFS=-SWAPCOLUMNS make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0

All of these lead to the same layout which is flipped horizontally from what it should be.

I've also attached a txt file with my terminal output when I compile using:
make upload KEYMAP=qwerty_classic USB=/dev/ttyACM0

I'm not a very experienced programmer, but I do know some C. I have less of an idea what i'm doing in the terminal though. Any help is much appreciated.


If you change opts, you have to make clean before, otherwise the compiler won't really recompile anything (as the source files are all older than the obj files). But the PCBUP and PCBDOWN are the correct flags, but I am not sure which is the right one for you. You can edit keymap_common.h (I think) and remove the alternate case and only leave the define for KEYMAP_PCBUP/PCBDOWN and make sure it maps to KEYMAP (IIRC).

Offline G_I_B_B_O_N

  • Thread Starter
  • Posts: 11
Re: Atreus firmware help (TMK flipping layout)
« Reply #3 on: Mon, 11 June 2018, 13:59:20 »
If you change opts, you have to make clean before, otherwise the compiler won't really recompile anything (as the source files are all older than the obj files). But the PCBUP and PCBDOWN are the correct flags, but I am not sure which is the right one for you. You can edit keymap_common.h (I think) and remove the alternate case and only leave the define for KEYMAP_PCBUP/PCBDOWN and make sure it maps to KEYMAP (IIRC).

I'm not sure I understand what yo mean by make clean. Does this mean a hard reset? I resaved the desired layout file and the relevant headers in hopes they would cause a recompile.
I just saw this in the firmware readme. I'm gonna try this now.
« Last Edit: Mon, 11 June 2018, 14:06:10 by G_I_B_B_O_N »

Offline G_I_B_B_O_N

  • Thread Starter
  • Posts: 11
Re: Atreus firmware help (TMK flipping layout)
« Reply #4 on: Mon, 11 June 2018, 14:24:20 »
I tried 'make clean' followed each time by each of the previous upload options I listed before. No go. The thing will not map the layout facing forward.

Just a thought - are you sure you soldered the switches on the right side of the board?  Looking on the Atreus website I see the switch outlines on the back which is unusual, and the switches can go either way as there are two sets of holes...

Even if I soldered it upside down, these upload options should correct that right? Also, if it was upside down, why would the precompiled firmware work fine out of the box?

Is there a way to compile the layout into a .hex file like the precompiled ones on the website and upload using:

avrdude -p atmega32u4 -c avr109 -U flash:w:atreus_classic.hex -P /dev/ttyACM0

- this seems to be the only upload method that maps correctly (using the pre-compiled firmware)
« Last Edit: Mon, 11 June 2018, 14:33:06 by G_I_B_B_O_N »

Offline G_I_B_B_O_N

  • Thread Starter
  • Posts: 11
Re: Atreus firmware help (TMK flipping layout)
« Reply #5 on: Mon, 11 June 2018, 15:14:12 »
Ok I tried compiling to a hex file and then uploading using:

avrdude -p atmega32u4 -c avr109 -U flash:w:atreus.hex -P /path/to/usb

I'm pretty sure now that the thing is compiling it backwards because the standard pre-compiled file from the atreus website works fine but all my compiles are flipped. Even after I use 'make clean' followed by all the available options to flip the layout during compile, it never changes.

Any suggestions?

Offline Tactile

  • Posts: 1435
  • Location: Portland, OR
Re: Atreus firmware help (TMK flipping layout)
« Reply #6 on: Mon, 11 June 2018, 15:14:19 »
In the sample output file you've linked in the OP I don't see any reference to "atreus-qwerty.hex". Is the flash operation targeting the wrong file?

Code: [Select]
Creating load file for Flash: atreus.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature atreus.elf atreus.hex
...
avrdude: erasing chip
avrdude: reading input file "atreus.hex"
avrdude: input file atreus.hex auto detected as Intel Hex
avrdude: writing flash (14836 bytes):
REΛLFORCE

Offline G_I_B_B_O_N

  • Thread Starter
  • Posts: 11
Re: Atreus firmware help (TMK flipping layout)
« Reply #7 on: Mon, 11 June 2018, 15:29:17 »
In the sample output file you've linked in the OP I don't see any reference to "atreus-qwerty.hex". Is the flash operation targeting the wrong file?

Sorry, that output file was from using Make. It compiles it to atreus.hex and then uploads that.

The precompiled file from the website was called atreus-qwerty.hex and it's just uploaded using:
avrdude -p atmega32u4 -c avr109 -U flash:w:atreus-qwerty.hex -P /dev/ttyACM0

That works fine, but as it's precompiled, I'm unable to modify my layout at all.