Author Topic: QMK compiling with MSYS2 MinGW 64-bit trouble  (Read 10896 times)

0 Members and 1 Guest are viewing this topic.

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
QMK compiling with MSYS2 MinGW 64-bit trouble
« on: Sun, 22 October 2017, 20:22:45 »
I'm having trouble compiling my hex. I've installed MSYS2 on windows according to the instructions on these two pages.

https://docs.qmk.fm/getting_started_build_tools.html

http://www.msys2.org/

I also updated the necessary things with "pacman -Syu", "pacman -Su" and "util/msys2_install.sh"

After that it told me that it was ready for use. In the terminal I navigated to the "qmk_master-firmware" folder. I tried to compile my hex with

make AMJpad:owl_custom:all

but it gives me the message

make: *** No rule to make target 'AMJpad:owl_custom:all'. Stop.
Makefile:523: *** recipe commences before first target.  Stop.

So I thought maybe it was something that I messed up with my layout so I tried to compile one of the default layouts on other keyboards and it gives me the same message. I even tried the make command to make all the layouts for all the keyboards but same message. Not sure what to try next. Any insight?

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #1 on: Mon, 23 October 2017, 08:09:18 »
make AMJpad:owl_custom:all
Run this from the QMK root folder and make sure amjpad is lower case since the directory name is so.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #2 on: Mon, 23 October 2017, 13:02:54 »
Run this from the QMK root folder and make sure amjpad is lower case since the directory name is so.
Running it from that folder got rid of the second message but I'm still getting the "make: *** No rule to make target 'amjpad:owl_custom:all'. Stop." message. I also tried other keyboards layouts for good measure but I got the same message.
« Last Edit: Mon, 23 October 2017, 13:11:21 by Atredl »

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #3 on: Mon, 23 October 2017, 14:11:58 »
Did you install MSYS2 in a directory with a space in its name?
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #4 on: Mon, 23 October 2017, 16:32:20 »
Did you install MSYS2 in a directory with a space in its name?
I installed it directly in my C drive. I vaguely remember that note about directories with spaces in them so I avoided installing it in a place like Program Files.


Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #5 on: Mon, 23 October 2017, 16:36:57 »
And where is your QMK repository located?
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline a-c

  • Posts: 196
  • Location: USA
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #6 on: Mon, 23 October 2017, 18:04:49 »
assuming owl_custom is your keymap.

Code: [Select]
make amjpad:owl_custom

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #7 on: Mon, 23 October 2017, 18:50:57 »
And where is your QMK repository located?
It’s in /d/keyboard_programming/qmk_master. The the file names have underscores not spaces for the record.

When attempting to make I would navigate to qmk_master.

Do I need to have the repository in the same directory as msys2?

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #8 on: Mon, 23 October 2017, 19:52:42 »
assuming owl_custom is your keymap.

Code: [Select]
make amjpad:owl_custom
I’ve tried that, or the equivalent. It won’t let me compile any layout. I’ve even tried “make all”

Offline a-c

  • Posts: 196
  • Location: USA
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #9 on: Tue, 24 October 2017, 00:16:14 »
Try cloning the repo again. They made many changes in the past few weeks.

https://www.reddit.com/r/olkb/comments/76ey0y/changes_to_the_make_system_in_qmk/

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #10 on: Tue, 24 October 2017, 00:57:30 »
Try cloning the repo again. They made many changes in the past few weeks.

https://www.reddit.com/r/olkb/comments/76ey0y/changes_to_the_make_system_in_qmk/
No dice. I recloned the repository and still get the same message.

Code: [Select]
Albert@Leviathan MINGW64 /d/keyboard_programming/qmk_master
$ make amjpad:owl_custom
make: *** No rule to make target 'amjpad:owl_custom'.  Stop.

Albert@Leviathan MINGW64 /d/keyboard_programming/qmk_master
$ make amjpad:default
make: *** No rule to make target 'amjpad:default'.  Stop.

Albert@Leviathan MINGW64 /d/keyboard_programming/qmk_master
$ make ergodox_infinity:default
make: *** No rule to make target 'ergodox_infinity:default'.  Stop.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #11 on: Tue, 24 October 2017, 04:03:58 »
Just get rid of the layout parameter. Try with make ergodox_infinity, or you can also try with simple make. It would compile every firmware in the repository but you can kill the task after the first few ones, just to confirm it works.

I'm really starting to think there's a bug with MSYS2. I'm having no issue at all on a Virtualbox machine with Ubuntu.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #12 on: Tue, 24 October 2017, 04:16:33 »
Just get rid of the layout parameter. Try with make ergodox_infinity, or you can also try with simple make. It would compile every firmware in the repository but you can kill the task after the first few ones, just to confirm it works.

I'm really starting to think there's a bug with MSYS2. I'm having no issue at all on a Virtualbox machine with Ubuntu.
Yeah I’m just going to go the Linux route. I was avoiding it since I have zero experience with Linux but I’ve had no luck compiling in Windows.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #13 on: Tue, 24 October 2017, 05:04:19 »
For the time being I can compile the source for you, if you upload it somewhere. Just give me a couple of hours to get some stuff sorted.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #14 on: Tue, 24 October 2017, 05:19:54 »
For the time being I can compile the source for you, if you upload it somewhere. Just give me a couple of hours to get some stuff sorted.
Thanks! I'll send you a PM.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #15 on: Tue, 24 October 2017, 07:29:30 »
Here's your firmware. I also fixed your keymap.c because it required the MAXKEYMAP keymap in order to split 2u keys.
That keymap splits all the 2u into two 1u yet, since I don't own the hardware, I had no idea which of the two 1u is actually wired to the 2u, so I defined either with the same keycode for the Zero and the Enter.
Reading the code will get you a better idea.

One last thing: when you compile, use the -r argument after make.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #16 on: Tue, 24 October 2017, 11:51:39 »
Here's your firmware. I also fixed your keymap.c because it required the MAXKEYMAP keymap in order to split 2u keys.
That keymap splits all the 2u into two 1u yet, since I don't own the hardware, I had no idea which of the two 1u is actually wired to the 2u, so I defined either with the same keycode for the Zero and the Enter.
Reading the code will get you a better idea.

One last thing: when you compile, use the -r argument after make.
Awesome! Thank you very much!

As for the split 2u’s I’m sure I’ll be able to figure which is which with a little trial and error.

Offline Hokabuki

  • Posts: 169
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #17 on: Tue, 24 October 2017, 12:11:46 »
This might be off topic but I’m trying to alter the standard Planck layout in QMK and have no idea where to start. I have done a good amount of research but am still lost. I have my layout saved in KLE and could use a push in the right direction. Are there any good tutorials on YouTube to get me started?

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #18 on: Tue, 24 October 2017, 14:49:55 »
This might be off topic but I’m trying to alter the standard Planck layout in QMK and have no idea where to start. I have done a good amount of research but am still lost. I have my layout saved in KLE and could use a push in the right direction. Are there any good tutorials on YouTube to get me started?

https://docs.qmk.fm/getting_started_build_tools.html

This first link has the information you'll need to set up your build environment. It has instructions on how to do that in multiple operating systems but based on my recent experience, and others recommendation, I would suggest compile in something other than windows. Installing Ubuntu on a virtual machine is what I plan to do.


https://github.com/qmk/qmk_firmware

From this link you'll want to clone the QMK repository. Once you've saved it on your computer, you can edit the layout you want in the Planck folder.

I can't really give you step by step instructions because I'm still learning but most of the stuff I've learned has been from poking around through different pages in the guide I posted at the top. I'd like to help more but I don't know enough yet. Best of luck!

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #19 on: Tue, 24 October 2017, 15:41:47 »
I’m trying to alter the standard Planck layout in QMK and have no idea where to start.
What layout do you have in mind?
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Hokabuki

  • Posts: 169
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #20 on: Tue, 24 October 2017, 19:53:36 »
The layouts from top to bottom are default, lower, raise, lower + raise.

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #21 on: Tue, 24 October 2017, 20:32:57 »
The layouts from top to bottom are default, lower, raise, lower + raise.
I’m glad you’re getting help but I would appreciate it if you continued this in your own thread.

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #22 on: Sun, 05 November 2017, 03:41:44 »
Here's your firmware. I also fixed your keymap.c because it required the MAXKEYMAP keymap in order to split 2u keys.
That keymap splits all the 2u into two 1u yet, since I don't own the hardware, I had no idea which of the two 1u is actually wired to the 2u, so I defined either with the same keycode for the Zero and the Enter.
Reading the code will get you a better idea.

One last thing: when you compile, use the -r argument after make.
I got busy and hadn't touched this thing for a while but I seem to have bricked my amjpad. I previously was able to flash the default hex layout but after trying this last one I haven't been able to flash anything else. I've tried to flash it with flip, qmk flasher and qmk toolbox. Flip simply says that it can't read/write to the device, qmk flasher freezes and, strangely, qmk toolbox deletes all its necessary files when I try to flash. Reinstalling qmk toolbox fixes it but I find that reaction the strangest. Is this what usually happens when a keyboard is bricked?

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #23 on: Sun, 05 November 2017, 04:14:16 »
Bricking a keyboard is actually not that easy. If you can put it into bootloader mode you can still flash it.
Assuming you're running Windows, open the device manager, press the reset button on your PCB and see if you device shows up under LibUSB-Win32 Devices.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #24 on: Sun, 05 November 2017, 04:23:53 »
Bricking a keyboard is actually not that easy. If you can put it into bootloader mode you can still flash it.
Assuming you're running Windows, open the device manager, press the reset button on your PCB and see if you device shows up under LibUSB-Win32 Devices.
When I plug it in it doesn't show up but when I press reset it shows up under "Atmel USB Devices" with the name "ATmega32U4". So it does show up but I never hear the connect/disconnect sound what windows normally plays. I don't think I'm able to get it into bootloader mode since I'm not able to flash it with any of the three flashers I have installed. Plus I get the weird QMK toolbox reaction with it essentially uninstalling itself when I try to flash.

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #25 on: Sun, 05 November 2017, 04:34:27 »
Bricking a keyboard is actually not that easy. If you can put it into bootloader mode you can still flash it.
Assuming you're running Windows, open the device manager, press the reset button on your PCB and see if you device shows up under LibUSB-Win32 Devices.
When I plug it in it doesn't show up but when I press reset it shows up under "Atmel USB Devices" with the name "ATmega32U4". So it does show up but I never hear the connect/disconnect sound what windows normally plays. I don't think I'm able to get it into bootloader mode since I'm not able to flash it with any of the three flashers I have installed. Plus I get the weird QMK toolbox reaction with it essentially uninstalling itself when I try to flash.
I get this output when I use QMK flasher

Code: [Select]
dfu-programmer atmega32u4 erase --force
Erasing flash...  Success
Checking memory from 0x0 to 0x6FFF...  Empty.
dfu-programmer atmega32u4 flash D:\Keyboard_Programming\AMJpad hex\amjpad_default.hex
dfu-programmer 0.7.0
https://github.com/dfu-programmer/dfu-programmer
Usage: dfu-programmer target[:usb-bus,usb-addr] command [options] [global-options] [file|data]

global-options:
        --quiet
        --debug level    (level is an integer specifying level of detail)
        Global options can be used with any command and must come
        after the command and before any file or data value

command summary:
        launch       [--no-reset]
        read         [--force] [--bin] [(flash)|--user|--eeprom]
        erase        [--force] [--suppress-validation]
        flash        [--force] [(flash)|--user|--eeprom]
                     [--suppress-validation]
                     [--suppress-bootloader-mem]
                     [--serial=hexdigits:offset] {file|STDIN}
        setsecure
        configure {BSB|SBV|SSB|EB|HSB} [--suppress-validation] data
        get     {bootloader-version|ID1|ID2|BSB|SBV|SSB|EB|
                 manufacturer|family|product-name|
                 product-revision|HSB}
        getfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE}
        setfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE} data

additional details:
 launch: Launch from the bootloader into the main program using a watchdog
         reset.  To jump directly into the main program use --no-reset.
   read: Read the program memory in flash and output non-blank pages in ihex
         format.  Use --force to output the entire memory and --bin for binary
         output.  User page and eeprom are selected using --user and --eprom
  erase: Erase memory contents if the chip is not blank or always with --force
  flash: Flash a program onto device flash memory.  EEPROM and user page are
         selected using --eeprom|--user flags. Use --force to ignore warning
         when data exists in target memory region.  Bootloader configuration
         uses last 4 to 8 bytes of user page, --force always required here.
Note: version 0.6.1 commands still supported.
An error occurred - please try again.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #26 on: Sun, 05 November 2017, 04:37:16 »
Code: [Select]
dfu-programmer atmega32u4 flash D:\Keyboard_Programming\AMJpad hex\amjpad_default.hex
It's not recognizing the blank space.
Do this: go to the dfu-programmer folder and create a .bat file with this code.
Code: [Select]
@echo off
SET dfu=%~dp0dfu-programmer.exe atmega32u4
pause
%dfu% erase --force
%dfu% flash %1
%dfu% reset
pause
All you have to do now is to drag your firmware file on this batch script. It will erase, flash and reset your keyboard automatically.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #27 on: Sun, 05 November 2017, 04:45:11 »
Code: [Select]
dfu-programmer atmega32u4 flash D:\Keyboard_Programming\AMJpad hex\amjpad_default.hex
It's not recognizing the blank space.
Do this: go to the dfu-programmer folder and create a .bat file with this code.
Code: [Select]
@echo off
SET dfu=%~dp0dfu-programmer.exe atmega32u4
pause
%dfu% erase --force
%dfu% flash %1
%dfu% reset
pause
All you have to do now is to drag your firmware file on this batch script. It will erase, flash and reset your keyboard automatically.
This sounds like a silly question but, where might I be able to find the dfu-programmer folder?

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #28 on: Sun, 05 November 2017, 04:47:19 »
where might I be able to find the dfu-programmer folder?
I would look into the QMK flasher folder.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #29 on: Sun, 05 November 2017, 04:55:33 »
where might I be able to find the dfu-programmer folder?
I would look into the QMK flasher folder.
The closest I found was

QMK flasher/resources/app.asar.unpacked/dfu/dfu-prog-usb-1.2.2

I can only create a folder in that folder though, .bat doesn't even come up as an option.

As far as I can see, there's no folder in QMK flasher that is called "dfu-programmer".

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #30 on: Sun, 05 November 2017, 04:57:21 »
Let's set aside the dfu-programmer for a moment then.

Just go to your D:\Keyboard_Programming\AMJpad hex\ folder and remove the blank space between AMJpad and hex, then try flashing again.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #31 on: Sun, 05 November 2017, 05:06:39 »
Let's set aside the dfu-programmer for a moment then.

Just go to your D:\Keyboard_Programming\AMJpad hex\ folder and remove the blank space between AMJpad and hex, then try flashing again.
It works! Many thanks!

I really have to stop naming folders with spaces in them. Now I just have to install Linux to be able to compile layouts... but that's for another time.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #32 on: Sun, 05 November 2017, 05:39:21 »
It works!
Told you that bricking ain't easy.  ;)
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Atredl

  • Thread Starter
  • Posts: 805
  • Location: SoCal
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #33 on: Sun, 05 November 2017, 13:39:49 »
It works!
Told you that bricking ain't easy.  ;)
And I’m thankful for it.

I wonder if the folder with the space was also the reason QMK toolbox was essentially uninstalling itself. It’s one of the most bizarre things I’ve seen happen. Before flashing, all it’s folders and files would be in place. Then after trying to flash it would crash and all its files would be missing. It would do the same thing with the standalone exe version, minus the files of course.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: QMK compiling with MSYS2 MinGW 64-bit trouble
« Reply #34 on: Sun, 05 November 2017, 14:59:02 »
I wonder if the folder with the space was also the reason QMK toolbox was essentially uninstalling itself. It’s one of the most bizarre things I’ve seen happen. Before flashing, all it’s folders and files would be in place. Then after trying to flash it would crash and all its files would be missing. It would do the same thing with the standalone exe version, minus the files of course.
Unlikely. That could be a bug in the software.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff