blinky-timers¶
A program that showcases how to use kernel timers (see Timers) with expiry callbacks in order to blink two leds. One of the leds is toggled every second, while the other led is toggled every two seconds.
Building¶
This program is provided as a cmake project in order to be run on any
USB-enabled EFM32 based device supported by geckOS. 1 Make sure to set the
variables FLASH_ORIGIN, FLASH_LENGTH, RAM_ORIGIN, RAM_LENGTH,
either as command-line arguments (with the -D flag as below) or directly in
the CMakeLists.txt file, depending on the microcontroller your device has
and the size in flash and RAM of the compiled kernel.
$ mkdir build-release && cd build-release
$ cmake -DCMAKE_BUILD_TYPE=Release \
-DFLASH_ORIGIN=0xa000 -DFLASH_LENGTH=0x6000 \
-DRAM_ORIGIN=0x20001000 -DRAM_LENGTH=0x2000 ..
$ make
You should obtain an ELF file with debugging symbols named like the project,
useful for disassembly and debugging, and a .bin file, to be transferred to
geckOS’s mass storage device on bootloader start up.