What is SpaceFN and why you should give it a try
The SpaceFN concept - setting up your space key as a layer switch when held - is probably one of the most useful tweaks in the keyboard hobby. Let me explain how it works. My SpaceFN article on kbd.news made some rounds recently - quite surprisingly given the age of this concept. This piece you're reading is a condensed version of the full post. If you're left with unanswered questions, you'll most likely find the info you're looking for in the original write-up. On my imaginary top list of the most useful keyboard features, tweaks and hacks, SpaceFN would deserve a podium finish for sure. But what makes it so special? In short: SpaceFN is easy to implement, easy to learn, costs nothing, can be used with any keyboard, and can improve your productivity instantly. I will list its benefits below, but can state right at this point that the SpaceFN concept, setting up your space key as a layer switch when held, is clearly one of the most useful tweaks in the keyboard hobby....
Apr 30, 2024
I did everything here:
https://github.com/kiibohd/controller/wiki/Windows-Setup
And the path to my ARM EABI is (no spaces in the path): /usr/local/gcc-arm-none-eabi-5_2-2015q4-20151219-win32/arm-none-eabi/include/c++/5.2.1/debug
I still get the
[ 5%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.o ../main.c:28:19: fatal error: macro.h: No such file or directory
So I've scanned all my harddrive to see if there was a "macro.h" file:
# find /cygdrive/c/ | grep "/macro.h$" /cygdrive/c/cygwin/home/Olivier/tmp/kiibohd-controller/Macro/basic/macro.h /cygdrive/c/cygwin/home/Olivier/tmp/kiibohd-controller/Macro/buffer/macro.h /cygdrive/c/cygwin/home/Olivier/tmp/kiibohd-controller/Macro/PartialMap/macro.h #
My wild guess is that I've not installed a good version of the required tools but I dont see which one.
Then I tried to compile the tmk: infinity-tmk/infinity_ergodox.
after many all files compiled ok it tried to link them:
Compiling suspend.c Compiling printf.c Compiling timer.c Compiling bootloader.c Linking build/ch.elf lto1.exe: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:158 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. lto-wrapper.exe: fatal error: C:\cygwin\usr\local\gcc-arm-none-eabi-5_2-2015q4-20151219-win32\bin\arm-none-eabi-gcc.exe returned 1 exit status compilation terminated. c:/cygwin/usr/local/gcc-arm-none-eabi-5_2-2015q4-20151219-win32/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: error: lto-wrapper failed collect2.exe: error: ld returned 1 exit status tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/rules.mk:238 : la recette pour la cible « build/ch.elf » a échouée make: *** [build/ch.elf] Erreur 1
INTERNAL COMPILER ERROR.......
What should I do now?
The wiki instructions seem a bit wrong too, https://github.com/kiibohd/controller/wiki/Building says to use wincmake instead of make which 100% won't work since those are different steps in the build process.
I haven't tested the bin file to ensure it functions appropriately, but I have got it building a bin successfully. I had to install a few more things, notably pkg-config, and build dfu-util from source to sign the bin file. So do the usual, setup-x86_64.exe to install pkg-config. git clone git://git.code.sf.net/p/dfu-util/dfu-util to get dfu-util, then make, make install to get that where the controller cmake script can find it.
Then what I did was edit the CMakeLists.txt from the cloned controller directory, and set the right chip, ScanModule, BaseMap, DefaultMap, and PartialMaps. You don't need to do this as you can set them from the command line, but this is probably the easier way.
What you then need to do is make a build dir, just mkdir build from controller/ and get into it. Then if you edited CMakeLists you just need to wincmake .., otherwise you will want to run (for the default layout) wincmake -DCHIP=mk20dx256vlh7 -DScanModule=MDErgo1 -DBaseMap="defaultMap leftHand slave1 rightHand" -DDefaultMap="mdergo1Overlay lcdFuncMap" -DPartialMaps="iced_func iced_numpad" .. make At that point you should have a nicely built .bin file; for reference, as of when I built this the SRAM and Flash were at 13% and 16% used and kiibohd.dfu.bin was 42480 bytes. Note that this will only be built for the left side. If you want the right side you'd probably want a different build directory and just change DefaultMap to flip the order to rightHand then leftHand. (oddly when I built a righthand bin the size is smaller? not sure what is going on there and I still haven't tested either of the bin files to ensure they work edit: this seems to be correct actually, configurator bin files are not the same size for both right and left)
EDIT: Oh one last thing, if you have the wincmake alias set correctly, what you can do is in controller/Keyboards/cmake.bash change the cmake invocation to wincmake, and then run the script like so: bash -i ergodox.bash That will create ICED-L and ICED-R build dirs in controller/Keyboards and build both bin files with the default layout. Any keymap changes or extra layers at this point are up to you. bash -i is necessary because otherwise the alias won't expand and bash won't know wtf wincmake is.
Whew. I haven't even had a chance to try putting TMK on there instead.