Skip to content

Instantly share code, notes, and snippets.

Cache Rules Everything Around Me

Jay Kickliter JayKickliter

Cache Rules Everything Around Me
View GitHub Profile
JayKickliter /
Last active Jun 19, 2018
Runtime debugging Tock apps
pub unsafe fn reset_handler() {
// Lots of stuff
for (proc_num, proc_) in PROCESSES.as_ref().iter().enumerate() {
match proc_ {
Some(p) => {
load_process_hook(proc_num as u32, p.package_name, p.flash_non_protected_start() as u32)
None => (),
JayKickliter / fosphor_cmdline_client_ci16.diff
Created May 14, 2018
fosphor command-line app to read complex i16 samples from stdin
View fosphor_cmdline_client_ci16.diff
diff --git a/lib/fosphor/Makefile b/lib/fosphor/Makefile
index a8fb3bb..07af0e6 100644
--- a/lib/fosphor/Makefile
+++ b/lib/fosphor/Makefile
@@ -1,6 +1,6 @@
UNAME=$(shell uname)
-CFLAGS=-Wall -Werror -O2 `pkg-config freetype2 glfw3 --cflags` -g
+CFLAGS=-Wall -O2 `pkg-config freetype2 glfw3 --cflags` -g
LDLIBS=`pkg-config freetype2 glfw3 --libs` -lm
# $(CURRENT_DIR) contains the location of this makefile
CURRENT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
JayKickliter /
Created Feb 28, 2018
Generate 'compile_commands.json' in Makefile
%.compdb_entry: %.c
@echo " {" > $@
@echo " \"command\": \"cc $(CFLAGS) $(CPPFLAGS) -c $<\"," >> $@
@echo " \"directory\": \"$(CURDIR)\"," >> $@
@echo " \"file\": \"$<\"" >> $@
@echo " }," >> $@
COMPDB_ENTRIES = $(addsuffix .compdb_entry, $(basename $(SOURCES)))
compile_commands.json: $(COMPDB_ENTRIES)
JayKickliter /
Last active Sep 13, 2017
Generating Tock userland header from rust source

Common rust source for both rust driver and userland code.

use core::intrinsics::transmute;

#[derive(Debug, Clone, Copy)]
pub enum Partnum {
View improved tock userland debug symbols
diff --git a/userland/ b/userland/
index 47e5d9c8..43e41e5c 100644
--- a/userland/
+++ b/userland/
@@ -43,7 +43,7 @@ override ASFLAGS += -mthumb
override CFLAGS += -std=gnu11
override CPPFLAGS += \
- -g\
+ -gdwarf-2\
JayKickliter /
Last active Oct 23, 2017
Debugging MBed nRF52DK board with GDB

Debugging nRF52DK MBed applications with GDB

Step 1 (one time only): replace MBed bootloader with JLink bootloader

  1. Power down nRF52DK
  2. Power up nRF52DK while holding down IF BOOT/RESET button
  3. Drag JLink bootloader binary to BOOTLOADER volume
  4. Power-cycle

At this point, the MBed bootloader has been replaced with JLink's.

JayKickliter /
Last active May 14, 2017
Guides to using Newlib-nano on bare-metal targets
View .clang-format.txt
AlignAfterOpenBracket: Align # If true, horizontally aligns arguments after an open bracket.
AlignConsecutiveAssignments: true # This will align the assignment operators of consecutive lines
AlignConsecutiveDeclarations: true # This will align the declaration names of consecutive lines
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: TopLevel
JayKickliter / Makefile
Last active May 7, 2017
GNU Make: force recompile when flags change
View Makefile
# Make OBJS depend on CPP/C/CXX/LD flags
$(OBJS): $(BUILDDIR)/flags.txt
# Creates a new flags.txt file when flags change
# make will detect this change and force a rebuild of
# all the sources
.PHONY: flags
$(BUILDDIR)/flags.txt: flags
$(Q){ \
TMP=`mktemp`; \
You can’t perform that action at this time.