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-Bluetooth-btusb-support-Zephyr-HCI-devices.patch
Last active October 11, 2020 18:09
Linux btusb patch to avoid validation checks for Zephyr USB HCI
From 5e9ccd2e720f5d01fad5e2b89ec3b3a205a15c0b Mon Sep 17 00:00:00 2001
From: "Peter A. Bigot" <pab@pabigot.com>
Date: Sat, 26 Sep 2020 09:56:07 -0500
Subject: [PATCH] Bluetooth: btusb: support Zephyr HCI devices
The Bluetooth specification requires that a USB HCI primary controller
provide the bulk and interrupt endpoints as interface 1, and a
scalable isochronous endpoint at interface 2. The latter supports the
synchronous connection oriented capability required for Bluetooth
audio.
@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
@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 / 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 / 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 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 / 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 / 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 / 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 / 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),
};