A basic macro keyboard built from the ground up
To setup your own macro bindings, create a file key_mappings.h
in the code/src
directory with the below format. This file will be automatically detected and included in the build.
When editing, be sure to do a clean build to ensure headers are re-included.
#ifndef __KEY_MAPPINGS_H
#define __KEY_MAPPINGS_H
// This will generate a unique GUID following the V4 spec
#define MACRO_KEY_0 GenerateGuid(MacroContext);WriteString(MacroContext, "\e")
// These output the given string
#define MACRO_KEY_1 WriteString(MacroContext, "Macro 1\n")
#define MACRO_KEY_2 GenerateGuid(MacroContext);WriteString(MacroContext, "\e\nMacro 2");
#define MACRO_KEY_3 WriteString(MacroContext, "\t\tMacro 3")
// And so on for the rest of the keys...
#endif
The toolchain is required to compile for the STM32 target platform
brew tap osx-cross/arm
brew install arm-gcc-bin
If you are using ST-Link
brew install stlink
If using J-Link, you also need to install the J-Link tools. You can download them from Segger here https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack
Run the build
make
Flash to device using ST-Link
make flash-stlink
or using J-Link
make flash-jlink
Inspect memory layout of image
arm-none-eabi-nm main.elf
st-util
JLinkGDBServer -if swd -device STM32F042K6 -port 4242
cd ./code
arm-none-eabi-gdb main.elf
target extended-remote :4242
load
continue
Ctrl^C
info registers
stepi
info registers
quit