Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Custom QMK Layout and Boot Times #77

Open
hellmind opened this issue Nov 1, 2023 · 13 comments
Open

Issues with Custom QMK Layout and Boot Times #77

hellmind opened this issue Nov 1, 2023 · 13 comments

Comments

@hellmind
Copy link

hellmind commented Nov 1, 2023

I attempted to utilize https://config.qmk.fm/#/kinesis/kint41/LAYOUT to design and compile my own layout.
It functions, but not as efficiently as the default hex file.
The default hex layout boots instantly, while mine takes about 10 seconds.
What might be the issue?
I also tried the following:

git clone https://github.com/qmk/qmk_firmware.git
Then compiled the default, but the file size isn't the same as the default provided, and when I flash it, the boot time extends to 10 seconds.

What could be causing this?
Perhaps I should compile my custom layout with a customized version of QMK?

@hellmind hellmind changed the title My hex runs slow, like 10 seconds to boot. Issues with Custom QMK Layout and Boot Times Nov 1, 2023
@aleb
Copy link
Contributor

aleb commented Nov 2, 2023

The default one you used was compiled by you?

@stapelberg
Copy link
Contributor

The default version linked from https://github.com/kinx-project/kint are pretty old builds at this point.

You can try building an equally old QMK, then upgrade to a newer QMK to see if the problem is with the firmware itself or with the configuration.

@hellmind
Copy link
Author

hellmind commented Nov 2, 2023

The default one you used was compiled by you?

I tried both, the default compiled by me, was like 3 times the size of https://github.com/kinx-project/kint/blob/main/default-firmware/kinesis_kint41_default.hex and boots slow.

Also I compiled it using my own linux and the configurator site withe same results.
The only firmware that boots correctly is: https://github.com/kinx-project/kint/blob/main/default-firmware/kinesis_kint41_default.hex

The default version linked from https://github.com/kinx-project/kint are pretty old builds at this point.

You can try building an equally old QMK, then upgrade to a newer QMK to see if the problem is with the firmware itself or with the configuration.

How can I do that?

@stapelberg
Copy link
Contributor

I tried both, the default compiled by me, was like 3 times the size of https://github.com/kinx-project/kint/blob/main/default-firmware/kinesis_kint41_default.hex and boots slow.

Okay, so it sounds like the problem isn’t the configuration, but the software version then.

You can try building an equally old QMK, then upgrade to a newer QMK to see if the problem is with the firmware itself or with the configuration.

How can I do that?

I would recommend using git to check out an older version of QMK. You can try git checkout 0.22.13 to check out version 0.22.13, for example. Try narrowing down the problem to a version that works well and the first following version that introduces the problematic behavior.

@hellmind
Copy link
Author

hellmind commented Nov 4, 2023

I found that the problem appears with any version starting from 0.22. Version 0.21.7 works fine.
I still need to compile my custom layout that I created with the QMK Configurator page. Using version 0.21.7, I'm not sure how to use the downloaded JSON file.

@stapelberg
Copy link
Contributor

I found that the problem appears with any version starting from 0.22. Version 0.21.7 works fine.

Okay, great that we now have a version range.

If you want to go one step further, you can use “git bisect” to find the exact git commit between these two versions that introduced the problem. This will go a long way to getting the QMK developers to take the problem seriously.

@hellmind
Copy link
Author

hellmind commented Nov 4, 2023

This is the result:

qmk_firmware (173f54c) (BISECTING) [!?] via C v13.2.1-gcc via 🐍 v3.11.5 took 5s ➜ git bisect good
416af0171c6433a7ecb198386dd2c3ac70d4cbd2 is the first bad commit
commit 416af0171c6433a7ecb198386dd2c3ac70d4cbd2
Author: Nick Brassel <nick@tzarc.org>
Date:   Sat Jun 24 05:31:25 2023 +1000

    Remove CORTEX_ENABLE_WFI_IDLE from keyboards. (#21353)

    * Remove CORTEX_ENABLE_WFI_IDLE from the codebase.

    * Turn on CORTEX_ENABLE_WFI_IDLE by default.

Also, how can I compile my QMK Configurator keymap.json with an older version? I tried converting it to keymap.c and downloading the entire QMK Configurator project to obtain that keymap.c, but neither method worked.

@hellmind
Copy link
Author

hellmind commented Nov 4, 2023

Commenting

#ifndef CORTEX_ENABLE_WFI_IDLE

define CORTEX_ENABLE_WFI_IDLE TRUE

#endif // CORTEX_ENABLE_WFI_IDLE

from platforms/chibios/chibios_config.h
fixed my problem

I was able to compile my keymap layout (converted from JSON to C) downloaded from QMK Configurator using the latest QMK firmware version.

Thank you,

@isaacgale
Copy link

I've noticed a similar thing. I'm using 21.6 if I pull latest from master compile and flash my keymap it seems to brick my keyboard (it becomes unresponsive) until I re-flash it with my older complied keymap. I'm using a teensy 4.1 without ethernet.

I wanted to go to latest so I could use Caps Word with Key overrides. But ended up just cherry-picking that commit to my 21.6 based branch for now.

@isaacgale
Copy link

isaacgale commented Dec 3, 2023

It looks like you should be able to set OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=FALSE in your rules.mk file instead of commenting out the above. I was going to test this out but I see the layout has also changed now according to 'kinesis: remove stacked split layouts (#21569)' 18251eb8da78485507a58c177c3635da88b935cb

I don't currently have the time to rework my layout right now.

I can confirm that adding the above does fix the booting issue. The teensy 4.1 doesn't like that setting.

@hellmind
Copy link
Author

hellmind commented Dec 6, 2023

great,
how can we update qmk to introduce that fix ?

It looks like you should be able to set OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=FALSE in your rules.mk file instead of commenting out the above. I was going to test this out but I see the layout has also changed now according to 'kinesis: remove stacked split layouts (#21569)' 18251eb8da78485507a58c177c3635da88b935cb

I don't currently have the time to rework my layout right now.

I can confirm that adding the above does fix the booting issue. The teensy 4.1 doesn't like that setting.

@hellmind hellmind closed this as completed Dec 6, 2023
@hellmind hellmind reopened this Dec 6, 2023
@isaacgale
Copy link

isaacgale commented Dec 6, 2023

@hellmind I'm not really sure what is involved here in getting a PR accepted into the official QMK repo. Also it would probably be good to understand why this setting has a negative impact on the Teensy 4.1. I know nothing about the ChibiOS so it's not something I could 'quickly' investigate.

I just forked the QMK repo and created my own personal keymap (programmer dvorak) along with the setting I mentioned above. My fork can be found here if interested

@stevenbetten
Copy link

I created qmk/qmk_firmware#23053 and qmk/qmk_firmware#23054 to address this for kint41. I don't have any pre-4.1 teensy controllers so I cannot test them and thus did not make any changes to kintlc, kint35, or stapelberg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants