How to build your very own keyboard firmware

MayonaiseInstrument

30 Aug 2015, 08:12

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.

hypkx
Chasing the Dream

30 Aug 2015, 08:30

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.

hypkx
Chasing the Dream

30 Aug 2015, 08:33

After compilation you must read with the teensy loader the new created hex file in the gh60 folder.

MayonaiseInstrument

30 Aug 2015, 08:43

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
GenericImage.png (7.36 KiB) Viewed 6247 times

User avatar
Eszett

30 Aug 2015, 09:24

-- 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.

hypkx
Chasing the Dream

30 Aug 2015, 09:36

You can run win xp or 7 on a virtuell machine to compile.
btw this my cmd window, I have win 7 and it works perfect
Attachments
2015-08-30 09_28_16-C__Windows_system32_cmd.exe.png
2015-08-30 09_28_16-C__Windows_system32_cmd.exe.png (24.66 KiB) Viewed 6231 times

MayonaiseInstrument

30 Aug 2015, 09:45

Thank You for the input guys. I will report with my findings in a bit.

MayonaiseInstrument

31 Aug 2015, 04:25

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

hypkx
Chasing the Dream

31 Aug 2015, 07:26


hypkx
Chasing the Dream

31 Aug 2015, 07:33

poker.c is standart, the other keymaps are only usable if you modify something in the other files, they don't do anything if you don't erase them

MayonaiseInstrument

01 Sep 2015, 00:30

Thank you so much. I will report back of my progress.

Hag.com

06 Sep 2015, 15:08

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. :)

hypkx
Chasing the Dream

06 Sep 2015, 15:59

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

Hag.com

06 Sep 2015, 16:52

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
Yes I have.
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?

User avatar
flabbergast

06 Sep 2015, 21:04

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?
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.

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.

User avatar
flabbergast

06 Sep 2015, 21:05

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?
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.

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]

Hag.com

06 Sep 2015, 22:30

flabbergast wrote:
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?
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.

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.
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! :)

hypkx
Chasing the Dream

07 Sep 2015, 07:23

Youre right, I compiled the files for him. I don't know if his problems are fixed.

User avatar
flabbergast

07 Sep 2015, 09:49

hypkx wrote: Youre right, I compiled the files for him. I don't know if his problems are fixed.
I meant mcturtles, who reports his fix here.

robinvuurdraak

09 Sep 2015, 19:30

When I run the makefile, i get this error:
Spoiler:

Code: Select all

-------- begin --------
avr-gcc (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


mkdir -p obj_gh60_lufa
Compiling C: keymap_poker.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_gh60_lufa/keymap_poker.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_gh60_lufa_keymap_poker.o.d  keymap_poker.c -o obj_gh60_lufa/keymap_poker.o 
In file included from keymap_poker.c:1:0:
keymap_common.h:46:1: error: parameter name missing
 ) { \
 ^
keymap_poker.c:5:5: warning: implicit declaration of function ‘KEYMAP’ [-Wimplicit-function-declaration]
     KEYMAP(
     ^
keymap_poker.c:6:12: error: ‘ESC’ undeclared here (not in a function)
            ESC,  1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS, EQL, BSPC, MNXT,\
            ^
keymap_poker.c:6:68: error: ‘MINS’ undeclared here (not in a function)
            ESC,  1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS, EQL, BSPC, MNXT,\
                                                                    ^
keymap_poker.c:6:74: error: ‘EQL’ undeclared here (not in a function)
            ESC,  1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS, EQL, BSPC, MNXT,\
                                                                          ^
keymap_poker.c:6:79: error: ‘BSPC’ undeclared here (not in a function)
            ESC,  1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS, EQL, BSPC, MNXT,\
                                                                               ^
keymap_poker.c:6:85: error: ‘MNXT’ undeclared here (not in a function)
            ESC,  1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS, EQL, BSPC, MNXT,\
                                                                                     ^
keymap_poker.c:7:12: error: ‘TAB’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
            ^
keymap_poker.c:7:18: error: ‘Q’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                  ^
keymap_poker.c:7:23: error: ‘W’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                       ^
keymap_poker.c:7:28: error: ‘E’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                            ^
keymap_poker.c:7:33: error: ‘R’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                 ^
keymap_poker.c:7:38: error: ‘T’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                      ^
keymap_poker.c:7:43: error: ‘Y’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                           ^
keymap_poker.c:7:48: error: ‘U’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                ^
keymap_poker.c:7:53: error: ‘I’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                     ^
keymap_poker.c:7:58: error: ‘O’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                          ^
keymap_poker.c:7:63: error: ‘P’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                               ^
keymap_poker.c:7:68: error: ‘LBRC’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                                    ^
keymap_poker.c:7:73: error: ‘RBRC’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                                         ^
keymap_poker.c:7:79: error: ‘BSLS’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                                               ^
keymap_poker.c:7:85: error: ‘MPLY’ undeclared here (not in a function)
            TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC, BSLS, MPLY,\
                                                                                     ^
keymap_poker.c:8:12: error: ‘LGUI’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
            ^
keymap_poker.c:8:18: error: ‘A’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                  ^
keymap_poker.c:8:23: error: ‘S’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                       ^
keymap_poker.c:8:28: error: ‘D’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                            ^
keymap_poker.c:8:33: error: ‘F’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                 ^
keymap_poker.c:8:38: error: ‘G’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                      ^
keymap_poker.c:8:43: error: ‘H’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                           ^
keymap_poker.c:8:48: error: ‘J’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                                ^
keymap_poker.c:8:53: error: ‘K’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                                     ^
keymap_poker.c:8:58: error: ‘L’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                                          ^
keymap_poker.c:8:63: error: ‘SCLN’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                                               ^
keymap_poker.c:8:68: error: ‘QUOT’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                                                    ^
keymap_poker.c:8:73: error: ‘ENT’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                                                         ^
keymap_poker.c:8:85: error: ‘MSTP’ undeclared here (not in a function)
            LGUI, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,        MSTP,\
                                                                                     ^
keymap_poker.c:9:12: error: ‘LSFT’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
            ^
keymap_poker.c:9:18: error: ‘Z’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                  ^
keymap_poker.c:9:23: error: ‘X’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                       ^
keymap_poker.c:9:28: error: ‘C’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                            ^
keymap_poker.c:9:33: error: ‘V’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                 ^
keymap_poker.c:9:38: error: ‘B’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                      ^
keymap_poker.c:9:43: error: ‘N’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                           ^
keymap_poker.c:9:48: error: ‘M’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                                ^
keymap_poker.c:9:53: error: ‘COMM’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                                     ^
keymap_poker.c:9:58: error: ‘DOT’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                                          ^
keymap_poker.c:9:63: error: ‘SLSH’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                                               ^
keymap_poker.c:9:68: error: ‘RSFT’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                                                    ^
keymap_poker.c:9:74: error: ‘UP’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                                                          ^
keymap_poker.c:9:79: error: ‘FN1’ undeclared here (not in a function)
            LSFT, Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT, UP,  FN1,     \
                                                                               ^
keymap_poker.c:10:12: error: ‘LCTL’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
            ^
keymap_poker.c:10:18: error: ‘CAPS’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                  ^
keymap_poker.c:10:23: error: ‘FN0’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                       ^
keymap_poker.c:10:37: error: ‘SPC’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                                     ^
keymap_poker.c:10:62: error: ‘RALT’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                                                              ^
keymap_poker.c:10:68: error: ‘FN2’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                                                                    ^
keymap_poker.c:10:73: error: ‘LEFT’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                                                                         ^
keymap_poker.c:10:79: error: ‘DOWN’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                                                                               ^
keymap_poker.c:10:85: error: ‘RGHT’ undeclared here (not in a function)
            LCTL, CAPS,FN0,          SPC,                     RALT, FN2, LEFT, DOWN, RGHT),
                                                                                     ^
keymap_poker.c:13:12: error: ‘GRV’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
            ^
keymap_poker.c:13:17: error: ‘F1’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                 ^
keymap_poker.c:13:21: error: ‘F2’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                     ^
keymap_poker.c:13:25: error: ‘F3’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                         ^
keymap_poker.c:13:29: error: ‘F4’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                             ^
keymap_poker.c:13:33: error: ‘F5’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                 ^
keymap_poker.c:13:37: error: ‘F6’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                     ^
keymap_poker.c:13:41: error: ‘F7’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                         ^
keymap_poker.c:13:45: error: ‘F8’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                             ^
keymap_poker.c:13:49: error: ‘F9’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                                 ^
keymap_poker.c:13:53: error: ‘F10’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                                     ^
keymap_poker.c:13:58: error: ‘F11’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                                          ^
keymap_poker.c:13:63: error: ‘F12’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                                               ^
keymap_poker.c:13:68: error: ‘TRNS’ undeclared here (not in a function)
            GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,\
                                                                    ^
make: *** [obj_gh60_lufa/keymap_poker.o] Error 1
Thanks in advance

User avatar
flabbergast

09 Sep 2015, 20:07

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.

robinvuurdraak

09 Sep 2015, 20:55

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.

User avatar
flabbergast

09 Sep 2015, 21:04

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.

Telathas

19 Sep 2015, 22:07

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?

User avatar
flabbergast

19 Sep 2015, 22:19

Telathas wrote: ... pins P7-12 on an ATMega32U4 ...
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.

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.

Telathas

19 Sep 2015, 23:03

I was just going off of this picture. Image

User avatar
flabbergast

20 Sep 2015, 09:11

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.

peatypeteC

25 Sep 2015, 23:25

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.

RtG

09 Oct 2015, 11:21

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.

User avatar
HzFaq

09 Oct 2015, 11:40

It's in one of the readme's in the DOC folder IIRC.

edit - That's the one

Post Reply

Return to “Workshop”