Re "why it's not mentioned anywhere in the documentation": It is likely for historical reasons.
The old underpowered microcontroller ATmega32U4 only has 1 KB for this (physical EEPROM memory), so it would not make sense to increase it.
And documentation is, well, not a priority for the QMK project.
The Vial documentation does mention it, but only for decreasing it (again due to the severe resource limitations of the ATmega32U4). That is, they fail to mention that it very much makes sense to increase it for the modern microcontrollers. Documentation is not a priority for the Vial project either.
It's no more in vial documentation either I just checked, and sadly I know about pro micro acrobatics, it was trying to fit vial in my first handwired macropad that I came across that setting... I'm very happy about rp2040 now
But QMK Configurator can't do it. And even if it could, I don't think any of the wireless Keychron keyboards are supported (because their source code is not part of the main QMK repository, but in a fork).
It is required to directly change source code files, compile, and flash. This requires setting up the QMK development environment, changing source code files, compiling from source code, and flashing the firmware. Are you prepared to do that? (not a rhetorical question). Note that, due to the fork, the QMK standard instructions will not work (though it can still be done by adding three extra parameters).
Changing the size for Via macros
For the size, change "logical_size" and "backing_size" in file info.json. For example, to about 20 KB allocated to Via macros:
"logical_size": 20480,
"backing_size": 40960
It is the total, as the (emulated) EEPROM is also used for other things than Via macros.
(Fun fact: It used to bepreprocessor symbol 'WEAR_LEVELING_LOGICAL_SIZE' in file 'config.h', but there is an on-going move to so-called data-driven configuration, and it was like this for the K3 Max from the get-go (source code released 2024-01-31).)
K3 Max source code. Note: In Keychron's fork and in that fork, in Git branch "wireless_playground" (not the default branch). No matter the Git branch, for example, "wireless_playground", it requires special setup of QMK (the standard QMK instructions and many other guides will not work (because they implicitly assume the main QMK repository)).
Though changing the values in file 'info.json' may not have any effect (it would have to be tested on a case-by-case basis). Also, it will likely be dependent on the source code version (at least on a future version as it is expected to be fixed sooner or later, though it may take years).
For the default ratio of 2:1, the theorecial maximum is thus 32 KB for Via macros. But the other parts of the keyboard also requires RAM. Thus the actual limit is somewhat lower.
1
u/itsvar8 Aug 21 '24 edited Aug 21 '24
I never used the configurator but to change the number of macros you have to put # define DYNAMIC_KEYMAP_MACRO_COUNT xx in config.h (replace x with number). I've never understood why it's not mentioned anywhere in the documentation but it's in the code https://github.com/qmk/qmk_firmware/blob/master/quantum/dynamic_keymap.c if you see at line 43, if not defined set it to 16. Edit: found it https://github.com/Keychron/qmk_firmware/tree/wireless_playground/keyboards/keychron/k3_max
1
u/PeterMortensenBlog V Aug 21 '24 edited Oct 14 '24
It is possible to change both
But QMK Configurator can't do it. And even if it could, I don't think any of the wireless Keychron keyboards are supported (because their source code is not part of the main QMK repository, but in a fork).
It is required to directly change source code files, compile, and flash. This requires setting up the QMK development environment, changing source code files, compiling from source code, and flashing the firmware. Are you prepared to do that? (not a rhetorical question). Note that, due to the fork, the QMK standard instructions will not work (though it can still be done by adding three extra parameters).
Changing the size for Via macros
For the size, change "logical_size" and "backing_size" in file info.json. For example, to about 20 KB allocated to Via macros:
It is the total, as the (emulated) EEPROM is also used for other things than Via macros.
(Fun fact: It used to be preprocessor symbol 'WEAR_LEVELING_LOGICAL_SIZE' in file 'config.h', but there is an on-going move to so-called data-driven configuration, and it was like this for the K3 Max from the get-go (source code released 2024-01-31).)
References
1
u/PeterMortensenBlog V Aug 21 '24 edited Aug 21 '24
Re "I believe space can be changed to 128 KB": Not quite. There is "backing size" which is in RAM, and it is by default twice the size.
Thus it is limited by the RAM.
The product page says STM32F402 (256 KB flash memory), and I think it has 64 KB RAM. Though there is some confusion. Datasheet in Chinese.
For the default ratio of 2:1, the theorecial maximum is thus 32 KB for Via macros. But the other parts of the keyboard also requires RAM. Thus the actual limit is somewhat lower.
An alternative is some external hardware (that doesn't require backing in RAM).
1
u/PeterMortensenBlog V Aug 21 '24
Related: