Skip to content

Instantly share code, notes, and snippets.

View pabigot's full-sized avatar

Peter A. Bigot pabigot

View GitHub Profile
@pabigot
pabigot / 0001-drivers-timer-nrf_rtc_timer-clarify-intent-of-ZLI-co.patch
Last active August 19, 2019 16:12
diagnostics patch for zephyrproject-rtos/zephyr issue 17965
From 56036a278ba819bdabf3b32f580d9ecd51123db7 Mon Sep 17 00:00:00 2001
From: Peter Bigot <[email protected]>
Date: Mon, 19 Aug 2019 11:00:00 -0500
Subject: [PATCH] drivers/timer/nrf_rtc_timer: clarify intent of ZLI
compensation
The variable enabling entry to the zero latency interrupt compensation
loop was named generically, and its logic inverted, making the code
difficult to understand. Change the name and initial value to more
clearly indicate its role.
@pabigot
pabigot / fragment.c
Last active January 8, 2020 14:21
example of service request with reset attempt for zephyrproject-rtos/zephyr pr #21090
int err;
struct k_poll_signal sig;
struct onoff_client cli;
/* Blocking start using signal */
struct k_poll_event evts[] = {
K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SIGNAL,
K_POLL_MODE_NOTIFY_ONLY,
&sig),
};
@pabigot
pabigot / named.txt
Created January 17, 2020 16:14
fragments to get a named phandle reference
/* binding */
description: whatever
compatible: "something,switch"
properties:
gpios:
type: phandle-array
required: true
gpio-names:
type: string-array
required: false
@pabigot
pabigot / gist:e1851e261cea5881fab01743f65ef61c
Created February 20, 2020 16:14
zephyr devicetree macro name structure
<name> ::= 'DT_' <node-id> [ '_' <suffix> ];
<init-id> ::= [A-Z]
<id-char> ::= [A-Z0-9]
<decimal> ::= [0-9]+ ;
<hexadecimal> ::= [0-9a-f]+ ;
<identifier> ::= <init-id> <id-char>* ;
<long-identifier> ::= <identifier> ( '_' <identifier> )* ;
@pabigot
pabigot / ship.patch
Created March 20, 2020 15:55
zephyr increase shippable minions
diff --git a/.shippable.yml b/.shippable.yml
index fa33363380..12eea27ef6 100644
--- a/.shippable.yml
+++ b/.shippable.yml
@@ -6,13 +6,36 @@ env:
global:
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.11.2
- ZEPHYR_TOOLCHAIN_VARIANT=zephyr
- - MATRIX_BUILDS="5"
+ - MATRIX_BUILDS="28"
@pabigot
pabigot / main.c
Created April 21, 2020 20:16
zephyr issue 24372
#include <zephyr.h>
#include <sys/printk.h>
#include <data/json.h>
typedef struct {
char *id;
uint32_t d;
uint8_t t;
} data_first;
@pabigot
pabigot / CMakeLists.txt
Last active April 27, 2020 11:46
test case for zephyrproject/zephyr#23998
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(NONE)
target_sources(app PRIVATE src/main.cxx)
@pabigot
pabigot / main.c
Created June 11, 2020 14:07
Sample with button and power management
/*
* Copyright (c) 2020 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*
*/
#include <zephyr.h>
#include <device.h>
#include <drivers/gpio.h>
@pabigot
pabigot / eval-flash.sh
Last active June 19, 2020 12:16
const device comparisons zephyr issue
#!/bin/sh
CONST_REF=nordic/issue/22941a
SUBOBJ_REF=nordic/20200611a
BASE_REF=$(git merge-base ${CONST_REF} ${SUBOBJ_REF})
build () {
tag=$1 ; shift
ref=$1 ; shift
args="${@}"
@pabigot
pabigot / rpti3b
Created August 24, 2020 10:13
meta-raspberrypi issue 706
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.58-v7 (oe-user@oe-host) (gcc version 10.2.0 (GCC)) #1 SMP Tue Aug 18 10:43:46 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Plus Rev 1.3
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x1ec00000, size 256 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] percpu: Embedded 20 pages/cpu s50252 r8192 d23476 u81920