need help for setting up QMK env. for Windows

katamari

06 Jul 2019, 12:55

Hello everyone,
I am in the process of making myself a 6x4 macropad from scratch. All the hardware part is done, and also first shot on the Firmware.

However I am unable to set up the dev environment properly. I followed the instructions on the QMK website, installing the MSYS2 tool, however, I am unable to update it, and cant find help on the issue I am facing on the official website. Here is the error I get:

Code: Select all

# pacman -Syu
:: Synchronizing package databases...
error: failed to update mingw32 (unable to lock database)
error: failed to update mingw64 (unable to lock database)
error: failed to update msys (unable to lock database)
error: failed to synchronize all databases
If anyone has a lead on solving this, I'd be glad to hear from you.

Cheers! ;)

Menuhin

06 Jul 2019, 14:35

Did you elevate the windows (to admin) that you're running pacman?

katamari

06 Jul 2019, 21:25

Thanks for the answer. Yes I did. I found the answer, had to delete /var/lib/pacman/db.lck. Now it works.

Also, new issue: managed to compile some avalaible firmware (so my toolchain is okay), but not my own.
here what happens:

Code: Select all

Compiling: keyboards/handwired/6x4/6x4.c                                                            [OK]
Compiling: keyboards/handwired/6x4/keymaps/default/keymap.c                                        keyboards/handwired/6x4/keymaps/default/keymap.c:28:1: error: excess elements in array initializer [-Werror]
 [0] = LAYOUT(
 ^
keyboards/handwired/6x4/keymaps/default/keymap.c:28:1: error: (near initialization for 'keymaps[0]') [-Werror]
cc1.exe: all warnings being treated as errors
 [ERRORS]
 |
 |
 |
make[1]: *** [tmk_core/rules.mk:360: .build/obj_handwired_6x4_default/keyboards/handwired/6x4/keymaps/default/keymap.o] Error 1
Make finished with errors
make: *** [Makefile:544: handwired/6x4:default] Error 1
And here is keymap.c just copy-pasted from the 5x5, and removed the useless stuff.

Code: Select all

#include QMK_KEYBOARD_H

// #define PAD 0

// Readability keycodes
#define _______ KC_TRNS

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Single 6x4 board only
 * .---------------------------------------------------.
 * |        |       |       |        |        |        |
 * |--------+-------+-------+--------+--------+--------|
 * |        |       |       |        |        |        |
 * |--------+-------+-------+--------+--------+--------|
 * |        |       |       |        |        |        |
 * |--------+-------+-------+--------+--------+--------|
 * |        |       |       |        |        |        |
 * |--------+-------+-------+--------+--------+--------|
 * |        |       |       |        |        |        |
 * '---------------------------------------------------'
 */

[0] = LAYOUT(
  KC_ESC, KC_0,   KC_0,   KC_1,   KC_2,  KC_3,
  KC_A,   KC_B,   KC_C,   KC_D,   KC_E,  KC_F,
  KC_G,   KC_H,   KC_I,   KC_J,   KC_K,  KC_L,
  KC_M,   KC_N,   KC_O,   KC_P,   KC_Q,  KC_R,
  KC_S,   KC_T,   KC_U,   KC_V,   KC_W,  KC_SPC
  ),
};

const uint16_t PROGMEM fn_actions[] = {

};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  // MACRODOWN only works in this function
      switch(id) {
        case 0:
          if (record->event.pressed) {
            register_code(KC_RSFT);
          } else {
            unregister_code(KC_RSFT);
          }
        break;
      }
    return MACRO_NONE;
};


void matrix_init_user(void) {

}

void matrix_scan_user(void) {

}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  return true;
}

void led_set_user(uint8_t usb_led) {

}
Any ideas?

User avatar
swampangel

06 Jul 2019, 23:55

You should have a #define LAYOUT( ... statement somewhere, can you share it?

For example, https://github.com/qmk/qmk_firmware/blo ... t/keymap.c uses the macro LAYOUT_all, which is #defined in https://github.com/qmk/qmk_firmware/blo ... h60/gh60.h

katamari

07 Jul 2019, 10:36

Hi There

yep, it's defined in 6x4.h which is included into 6x4.c.
Here is my 6x4.h

Code: Select all

#pragma once

#ifndef SIXX4_H
#define SIXX4_H

#include "quantum.h"
#define ___ KC_NO

// This a shortcut to help you visually see your layout.
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array

#define LAYOUT( \
    K00, K01, K02, K03, K04, K05, \
    K10, K11, K12, K13, K14, K15, \
    K20, K21, K22, K23, K24, K25, \
    K30, K31, K32, K33, K34, K35, \
    K40, K41, K42, K43, K44, K45 \
) \
{ \
    { K00, K01, K02, K03, K04, K05}, \
    { K10, K11, K12, K13, K14, K15}, \
    { K20, K21, K22, K23, K24, K25}, \
    { K30, K31, K32, K33, K34, K35}, \
    { K40, K41, K42, K43, K44, K45} \
}

#endif
I think I'll start over, from a working template, making sure the code compiles after every step. Gonna take some time :roll:

Btw, where are the .hex files to be found once the compiling is done?

User avatar
SirHobo

09 Jul 2019, 21:41

If I recall correctly it should just be in the top directory, eg qmk_firmware.

User avatar
purdobol

09 Jul 2019, 21:49

katamari wrote:
07 Jul 2019, 10:36
Btw, where are the .hex files to be found once the compiling is done?
Successful compilation should create "build" folder in top directory. On Linux it's hidden, on Windows have no clue ;)
Matrix size is defined properly in config.h ?

katamari

12 Jul 2019, 02:29

Thanks for your help guys!!
Found the files in .build

And regarding the programming issues, there were serverals.
First I wanted to build a 6x4 matrix, and defined the number of rows and columns as suche but then defined a 6x5 keymap :facepalm:
Another problem was regaring some of the outcommented sections. Apparently you should use /* */ instead of // for commenting out longer sections.

Now everything compiles fine. Still need to clean out some stuff I don't need, especially from rules.mk and keymap.c.

Post Reply

Return to “Workshop”