Skip to content

Instantly share code, notes, and snippets.

View teburd's full-sized avatar

Tom Burdick teburd

View GitHub Profile
@teburd
teburd / default.nix
Last active December 4, 2020 00:08
{ pkgs ? import <nixpkgs> {
overlays = [
( self: super: {
libnats-c = super.libnats-c.override rec {
version = "2.3.0";
src = super.fetchFromGitHub {
owner = "nats-io";
repo = "nats.c";
rev = "refs/tags/v${version}";
[nix-shell:~/oes/openfmb.adapters/nix]$ env | grep CMAKE_
CMAKE_INCLUDE_PATH=/nix/store/p4651hzjlvghlwym1fq931cz26qdp2ir-openssl-1.1.1g-dev/include:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1/include:/nix/store/p4651hzjlvghlwym1fq931cz26qdp2ir-openssl-1.1.1g-dev/include:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1/include
CMAKE_PREFIX_PATH=/nix/store/r9djcvv9hh6cma006jxlcz3xljz7zck0-cmake-3.18.2:/nix/store/vxfscsxa34n8wrvhkpdm1027rd5n92jf-pkg-config-wrapper-0.29.2:/nix/store/qza56yd923g39sbnn6gn5xh3awrz4lfl-patchelf-0.12:/nix/store/8madhhcxhxlf0rrc5hdsk65l206r3cc6-gcc-wrapper-9.3.0:/nix/store/h770niqkf08ksgm0n6a271kc21w95b13-binutils-wrapper-2.31.1:/nix/store/p4651hzjlvghlwym1fq931cz26qdp2ir-openssl-1.1.1g-dev:/nix/store/wp81dnxgrpi4lgy20r82kfg9nwrmypkm-openssl-1.1.1g-bin:/nix/store/7figba9q8yrgz4gj9yhqgjri97h9snsb-openssl-1.1.1g:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1:/nix/store/r9djcvv9hh6cma006jxlcz3xljz7zck0-cmake-3.18.2:/nix/store/vxfscsxa34n8wrv
conan install --build=missing ..
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=16
os=Windows
tburdick@jupiter  ~/src/probe-rs   master ●  RUST_LOG=debug ./target/debug/probe-rs-cli info  ✔  10101  12:53:38
DEBUG jaylink > libusb 1.0.23.11397
DEBUG jaylink > libusb has capability API: true
DEBUG jaylink > libusb has HID access: true
DEBUG jaylink > libusb has hotplug support: true
DEBUG jaylink > libusb can detach kernel driver: true
DEBUG probe_rs::probe::daplink > Opening daplink
DEBUG probe_rs::probe::daplink::tools > Getting sn_str for device Bus 003 Device 002: ID 8087:8000
DEBUG probe_rs::probe::daplink::tools > Error getting device handle read_languages, Pipe
Error: Probe could not be created
error[E0277]: the size for values of type `(dyn std::error::Error + std::marker::Send + 'static)` cannot be known at compilation time
--> src/bus.rs:61:57
|
61 | SubscriptionError::DecodeError(err) => Some(&err as &(dyn Error + 'static)),
| ^^^^ doesn't have a size known at compile-time
tburdick@jupiter  ~/src/imxrt1060evk-bsp/examples   master ● ?  cargo objcopy --bin led --release -- -O binary led.bin  ✔  10597  16:45:43
Compiling imxrt1060evk-bsp v0.1.0 (/barn/tburdick/src/imxrt1060evk-bsp)
Compiling imxrt1060evk-examples v0.1.0 (/barn/tburdick/src/imxrt1060evk-bsp/examples)
Finished release [optimized + debuginfo] target(s) in 0.45s
/home/tburdick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objcopy: error: '/barn/tburdick/src/imxrt1060evk-bsp/examples/target/thumbv7em-none-eabihf/release/led': 'led.bin': Invalid argument
tburdick@jupiter  ~/src/imxrt1060evk-bsp/examples   master ● ?  cargo objcopy --bin led --release -- -O ihex led.bin
@teburd
teburd / main.rs
Created November 19, 2019 18:59
main.rs
/#![deny(warnings)]
#![no_std]
#![no_main]
use cortex_m_semihosting::hprintln;
use panic_halt as _;
use rtfm::cyccnt::{Instant, U32Ext as _ };
use stm32f4xx_hal::i2c::I2c;
use stm32f4xx_hal::prelude::*;
use stm32f4xx_hal::stm32;
total 373M
drwxr-xr-x 5 root root 1.0K Oct 11 01:10 .
drwxr-xr-x 26 root root 4.0K Oct 9 16:54 ..
-rw-r--r-- 1 root root 213K Sep 18 00:12 config-4.15.0-65-generic
-rw-r--r-- 1 root root 212K Sep 27 14:24 config-4.15.18
drwx------ 2 root root 512 Jan 1 1970 efi
drwxr-xr-x 5 root root 1.0K Oct 9 16:54 grub
-rw-r--r-- 1 root root 356M Sep 27 14:26 initrd.img-4.15.18
drwx------ 2 root root 12K Sep 23 13:37 lost+found
-rw-r--r-- 1 root root 179K Jan 28 2016 memtest86+.bin
Processing triggers for initramfs-tools (0.130ubuntu3.8) ...
update-initramfs: Generating /boot/initrd.img-4.15.18
gzip: stdout: No space left on device
E: mkinitramfs failure find 141 cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.15.18 with 1.
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
initramfs-tools
@teburd
teburd / playground.rs
Created August 3, 2019 17:32 — forked from rust-play/playground.rs
Code shared from the Rust Playground
struct MsgReader<'a> {
tx: &'a RoTransaction,
buf: &'a [u8];
buf_reader: BufReader<&'a [u8]>,
msg: capnp::message::Reader<'a, OwnedSegments>,
}
fn get<'a>(tx: &'a RoTransaction, id: u64) -> MsgReader<'a>
{
let buf = tx.get(id);