Author Topic: TMK keyboard firmware  (Read 828075 times)

0 Members and 2 Guests are viewing this topic.

Offline building_an_ergo

  • Posts: 90
  • Location: Kyoto, Japan
Re: TMK keyboard firmware
« Reply #1000 on: Sun, 18 October 2015, 11:03:27 »
Can you post your whole keymap file

Sure, here it is:

Code: [Select]
/*
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <stdbool.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include "keycode.h"
#include "action.h"
#include "action_util.h"
#include "action_code.h"
#include "action_macro.h"
#include "action_layer.h"
#include "bootloader.h"
#include "report.h"
#include "host.h"
#include "print.h"
#include "debug.h"
#include "keymap.h"
#include "ergodox.h"


/* ErgoDox keymap definition macro */
#define KEYMAP(                                                 \
                                                                \
    /* left hand, spatial positions */                          \
    k00,k01,k02,k03,k04,k05,k06,                                \
    k10,k11,k12,k13,k14,k15,k16,                                \
    k20,k21,k22,k23,k24,k25,                                    \
    k30,k31,k32,k33,k34,k35,k36,                                \
    k40,k41,k42,k43,k44,                                        \
                            k55,k56,                            \
                                k54,                            \
                        k53,k52,k51,                            \
                                                                \
    /* right hand, spatial positions */                         \
        k07,k08,k09,k0A,k0B,k0C,k0D,                            \
        k17,k18,k19,k1A,k1B,k1C,k1D,                            \
            k28,k29,k2A,k2B,k2C,k2D,                            \
        k37,k38,k39,k3A,k3B,k3C,k3D,                            \
                k49,k4A,k4B,k4C,k4D,                            \
    k57,k58,                                                    \
    k59,                                                        \
    k5C,k5B,k5A )                                               \
                                                                \
   /* matrix positions */                                       \
   {                                                            \
    { KC_##k00,KC_##k10,KC_##k20,KC_##k30,KC_##k40,KC_NO   },   \
    { KC_##k01,KC_##k11,KC_##k21,KC_##k31,KC_##k41,KC_##k51},   \
    { KC_##k02,KC_##k12,KC_##k22,KC_##k32,KC_##k42,KC_##k52},   \
    { KC_##k03,KC_##k13,KC_##k23,KC_##k33,KC_##k43,KC_##k53},   \
    { KC_##k04,KC_##k14,KC_##k24,KC_##k34,KC_##k44,KC_##k54},   \
    { KC_##k05,KC_##k15,KC_##k25,KC_##k35,KC_NO,   KC_##k55},   \
    { KC_##k06,KC_##k16,KC_NO,   KC_##k36,KC_NO,   KC_##k56},   \
                                                                \
    { KC_##k07,KC_##k17,KC_NO,   KC_##k37,KC_NO,   KC_##k57},   \
    { KC_##k08,KC_##k18,KC_##k28,KC_##k38,KC_NO,   KC_##k58},   \
    { KC_##k09,KC_##k19,KC_##k29,KC_##k39,KC_##k49,KC_##k59},   \
    { KC_##k0A,KC_##k1A,KC_##k2A,KC_##k3A,KC_##k4A,KC_##k5A},   \
    { KC_##k0B,KC_##k1B,KC_##k2B,KC_##k3B,KC_##k4B,KC_##k5B},   \
    { KC_##k0C,KC_##k1C,KC_##k2C,KC_##k3C,KC_##k4C,KC_##k5C},   \
    { KC_##k0D,KC_##k1D,KC_##k2D,KC_##k3D,KC_##k4D,KC_NO   }    \
   }

#if defined(KEYMAP_DVORAK)
#include "keymap_dvorak.h"
#elif defined(KEYMAP_COLEMAK)
#include "keymap_colemak.h"
#elif defined(KEYMAP_WORKMAN)
#include "keymap_workman.h"
#elif defined(KEYMAP_MICRO)
#include "keymap_micro.h"
#elif defined(KEYMAP_CUB)
#include "keymap_cub.h"
#else

static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KEYMAP(  // layout: layer 0: default
        // left hand
        ESC, 1,   2,   3,   4,   5,   GRV,
        TAB, Q,   W,   E,   R,   T,   MINUS,
        CAPS,A,   S,   D,   F,   G,
        LSFT,Z,   X,   C,   V,   B,   EQL,
        LCTL, LEFT,UP,  DOWN,RGHT,
                                      LALT, HOME,
                                           END,
                                 SPC,DELETE, LGUI,
        // right hand
             QUOT,6,   7,   8,   9,   0,   BSPC,
             RBRC, Y,   U,   I,   O,   P,   BSLS,
                  H,   J,   K,   L,   SCLN,ENT,
             LBRC, N,   M,   COMM,DOT, SLSH,RSFT,
                       PSCR, F12, FN6, KANA,RCTL,
        PGUP,RALT,
        PGDN,
        RGUI, ENT, FN1
    ),

    KEYMAP(  // layer 1 : function and symbol keys
        // left hand
        TRNS,F1,  F2,  F3,  F4,  F5,  F11,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN4,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,
                                      TRNS,TRNS,
                                           TRNS,
                                 TRNS,TRNS,TRNS,
        // right hand
             F12, F6,  F7,  F8,  F9,  F10, TRNS,
             FN4,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
                  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
                       TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,
        TRNS,
        TRNS,TRNS,TRNS
    ),

    KEYMAP(  // layer 2 : keyboard functions
        // left hand
        FN0, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN4,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,
                                      TRNS,TRNS,
                                           TRNS,
                                 TRNS,TRNS,TRNS,
        // right hand
             TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
             FN4,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
                  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
                       TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,
        TRNS,
        TRNS,TRNS,TRNS
    ),

    KEYMAP(  // layer 3: numpad
        // left hand
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN4,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,
                                      TRNS,TRNS,
                                           TRNS,
                                 TRNS,TRNS,TRNS,
        // right hand
             TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC,
             FN4,NO,  P7,  P8,  P9,  PMNS,BSPC,
                  NO,  P4,  P5,  P6,  PPLS,PENT,
             TRNS,NO,  P1,  P2,  P3,  PPLS,PENT,
                       P0,  PDOT,SLSH,PENT,PENT,
        TRNS,TRNS,
        TRNS,
        TRNS,TRNS,TRNS
    ),

};

/* id for user defined functions */
enum function_id {
    TEENSY_KEY,
};

/*
 * Macro definition
 */
enum macro_id {
    SHIFT_ALT,
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case SHIFT_ALT:
            return (record->event.pressed ?
                    MACRO( D(LALT), D(LSFT), END ) :
                    MACRO( U(LALT), U(LSFT), END ));
    }
    return MACRO_NONE;
}

/*
 * Fn action definition
 */
static const uint16_t PROGMEM fn_actions[] = {
    ACTION_FUNCTION(TEENSY_KEY),                    // FN0 - Teensy key
    ACTION_LAYER_MOMENTARY(1),                      // FN1 - switch to Layer1
    ACTION_LAYER_SET(2, ON_PRESS),                  // FN2 - set Layer2
    ACTION_LAYER_TOGGLE(3),                         // FN3 - toggle Layer3 aka Numpad layer
    ACTION_LAYER_SET(0, ON_PRESS),                  // FN4 - set Layer0
    ACTION_LAYER_TOGGLE(1),                         // FN5 - toggle Layer1 aka F Keys
    ACTION_MACRO(SHIFT_ALT),     // FN6 - Language Change (Shift+Alt)
};

void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
{
    if (id == TEENSY_KEY) {
        clear_keyboard();
        print("\n\nJump to bootloader... ");
        _delay_ms(250);
        bootloader_jump(); // should not return
        print("not supported.\n");
    }
}

#endif


#define KEYMAPS_SIZE    (sizeof(keymaps) / sizeof(keymaps[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))

/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
    if (layer < KEYMAPS_SIZE) {
        return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
    } else {
        // fall back to layer 0
        return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
    }
}

#if defined(KEYMAP_CUB)

// function keymap_fn_to_action will be defined in keymap_cub.h

#else
/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
    action_t action;
    if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
        action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
    } else {
        action.code = ACTION_NO;
    }
    return action;
}
#endif


Offline lkong

  • Posts: 78
  • Location: United States
Re: TMK keyboard firmware
« Reply #1001 on: Thu, 22 October 2015, 20:43:23 »
Any one has experience to get the serialmouse working?
I can't seem to find the pin assignment for that.

Offline Ryu

  • Posts: 60
  • Location: Japan
    • GitHub
Re: TMK keyboard firmware
« Reply #1002 on: Fri, 23 October 2015, 01:22:31 »
I'm using http://www.enjoyclick.org/tkg/# to make a keymap for my KC60...it is my understanding that with TMK you can have the ESC key double as ~ when you hit shift....but the TMG tool doesn't supply that in his help. What would be the edit that I'd need to make to the keymap.c file afterwards?

You may get help from him here. I don't know how his TKG works actually.
https://github.com/kairyu/tkg

BTW, ESC/~ is possible but not easy with TMK, you will have to write C code. I think you can find the code somewhere but I can't remember.

I call the feature 'Tricky Esc' and you can find my code here: https://github.com/kairyu/tmk_keyboard_custom/blob/master/keyboard/gh60/keymap_poker2.c#L89-L115
It's really simple code benefit from the great action_function.
As you see it's a 'Built-in' function rather than keymap, so it can only work with the firmware which has it built-in (e.g. the firmwares shipped with tkg-toolkit).

Offline p3lim

  • Posts: 106
  • Location: Norway
Re: TMK keyboard firmware
« Reply #1003 on: Fri, 23 October 2015, 07:56:51 »
I'm using http://www.enjoyclick.org/tkg/# to make a keymap for my KC60...it is my understanding that with TMK you can have the ESC key double as ~ when you hit shift....but the TMG tool doesn't supply that in his help. What would be the edit that I'd need to make to the keymap.c file afterwards?

You may get help from him here. I don't know how his TKG works actually.
https://github.com/kairyu/tkg

BTW, ESC/~ is possible but not easy with TMK, you will have to write C code. I think you can find the code somewhere but I can't remember.

I call the feature 'Tricky Esc' and you can find my code here: https://github.com/kairyu/tmk_keyboard_custom/blob/master/keyboard/gh60/keymap_poker2.c#L89-L115
It's really simple code benefit from the great action_function.
As you see it's a 'Built-in' function rather than keymap, so it can only work with the firmware which has it built-in (e.g. the firmwares shipped with tkg-toolkit).

https://geekhack.org/index.php?topic=41989.msg1885398#msg1885398

Offline RavenII

  • Posts: 191
Re: TMK keyboard firmware
« Reply #1004 on: Mon, 26 October 2015, 15:06:19 »
I just finished modifying my KC60, basically I reeplaced the plate, changeed the switches, springs, added sip sockts, etc. Now that it's all assembled, it seems as if though the 3edx column is having issues, I'm not crtain as to what th issue may be. Notice that as I type, I either miss E or double type it. How can I trouble shoot if it's in the firmwaree or hardware? I've made the mistakes in bold for your viewing pleasure. I mostly happeens ...with the E but sometimes with D, X, or 3. I've alreaddy trieed....to add deebounce, no luck.

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1005 on: Mon, 26 October 2015, 17:18:10 »
I just finished modifying my KC60, basically I reeplaced the plate, changeed the switches, springs, added sip sockts, etc. Now that it's all assembled, it seems as if though the 3edx column is having issues, I'm not crtain as to what th issue may be. Notice that as I type, I either miss E or double type it. How can I trouble shoot if it's in the firmwaree or hardware? I've made the mistakes in bold for your viewing pleasure. I mostly happeens ...with the E but sometimes with D, X, or 3. I've alreaddy trieed....to add deebounce, no luck.

I had some weirdness with my KC60. They didn't do a very clean job of soldering on the Atmega32U4. If you look at it with a magnifying glass you will see lots of solder residue. I fixed mine by taking a sharp plastic scribe and sliding it between the pins. Don't press hard, you don't want to bend anything, just clear anything between the pins.

This http://hackedgadgets.com/2008/01/14/surface-mount-soldering-tutorial/ picture show a very clean soldering job.

Offline RavenII

  • Posts: 191
Re: TMK keyboard firmware
« Reply #1006 on: Mon, 26 October 2015, 18:14:08 »
I just finished modifying my KC60, basically I reeplaced the plate, changeed the switches, springs, added sip sockts, etc. Now that it's all assembled, it seems as if though the 3edx column is having issues, I'm not crtain as to what th issue may be. Notice that as I type, I either miss E or double type it. How can I trouble shoot if it's in the firmwaree or hardware? I've made the mistakes in bold for your viewing pleasure. I mostly happeens ...with the E but sometimes with D, X, or 3. I've alreaddy trieed....to add deebounce, no luck.

I had some weirdness with my KC60. They didn't do a very clean job of soldering on the Atmega32U4. If you look at it with a magnifying glass you will see lots of solder residue. I fixed mine by taking a sharp plastic scribe and sliding it between the pins. Don't press hard, you don't want to bend anything, just clear anything between the pins.

This http://hackedgadgets.com/2008/01/14/surface-mount-soldering-tutorial/ picture show a very clean soldering job.

You know...I wanted to contact you directly but didn't want to bother you...I was thinking it was the ground jumpers causing an issue (since I re did them) but I thought, "man, they're just grounds"...THEN I remembered that my mom tried removing the Atmega (and told me that it was epoxied to the board?)...so I'm starting to think that it's got something to do with that. I'll double check it.

In the event that anyone was wondering why my mom was trying to desolder the chip...I had desoldered the whole board to change the plate/switches and had given it to her to clean all the flux off of the board (she's all sorts of certified in soldering/BGA/etc.)...a while back I had told her that I wanted her to swap the 32u4 from my NerD60 (so I can preserve the bootloader) and she thought it was this board...luckily it was glued on...

Offline Ryu

  • Posts: 60
  • Location: Japan
    • GitHub
Re: TMK keyboard firmware
« Reply #1007 on: Mon, 26 October 2015, 20:26:00 »
I'm using http://www.enjoyclick.org/tkg/# to make a keymap for my KC60...it is my understanding that with TMK you can have the ESC key double as ~ when you hit shift....but the TMG tool doesn't supply that in his help. What would be the edit that I'd need to make to the keymap.c file afterwards?

You may get help from him here. I don't know how his TKG works actually.
https://github.com/kairyu/tkg

BTW, ESC/~ is possible but not easy with TMK, you will have to write C code. I think you can find the code somewhere but I can't remember.

I call the feature 'Tricky Esc' and you can find my code here: https://github.com/kairyu/tmk_keyboard_custom/blob/master/keyboard/gh60/keymap_poker2.c#L89-L115
It's really simple code benefit from the great action_function.
As you see it's a 'Built-in' function rather than keymap, so it can only work with the firmware which has it built-in (e.g. the firmwares shipped with tkg-toolkit).

https://geekhack.org/index.php?topic=41989.msg1885398#msg1885398

I think your code might have a risk of sticking ~ key if user do "Shift Down"->"Esc Down"->"Shift Up"->"Esc Up" in sequence.

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: TMK keyboard firmware
« Reply #1008 on: Mon, 26 October 2015, 22:05:40 »
I am pretty sure I know the answer, but does TMK support the Teensy 2.0++ for larger matrices than the 2.0 can handle?
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1009 on: Mon, 26 October 2015, 22:34:45 »
I am pretty sure I know the answer, but does TMK support the Teensy 2.0++ for larger matrices than the 2.0 can handle?

Yes, you set it in the makefile.

https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md

Offline flabbergast

  • Posts: 234
  • Location: UK
Re: TMK keyboard firmware
« Reply #1010 on: Tue, 27 October 2015, 04:31:11 »
I had some weirdness with my KC60. They didn't do a very clean job of soldering on the Atmega32U4. If you look at it with a magnifying glass you will see lots of solder residue. I fixed mine by taking a sharp plastic scribe and sliding it between the pins. Don't press hard, you don't want to bend anything, just clear anything between the pins.
That would be actually flux residue, not solder (as in tin) residue. I think the Chinese "manufacturers" quite often actually solder by hand, and do not clean up afterwards. It is harmless (certainly electrically it is actually beneficial, as extra isolation, and protects the actual solder from air exposure), unless they use some weird flux which is corrosive long term.

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1011 on: Tue, 27 October 2015, 19:43:02 »
Did I do something really dumb? I keep getting the error code: 0xc0000142 while making my alps64 code in prep for my pcb and stuff from blue's gb.

heres my code: (all i did was modify this file in alps64 folder)
keymap_plain.c

Code: [Select]

#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    [0] = KEYMAP_MATT( \
        ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NUHS, BSPC, \
        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
        CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,  \
        LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,ESC, \
        LCTL,LGUI,LALT,          SPC,                     APP, RALT,FN1,RCTL),

/* 1: FN 1 */
    [1] = KEYMAP_MATT ( \
    (GRV, F1,   F2,   F3,   F4,   F5,   F6,   F7,   F8,   F9,   F10,  F11,  F12,  VOLD, VOLU, \
        TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, TRNS,   TRNS, DEL,  \
        TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, MYCM, TRNS, TRNS, PGDN, TRNS, TRNS, TRNS,  \
        TRNS, TRNS, TRNS, CALC, TRNS, TRNS, TRNS, TRNS, HOME, END,  TRNS, TRNS, TRNS, \
        LGUI, TRNS,             TRNS,                   PSCR, RCTL),
};
const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),
};


oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1012 on: Tue, 27 October 2015, 20:29:07 »
What is the error message like actually? Is that all. Omitting error message is not useful.
You can use service like github gist or pastbin to post text wall of error output.
And did you try compile firmware with default keymap before editing your own map?

Ah, if you are on Windows and using WinAVR you will have this problem.
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-180.html#p260436

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1013 on: Tue, 27 October 2015, 20:56:09 »
What is the error message like actually? Is that all. Omitting error message is not useful.
You can use service like github gist or pastbin to post text wall of error output.
And did you try compile firmware with default keymap before editing your own map?

Ah, if you are on Windows and using WinAVR you will have this problem.
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-180.html#p260436

I just used the cmd in win 10, this is what I did.
CD ~~~~ (on tablet don't know file location)
make -f Make file
And is comes up with a box saying that error code, nothing else.
I did not edit any other files.
oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1014 on: Tue, 27 October 2015, 21:08:51 »
I will paste the code the cmd spits out tomorrow, not going on pc now... Almost time to sleep.
oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1015 on: Tue, 27 October 2015, 21:25:42 »
People have had some problems of building firmware on Windows. People on Windows tend to use WinAVR and this is definitely a cause.

Problems are:
1) WinAVR may not work on newer Windows like Win8 and Win10.
2) Alps64 PCB has ATmega32u2 as controller but WinAVR doesn't support it.

You have to update some files of WinAVR to compile it on those OS's.
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-180.html#p260436

WinAVR is very handy all-in-one package but too old. I reccomend to move to newer toolchain like Atmel's GCC and Cygwin(MinGW) for other command line tools.
https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md



BTW as for Alps64,
More
I'll setup keymap editor for Alps64 PCB later, so if you are frustrated much at these things you can just wait for the editor. With the editor you can make your keymap easily with mouse, it will be useful enough unless you want complex keymap. Not that you sitll have to compile firmware yourself to use full features of TMK.
This is editor for HHKB, for example.
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/index.html

Offline U47

  • Posts: 99
  • Location: YEG
Re: TMK keyboard firmware
« Reply #1016 on: Wed, 28 October 2015, 17:34:13 »
Quote from: hasu

[quote author=U47 link=topic=41989.msg1862625#msg1862625 date=1441998715
Similarly, I'm looking to make a dual-role key out of the standard Caps Lock position which would also take a modifier.

Tap: BKSP
Shift-tap: DEL
Hold: L_CTRL
This is a bit different. You can do tap=BKSP and hold=LCTRL with ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BKSP). But for shift-tap=DEL you would need another layer, and if you want to use Shift to activate that layer, you'll need to apply a shift mod to all the other keys in that layer so Shift still works normally for them. I'm not sure how to do that.

Another option is to write a custom action_function() like Hasu said.

Yeah, I think using Shift is the gotcha. I'm just used to this combination since this is how I've had Karabiner set to work. I don't think a custom action would be too onerous, or I can add it to SpaceFN instead.
Wouldn't this work? https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
Have a momentary layer with DEL on CapsLock and set Shift on the default layer as a FN key to switch to it while setting MOD_LSHIFT.

You're absolutely right. Thanks for wrapping your head around that.

Here's my keymap, in case anyone's curious.

Features:
  • Standard HHKB layout
  • Standard HHKB Fn layer
  • SpaceFN
  • Virtual numpad (cribbed from Realforce 87U, momentary while TAB held)
  • LCTL is a dual-use key, sends BSPC on tap
  • LSFT | RSFT + LCTL sends DEL

It's essentially a HHKB to anyone who doesn't know (or care) about the other layer enhancements. I've grown addicted to SpaceFN now, so that's tossed in there, too.

Feedback welcome!

Offline Ryu

  • Posts: 60
  • Location: Japan
    • GitHub
Re: TMK keyboard firmware
« Reply #1017 on: Thu, 29 October 2015, 21:59:11 »
I just finished modifying my KC60, basically I reeplaced the plate, changeed the switches, springs, added sip sockts, etc. Now that it's all assembled, it seems as if though the 3edx column is having issues, I'm not crtain as to what th issue may be. Notice that as I type, I either miss E or double type it. How can I trouble shoot if it's in the firmwaree or hardware? I've made the mistakes in bold for your viewing pleasure. I mostly happeens ...with the E but sometimes with D, X, or 3. I've alreaddy trieed....to add deebounce, no luck.

I had some weirdness with my KC60. They didn't do a very clean job of soldering on the Atmega32U4. If you look at it with a magnifying glass you will see lots of solder residue. I fixed mine by taking a sharp plastic scribe and sliding it between the pins. Don't press hard, you don't want to bend anything, just clear anything between the pins.

This http://hackedgadgets.com/2008/01/14/surface-mount-soldering-tutorial/ picture show a very clean soldering job.

You know...I wanted to contact you directly but didn't want to bother you...I was thinking it was the ground jumpers causing an issue (since I re did them) but I thought, "man, they're just grounds"...THEN I remembered that my mom tried removing the Atmega (and told me that it was epoxied to the board?)...so I'm starting to think that it's got something to do with that. I'll double check it.

In the event that anyone was wondering why my mom was trying to desolder the chip...I had desoldered the whole board to change the plate/switches and had given it to her to clean all the flux off of the board (she's all sorts of certified in soldering/BGA/etc.)...a while back I had told her that I wanted her to swap the 32u4 from my NerD60 (so I can preserve the bootloader) and she thought it was this board...luckily it was glued on...

I have to say your mon is amazing! And I hope you have already fixed your KC60.
BTW I'm waiting for your NerD60 ;)

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1018 on: Sat, 31 October 2015, 15:47:01 »
What is the error message like actually? Is that all. Omitting error message is not useful.
You can use service like github gist or pastbin to post text wall of error output.
And did you try compile firmware with default keymap before editing your own map?

Ah, if you are on Windows and using WinAVR you will have this problem.
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-180.html#p260436

I just used the cmd in win 10, this is what I did.
CD ~~~~ (on tablet don't know file location)
make -f Make file
And is comes up with a box saying that error code, nothing else.
I did not edit any other files.

here is what the cmd spits out.

Code: [Select]
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Matt>cd C:\Users\Matt\Desktop\tmk_keyboard\keyboard\alps64

C:\Users\Matt\Desktop\tmk_keyboard\keyboard\alps64>make -f Makefile Flip
      0 [main] sh 11216 sync_with_child: child 3960(0x1D0) died before initialization with status code 0xC0000142
    149 [main] sh 11216 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 3620 sync_with_child: child 6360(0x1C0) died before initialization with status code 0xC0000142
    184 [main] sh 3620 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 5324 sync_with_child: child 10544(0x1B0) died before initialization with status code 0xC0000142
    137 [main] sh 5324 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 9488 sync_with_child: child 6736(0x1B8) died before initialization with status code 0xC0000142
    162 [main] sh 9488 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 4108 sync_with_child: child 6516(0x1A8) died before initialization with status code 0xC0000142
    137 [main] sh 4108 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable

mkdir -p obj_alps64
Compiling C: keymap_plain.c
avr-gcc -c -mmcu=atmega32u2 -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= -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_alps64/keymap_plain.lst -I. -IC -I/Users/Matt/Desktop/tmk_keyboard/tmk_core -IC -I/Users/Matt/Desktop/tmk_keyboard/tmk_core/protocol/lufa -IC -I/Users/Matt/Desktop/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git -IC -I/Users/Matt/Desktop/tmk_keyboard/tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_alps64_keymap_plain.o.d  keymap_plain.c -o obj_alps64/keymap_plain.o
make: *** [obj_alps64/keymap_plain.o] Error -1073741502

C:\Users\Matt\Desktop\tmk_keyboard\keyboard\alps64>
oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1019 on: Sat, 31 October 2015, 17:35:55 »
Ignore my last posts, I got it to work!
Now the wait for parts...  :)
oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1020 on: Sat, 31 October 2015, 18:12:57 »
Great!
Post what your problem was and how you resolved it. That may help other people with similar difficulty.

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1021 on: Sat, 31 October 2015, 18:29:29 »
Great!
Post what your problem was and how you resolved it. That may help other people with similar difficulty.
I used dfu-programmer, cygwin terminal, and notepad++.
The cygwin terminal tells you where the errors are, what line, and what column.
Part of my problem was that I tried to use winavr... Yeah...
My other problem was just typing corrections in keymap_plain.c

Building the .hex on windows was a little intimidating, here's how I did it.

To build on windows: [I used windows 10] For alps64 pcb.
1. Open cygwin terminal
2. Type: cd [tmk_keyboard location] [for me it was: C:/Users/Matt/Desktop/tmk_keyboard/keyboard/alps64
2.1...? If you go to the alps64 location through windows explorer, copy the path. But when you paste it into cygwin terminal, all of the \ must be changed to / or it will not read it.
3. Type: make -f Makefile clean
4. Then: make -f Makefile
5. Wait. It took about 3 mins for me, with a very basic layout.

If it says "no  such command: make" or something like that, just restart your computer, that fixed it for me.

I hope this helps.
Yes, I know hasu already has a build tutorial, but I had to to do a lot of trial and error, so I'm posting this.

Now to add more fn layers and stuff!
« Last Edit: Sat, 31 October 2015, 18:50:51 by Deductivemonkee »
oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1022 on: Sun, 01 November 2015, 11:10:12 »
How would I go about making say fn+m switch from Dvorak to qwerty and vice versa?
oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1023 on: Sun, 01 November 2015, 11:37:09 »
Part of my problem was that I tried to use winavr... Yeah...

What toochain are you using then? Atmel AVR toolchain or updated winavr?


Quote
How would I go about making say fn+m switch from Dvorak to qwerty and vice versa?
You can use either layer action of these probably.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#221-default-layer
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#223-toggle-switch

Offline deductivemonkee

  • Posts: 572
  • Location: Canada BC
  • Professional Lurker
Re: TMK keyboard firmware
« Reply #1024 on: Sun, 01 November 2015, 11:45:08 »
Part of my problem was that I tried to use winavr... Yeah...

What toochain are you using then? Atmel AVR toolchain or updated winavr?


Quote
How would I go about making say fn+m switch from Dvorak to qwerty and vice versa?
You can use either layer action of these probably.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#221-default-layer
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#223-toggle-switch

Oh yeah, I am using atmel avr toolchain.
« Last Edit: Sun, 01 November 2015, 12:38:39 by Deductivemonkee »
oh yeah I saw that crazy **** if that doesn't win I'm deleting my account

/ orthodox - 78g zealios / alps64 - mtsc / sentraq s-60x rgb - gat blues / let's split - 67g zealios / let's split - 67g zealios /

Offline FuriousGeorge

  • Posts: 135
  • Location: United States
Re: TMK keyboard firmware
« Reply #1025 on: Thu, 05 November 2015, 17:36:40 »
Just got my Infinity from the most recent drop and tried programming it with TMK. The main branch didn't compile, but someone on Massdrop had suggested the one below. It compiled just fine, but I'm having some issues. If I test it with the keymap_plain that's included it should have the grave character on the top right key on the board, but instead it's tab. The physical tab key gives a Q and every other character is shifted over one from where it is expected to be. Does that mean I need to change something in the matrix file? I'm not really sure what I'm doing. That I got my KC60 programmed is a minor miracle. :)


https://github.com/tmk/tmk_keyboard/tree/flabbergast-tmk_chibios/keyboard/infinity_chibios

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1026 on: Thu, 05 November 2015, 20:30:23 »

Offline FuriousGeorge

  • Posts: 135
  • Location: United States

Offline goflo

  • Posts: 69
  • Location: Germany
Re: TMK keyboard firmware
« Reply #1028 on: Mon, 09 November 2015, 14:42:45 »
I just finished the electronics on my first own keyboard build and started using the tmk firmware.
Now I got just one problem....my complete keymap is mirrored.

The rows are right, the top row is on top of the board, bottom row on the bottom.
But the columns are mirrored.
The "a" for example should be on the left side... but now it's the most right key.

Is there a quick way to change this or do I need to rewrite my whole keymap?

 
- Ergodox Classic/Browns/Grifiti Rests  | - IBM Model M Blue Label |  - Poker II MX Blue | - Ergodox Classic/Blues/Grifiti Rests

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1029 on: Mon, 09 November 2015, 15:47:34 »
I just finished the electronics on my first own keyboard build and started using the tmk firmware.
Now I got just one problem....my complete keymap is mirrored.

The rows are right, the top row is on top of the board, bottom row on the bottom.
But the columns are mirrored.
The "a" for example should be on the left side... but now it's the most right key.

Is there a quick way to change this or do I need to rewrite my whole keymap?

Flip the order of the column pin definition in your matrix.

Offline goflo

  • Posts: 69
  • Location: Germany
Re: TMK keyboard firmware
« Reply #1030 on: Mon, 09 November 2015, 16:10:37 »
Yes....got it.
Thank you a-c  :thumb:

- Ergodox Classic/Browns/Grifiti Rests  | - IBM Model M Blue Label |  - Poker II MX Blue | - Ergodox Classic/Blues/Grifiti Rests

Offline RavenII

  • Posts: 191
Re: TMK keyboard firmware
« Reply #1031 on: Thu, 12 November 2015, 17:57:41 »
I just finished modifying my KC60, basically I reeplaced the plate, changeed the switches, springs, added sip sockts, etc. Now that it's all assembled, it seems as if though the 3edx column is having issues, I'm not crtain as to what th issue may be. Notice that as I type, I either miss E or double type it. How can I trouble shoot if it's in the firmwaree or hardware? I've made the mistakes in bold for your viewing pleasure. I mostly happeens ...with the E but sometimes with D, X, or 3. I've alreaddy trieed....to add deebounce, no luck.

I had some weirdness with my KC60. They didn't do a very clean job of soldering on the Atmega32U4. If you look at it with a magnifying glass you will see lots of solder residue. I fixed mine by taking a sharp plastic scribe and sliding it between the pins. Don't press hard, you don't want to bend anything, just clear anything between the pins.

This http://hackedgadgets.com/2008/01/14/surface-mount-soldering-tutorial/ picture show a very clean soldering job.

You know...I wanted to contact you directly but didn't want to bother you...I was thinking it was the ground jumpers causing an issue (since I re did them) but I thought, "man, they're just grounds"...THEN I remembered that my mom tried removing the Atmega (and told me that it was epoxied to the board?)...so I'm starting to think that it's got something to do with that. I'll double check it.

In the event that anyone was wondering why my mom was trying to desolder the chip...I had desoldered the whole board to change the plate/switches and had given it to her to clean all the flux off of the board (she's all sorts of certified in soldering/BGA/etc.)...a while back I had told her that I wanted her to swap the 32u4 from my NerD60 (so I can preserve the bootloader) and she thought it was this board...luckily it was glued on...

I have to say your mon is amazing! And I hope you have already fixed your KC60.
BTW I'm waiting for your NerD60 ;)

Ryu!...I'm actually trying your tool right now, but it seems as if maybe the matrix in TMK is not correct for the NerD60, I swapped the chip last night actually and I'm trying to mess with TMK on it, but it seems the whole qwerty row as well as "xvn,/" aren't working...I'm trying to figure that out now and I'll let you know.

Also, I don't remember where, but I found a place that had the way to make esc/~ possible. I'll email you about it and maybe you can add it to your TKG. Thanks again man.

Offline amospalla

  • Posts: 3
Re: TMK keyboard firmware
« Reply #1032 on: Tue, 17 November 2015, 18:02:29 »
I received your prebuilt usb to usb converter and I am playing with it right now  ;D

Can I use ISO or JIS layouts with it? I noticed there is no reference to JIS or ISO in on converter/usb_usb/keymap_common.h, but for example it is on converter/ps2_usb/keymap_common.h.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1033 on: Tue, 17 November 2015, 23:25:47 »
Added ISO and JIS keymap to USB-USB converter. You can use KEYMAP_ISO or KEYMAP_JIS for those layouts now. Or just use KEYMAP_ALL, which can support most of layouts probably.
https://github.com/tmk/tmk_keyboard/blob/706b2776464200a5723ac41d58ad7918d72460bb/converter/usb_usb/keymap_common.h#L92-L132


Offline amospalla

  • Posts: 3
Re: TMK keyboard firmware
« Reply #1034 on: Wed, 18 November 2015, 05:46:38 »
Added ISO and JIS keymap to USB-USB converter. You can use KEYMAP_ISO or KEYMAP_JIS for those layouts now. Or just use KEYMAP_ALL, which can support most of layouts probably.
https://github.com/tmk/tmk_keyboard/blob/706b2776464200a5723ac41d58ad7918d72460bb/converter/usb_usb/keymap_common.h#L92-L132

:D wow thanks, I'm testing it tomorrow late!

Offline profet

  • Posts: 137
  • Location: Long Island, NY
Re: TMK keyboard firmware
« Reply #1035 on: Wed, 18 November 2015, 11:07:56 »
Would TMK firmware run on a Bluefruit Micro LE controller?

https://www.adafruit.com/products/2661

Has any work been done on this hardware?
Bringing custom Ergodoxes to the masses.

My heatware: http://www.heatware.com/u/102649

Offline VinnyCordeiro

  • Posts: 432
Re: TMK keyboard firmware
« Reply #1036 on: Wed, 18 November 2015, 13:30:55 »
Would TMK firmware run on a Bluefruit Micro LE controller?

https://www.adafruit.com/products/2661

Has any work been done on this hardware?
It uses an ATmega32U4, so theoretically it is possible. But AFAIK you'll have to write the code to handle the Bluetooth dongle, though. And keep in mind that it is running at 3.3V, you'll have to use an LDO or a voltage regulator to step down the voltage from the USB port.
« Last Edit: Wed, 18 November 2015, 13:32:48 by VinnyCordeiro »

Offline flabbergast

  • Posts: 234
  • Location: UK
Re: TMK keyboard firmware
« Reply #1037 on: Wed, 18 November 2015, 15:27:55 »
There's a regulator on board; I believe that the atmega32u4 runs on 3.3v already. For the bluetooth bit, adafruit supplies a "hid keyboard firmware" for the bluetooth chip, which is connected to the atmega32u4 by serial (or spi, not sure), so it would be sufficient to replace the "send keyboard packet" function in TMK to "send the data over serial" (and get rid of all the USB stuff, since that part is now hidden in the adafruit's bluetooth firmware).

Offline kinglukas38

  • Posts: 247
  • Location: The shop
  • Do you even tactile?
Re: TMK keyboard firmware
« Reply #1038 on: Wed, 18 November 2015, 19:05:37 »
does anyone know what diodes the infinity keyboard uses? got a second-hand board and its missing a single diode
I've never done it before, but I'm pretty sure I'm good at it

Offline p3lim

  • Posts: 106
  • Location: Norway
Re: TMK keyboard firmware
« Reply #1039 on: Thu, 19 November 2015, 06:56:04 »
does anyone know what diodes the infinity keyboard uses? got a second-hand board and its missing a single diode

Most likely 1N4148.

Offline amospalla

  • Posts: 3
Re: TMK keyboard firmware
« Reply #1040 on: Fri, 20 November 2015, 13:41:58 »
Hasu, what you've done is wonderful  :D

JIS layout works perfectly. On keymap_jis.c:27 there is HENK,SPC,MHEN, but it should be MHEN,SPC,HENK.

Just a comment, is it posible to define a layout which includes all posible keys on all layouts so you could switch between keyboards without the need to reflash?
« Last Edit: Fri, 20 November 2015, 17:19:34 by amospalla »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1041 on: Sat, 21 November 2015, 01:11:43 »
Fixed JIS keymap, thanks.


With KEYMAP_ALL() you can define universal keymapping for all major keyboard layouts, it is what I intended at least.

Offline henz

  • * Exquisite Elder
  • Posts: 1284
  • What?
Re: TMK keyboard firmware
« Reply #1042 on: Mon, 23 November 2015, 09:22:53 »
i have tested #264 on kmac 2 and kmac Happy

Offline Zorberema

  • * Maker
  • Posts: 175
  • Location: Sweden
  • IG: @ZorbCaps
Re: TMK keyboard firmware
« Reply #1043 on: Wed, 25 November 2015, 06:06:46 »
Hey!

I've tried to make my software work for several days, and it gets better and better... But now I'm stuck! The error(s) I get are:
More
Code: [Select]
keymap_poker.c:5: error: 'KEYMAP' undeclared here <not in a function>
keymap_poker.c:5: error: expected '}' at e d of input
make: *** [obj_lufa/keymap_poker.o] Error 1


Here's my keymap_poker.c
More
Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,  \
              A,   S,   D,   F,   G,   H,   J,   K,   L,    \
                Z,   X,   C,   V,   B,   N,   M, RSFT,      \
                          FN0,   SPC,    FN1

    /* 1: FN 1 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS

    /* 2: FN 2 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1)
[1] = ACTION_LAYER_MOMENTARY(2)
};


Any help is appreciated! :)

Zorb

Offline VinnyCordeiro

  • Posts: 432
Re: TMK keyboard firmware
« Reply #1044 on: Wed, 25 November 2015, 06:27:07 »
Hey!

I've tried to make my software work for several days, and it gets better and better... But now I'm stuck! The error(s) I get are:
More
Code: [Select]
keymap_poker.c:5: error: 'KEYMAP' undeclared here <not in a function>
keymap_poker.c:5: error: expected '}' at e d of input
make: *** [obj_lufa/keymap_poker.o] Error 1


Here's my keymap_poker.c
More
Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,  \
              A,   S,   D,   F,   G,   H,   J,   K,   L,    \
                Z,   X,   C,   V,   B,   N,   M, RSFT,      \
                          FN0,   SPC,    FN1

    /* 1: FN 1 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS

    /* 2: FN 2 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1)
[1] = ACTION_LAYER_MOMENTARY(2)
};


Any help is appreciated! :)

Zorb
You forgot to close the parenthesis after each keymap. You also forgot the commas at the layers definitions, but that error wasn't caught because of the previous error.

The code should look like this:

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,  \
              A,   S,   D,   F,   G,   H,   J,   K,   L,    \
                Z,   X,   C,   V,   B,   N,   M, RSFT,      \
                          FN0,   SPC,    FN1),

    /* 1: FN 1 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS),

    /* 2: FN 2 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS),
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2),
};

And please, reorganize your code. The legibility is very poor.

Offline Zorberema

  • * Maker
  • Posts: 175
  • Location: Sweden
  • IG: @ZorbCaps
Re: TMK keyboard firmware
« Reply #1045 on: Wed, 25 November 2015, 13:51:10 »
Hey!

I've tried to make my software work for several days, and it gets better and better... But now I'm stuck! The error(s) I get are:
More
Code: [Select]
keymap_poker.c:5: error: 'KEYMAP' undeclared here <not in a function>
keymap_poker.c:5: error: expected '}' at e d of input
make: *** [obj_lufa/keymap_poker.o] Error 1


Here's my keymap_poker.c
More
Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,  \
              A,   S,   D,   F,   G,   H,   J,   K,   L,    \
                Z,   X,   C,   V,   B,   N,   M, RSFT,      \
                          FN0,   SPC,    FN1

    /* 1: FN 1 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS

    /* 2: FN 2 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1)
[1] = ACTION_LAYER_MOMENTARY(2)
};


Any help is appreciated! :)

Zorb
You forgot to close the parenthesis after each keymap. You also forgot the commas at the layers definitions, but that error wasn't caught because of the previous error.

The code should look like this:

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,  \
              A,   S,   D,   F,   G,   H,   J,   K,   L,    \
                Z,   X,   C,   V,   B,   N,   M, RSFT,      \
                          FN0,   SPC,    FN1),

    /* 1: FN 1 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS),

    /* 2: FN 2 */
    KEYMAP(TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     \
                TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,       \
                            TRNS,TRNS,TRNS),
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2),
};

And please, reorganize your code. The legibility is very poor.

I know that's what it says in the tutorial, but when I try that I get a thousand error messages saying something like "
  • [0][10]". I thought it was better to just have 3 errors that 1000... Pretty stupid of me; will definitelly change to what you wrote and try to go from there! I'll try to give the exact errors I get later, I'm not home atm!

Offline goflo

  • Posts: 69
  • Location: Germany
Re: TMK keyboard firmware
« Reply #1046 on: Thu, 26 November 2015, 13:04:38 »
After every error in my layout is fixed, this new beauty is running on tmk firmware   ;D
Thank you hasu  :thumb:
- Ergodox Classic/Browns/Grifiti Rests  | - IBM Model M Blue Label |  - Poker II MX Blue | - Ergodox Classic/Blues/Grifiti Rests

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1047 on: Thu, 26 November 2015, 18:12:02 »
Looks realy pretty, wooden frame in particular! Thanks for posting.

Offline profet

  • Posts: 137
  • Location: Long Island, NY
Re: TMK keyboard firmware
« Reply #1048 on: Sat, 28 November 2015, 15:02:31 »
So I went and purchased an adafruit bluefruit micro le and compiled tmk phantom firmware for atmega32u4. I then used avrdude to upload the hex to the controller and it was written successfully.

I assumed (and maybe this was a foolish assumption) that it would "just work" in usb mode... not that any of the matrix pins would be correct... but that it would show up as a non functional HID device at least.

Instead windows reports that its an "Unknown USB Device (Device Descriptor Request Failed)."

Am I doing anything obviously wrong? Was I completely wrong in assuming that since this is also an atmega32u4 that it would "just work" as a usb HID device?

My plan was to get it working over usb then move on to getting the bluetooth working.
Bringing custom Ergodoxes to the masses.

My heatware: http://www.heatware.com/u/102649

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1049 on: Sat, 28 November 2015, 15:22:57 »
Post a link to the product you are using and its circuit in particular. This will help you to get more advice from people here.