How to build your very own keyboard firmware
-
- Main keyboard: Ducky Shine 4
- Main mouse: Mionix Avior 5000
- Favorite switch: Cherry Mx Blues
- DT Pro Member: -
Hello everyone I've been working on my own build for a while now and I cant seem to figure out how to compile. I'm not much of a programmer so I'm not familiar with how to compile my zip or really use the terminal. Ideally I'd like to compile on my Windows 10 rig but if necessary I can compile on a mac. Can somebody give me specific instructions to be able to compile the firmware. Thank You.
-
- Chasing the Dream
- Location: Berlin
- Main keyboard: redscarf III
- DT Pro Member: -
Open cmd, then navigate to your direction, for example if the tmk software is on sys/username/tmk, you must type "cd tmk" (or the name that your use for the direction). "CD" open the direction, then you must go on "cd keyboard" "cd gh60", then you are there, run "make -f Makefile" and it will compile. I hope this was helpfull.
-
- Main keyboard: Ducky Shine 4
- Main mouse: Mionix Avior 5000
- Favorite switch: Cherry Mx Blues
- DT Pro Member: -
Thanks for the quick response. It helped immensely and I was able to get to the directory. Sadly I'm getting an application error when running the command. Any ideas?
- Attachments
-
- GenericImage.png (7.36 KiB) Viewed 6220 times
- Eszett
- Location: Germany
- Main keyboard: Filco Majestouch 2 TKL DE MX blue
- Main mouse: Logitech MX Master 2S
- DT Pro Member: -
-- uninstall & reinstall AVR
-- reboot
-- run as admin
-- if this not work, install and compile on a different pc just to get the firmware compiled or ask someone else to compile it for you or post the firmware here.
-- reboot
-- run as admin
-- if this not work, install and compile on a different pc just to get the firmware compiled or ask someone else to compile it for you or post the firmware here.
-
- Main keyboard: Ducky Shine 4
- Main mouse: Mionix Avior 5000
- Favorite switch: Cherry Mx Blues
- DT Pro Member: -
Thank You for the input guys. I will report with my findings in a bit.
-
- Main keyboard: Ducky Shine 4
- Main mouse: Mionix Avior 5000
- Favorite switch: Cherry Mx Blues
- DT Pro Member: -
Well sorry guys I've failed you. I'm stumped, I spent the whole day trying the fixes and installed my first Windows XP virtual box on my pc(Neat stuff btw thnx hypkx), but just couldn't compile. I'm going with my last resort: To bother a kind soul willing to compile my firmware. So any takers? Thanks. I used keymap_poker.c for my keymap in case somebody was wondering(I didn't know if I was supposed to erase the other keymaps so I left them).
https://www.dropbox.com/s/z1ddw2a7n4d63 ... r.zip?dl=0
https://www.dropbox.com/s/z1ddw2a7n4d63 ... r.zip?dl=0
-
- Chasing the Dream
- Location: Berlin
- Main keyboard: redscarf III
- DT Pro Member: -
-
- Main keyboard: Ducky Shine 4
- Main mouse: Mionix Avior 5000
- Favorite switch: Cherry Mx Blues
- DT Pro Member: -
Thank you so much. I will report back of my progress.
-
- Main keyboard: Custom made atomic
- DT Pro Member: -
Hello!
I also get the same problem as other people earlier in this thread, I cant compile any firmware. When I enter the command I get the same application error as MayonaiseInstrument and cmd prints the same (I think) as LeandreN got and posted on page 8 and 9.
I have tested to restart my pc, run cmd as administrator, run it on multiple machines, one running windows 7 and one 8.1.
I would prefer to be able to compile it myself as I'm not totally sure in how I want the layout yet or have not written a full custom version of the code designed around my preferences. (the error occured both when I tried to compile a first try of my design and with the TMK_keyboard "out of the box", only extracted but not modified)
I guess it must be something that we three all do in common as we're all beginners to programming and we all get the same or similar error message.
Hope someone have an idea, would be awesome to be able to use my cystom made (atomic) keyboard.
I also get the same problem as other people earlier in this thread, I cant compile any firmware. When I enter the command I get the same application error as MayonaiseInstrument and cmd prints the same (I think) as LeandreN got and posted on page 8 and 9.
I have tested to restart my pc, run cmd as administrator, run it on multiple machines, one running windows 7 and one 8.1.
I would prefer to be able to compile it myself as I'm not totally sure in how I want the layout yet or have not written a full custom version of the code designed around my preferences. (the error occured both when I tried to compile a first try of my design and with the TMK_keyboard "out of the box", only extracted but not modified)
I guess it must be something that we three all do in common as we're all beginners to programming and we all get the same or similar error message.
Hope someone have an idea, would be awesome to be able to use my cystom made (atomic) keyboard.
-
- Main keyboard: Custom made atomic
- DT Pro Member: -
Yes I have.hypkx wrote: ↑Have you winAVR installed?
if you want I can compile for you.
btw if it don't compile and your cmd shows errors, maybe youre files aren't correct modified
As I said I would prefer to be able to compile it myself so I can change the layout in the future. But maybe that would be a last way out if I won't get it working.
I don't think it's my files, because the same thing happen if I try to compile hasu's code without modifying it at all.
What more exacly are winAVR doing? Now I just go to the directory with the code and use the command make -f Makefile without touching winAVR. Is it being used automatically by that command?
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Yes. Think of the Makefile as a recipe telling the compiler(s)/linker what files to compile and how to put them together. make is the program that reads the recipe and runs the compiler and then the linker.Hag.com wrote: ↑Now I just go to the directory with the code and use the command make -f Makefile without touching winAVR. Is it being used automatically by that command?
By the way - since you reference the error messages appearing in this thread - did you actually try the suggestions that are there?
First, mcturtles reported that this fix has worked for him. It pretty much means that the tools that winavr includes are really old, and need some fixing up.
If you prefer not to "fix up" the winavr, but instead go with a clean install of the current versions of the tools, you can install cygwin (or msys) and avr-gcc: install first "normal" cygwin (be sure to install "devel" tools (make, ...)), and then also get newer avr-gcc compiler, for instance from here.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Yes. Think of the Makefile as a recipe describing what files to compile and how to put them together. make is the program that reads the recipe and runs the compiler and then the linker.Hag.com wrote: ↑Now I just go to the directory with the code and use the command make -f Makefile without touching winAVR. Is it being used automatically by that command?
By the way - since you reference the error messages appearing in this thread - did you actually try the suggestions that are there?
First, mcturtles reported that this fix has worked for him. It pretty much means that the tools that winavr includes are really old, and need some fixing up.
If you prefer not to "fix up" the winavr, but instead go with a clean install of the current versions of the tools, you can install cygwin (or msys) and avr-gcc: install first "normal" cygwin (be sure to install "devel" tools (make, ...)), and then also get newer avr-gcc compiler, for instance from here.[/quote]
-
- Main keyboard: Custom made atomic
- DT Pro Member: -
No, sorry. I just saw that hypkx compiled it for him (I think) and that he didn't seem to have solved his issue. Didn't dug deep enough in the earlier subject to see the suggestions. Will try that some day later, now the weekend is over and I must focus on school again, but thanks for the links!flabbergast wrote: ↑Yes. Think of the Makefile as a recipe telling the compiler(s)/linker what files to compile and how to put them together. make is the program that reads the recipe and runs the compiler and then the linker.Hag.com wrote: ↑Now I just go to the directory with the code and use the command make -f Makefile without touching winAVR. Is it being used automatically by that command?
By the way - since you reference the error messages appearing in this thread - did you actually try the suggestions that are there?
First, mcturtles reported that this fix has worked for him. It pretty much means that the tools that winavr includes are really old, and need some fixing up.
If you prefer not to "fix up" the winavr, but instead go with a clean install of the current versions of the tools, you can install cygwin (or msys) and avr-gcc: install first "normal" cygwin (be sure to install "devel" tools (make, ...)), and then also get newer avr-gcc compiler, for instance from here.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
-
- Main keyboard: Cherry Highscreen
- Main mouse: Random 15 euro mouse
- Favorite switch: MX blue or alike
- DT Pro Member: -
When I run the makefile, i get this error:
Thanks in advance
Spoiler:
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
You might want to be a bit more verbose when you ask questions like this - it's hard to tell what exactly is the problem unless you share a bit more - e.g. what are you trying to achieve, what have you edited and how. You certainly should not get an error like this if you run 'make KEYMAP=poker' in pristine TMK/keyboard/gh60.
Looks like you messed up the keymap_common.h files - specifically the definition of KEYMAP macro - lines 40-52 (you might have deleted one of the "Kxx" parameters or something like that). Please start with the original keymap_common.h and compare. Then try to make changes one-by-one to identify which one is problematic.
Looks like you messed up the keymap_common.h files - specifically the definition of KEYMAP macro - lines 40-52 (you might have deleted one of the "Kxx" parameters or something like that). Please start with the original keymap_common.h and compare. Then try to make changes one-by-one to identify which one is problematic.
-
- Main keyboard: Cherry Highscreen
- Main mouse: Random 15 euro mouse
- Favorite switch: MX blue or alike
- DT Pro Member: -
thanks for your reply.
The firmware compiled succesfully this time, but i dont get any output. How can i reverse the diode direction because that may be a problem.
The firmware compiled succesfully this time, but i dont get any output. How can i reverse the diode direction because that may be a problem.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
That's essentially "rows" vs "columns". TMK is naturally set up so that it strobes "rows" and senses "columns". But that requires electrical connections like this: "column" (sensed whether HIGH/LOW) --- diode (+) --- diode (-) --- switch --- "row" (strobed LOW).
TL;DR: for TMK, the "rows" are where your diodes' cathodes (i.e. "-") are connected, and "columns" are where your diodes' anodes (i.e. "+") are connected. It doesn't matter whether they are really rows or columns on the keyboard.
So if you've got this the other way around, you need to switch the pins for "columns" and "rows" in your matrix.c, and adjust the keymap macros.
TL;DR: for TMK, the "rows" are where your diodes' cathodes (i.e. "-") are connected, and "columns" are where your diodes' anodes (i.e. "+") are connected. It doesn't matter whether they are really rows or columns on the keyboard.
So if you've got this the other way around, you need to switch the pins for "columns" and "rows" in your matrix.c, and adjust the keymap macros.
-
- Location: Canada
- Main keyboard: Realforce 91UBK
- DT Pro Member: -
Hey there, I was wondering if I could help some help with building the firmware for a custom keypad. I'm currently doing the rows and I'm curious how it works for my keypad considering the pins used are pins P7-12 on an ATMega32U4. Do I increase the number of 0's under unselect_rows until I get to the 12 pins? Or is there something else I need to do?
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Sorry but this does not make much sense. If you refer to the physical chip pins (see e.g. here), then it's very unlikely you really mean pin 7. Keep in mind that the C sources use "the other" names from the picture above, namely "PB2", "PD7", etc... and the numbers are always between 0 and 7; the other important bit of information being the second letter, i.e. "B" or "D" - that is then used in PORTB, PIND, DDRD for instance.Telathas wrote: ↑... pins P7-12 on an ATMega32U4 ...
EDIT: Also note that Arduino Pro Micro, Arduino Leonardo, ... - they all have pins numbered (usually from 0 to 13, maybe more, and then A0 to A5) - but they generally connect to different pins of the atmega32U4 MCU, having nothing to do with the number on the board. You need to look at the schematic, or just google "<your board> pinout" to figure out which pins on your board connect to which pins of the MCU. Teensy 2.0 has the correct names though, without the "P" at the beginning.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Just as with Arduinos, the numbers on the PCB do not actually denote atmega32u4 pins; no idea where do they come from.
You need to figure out the actual atmega32u4 pins that are connected to these. Have a look at the schematic; or (given that it's a GH keypad, so there should be some firmware available, most likely) TMK, or if you actually have the PCB then the easiest is to use a multimeter, but you can also visually follow the traces on the PCB.
You need to figure out the actual atmega32u4 pins that are connected to these. Have a look at the schematic; or (given that it's a GH keypad, so there should be some firmware available, most likely) TMK, or if you actually have the PCB then the easiest is to use a multimeter, but you can also visually follow the traces on the PCB.
-
- Main keyboard: Ducky shine 3
- DT Pro Member: -
Hi I seem to be having an issue on my custom numpad. Most of the keys work fine, but there are two rows where if I press a key in that row, the entire column is outputted. I checked my electrical connections, and there doesn't appear to be any shorts (i.e. when a key in the row is pressed, no other rows become connected). Could anyone provide any pointers on what I should look for next? Thanks.
Edit: sometimes you can find the answer yourself. Apparently the issue was that I was using pins F0, F1, F4, F5, F6, and F7 for my rows. However, in the 8 bit selection process, pins F4 and F5 are actually the 3rd and 4th pins.
Edit: sometimes you can find the answer yourself. Apparently the issue was that I was using pins F0, F1, F4, F5, F6, and F7 for my rows. However, in the 8 bit selection process, pins F4 and F5 are actually the 3rd and 4th pins.
-
- Location: Denmark
- Main keyboard: Toshiba Satellite Pro A120
- Main mouse: Logitech MX600
- DT Pro Member: -
I try to build my own keyboard firmware using Matt3o's Guide. In the file "keymap_poker.c" he uses short names for some keys.
ENT=Enter, MINS=Minus, EQL=Equal and so on.
What are the shorts for apostrophe ( ` )(not the QUOTE key) and umlaut ( ¨ ), thanks.
ENT=Enter, MINS=Minus, EQL=Equal and so on.
What are the shorts for apostrophe ( ` )(not the QUOTE key) and umlaut ( ¨ ), thanks.
- HzFaq
- Location: Windsor, UK
- Main keyboard: Phantom
- Main mouse: CST L-Trac
- Favorite switch: MX Clears
- DT Pro Member: -