Skip to content

Instantly share code, notes, and snippets.

growing excited

Todd Stellanova tstellanova

growing excited
View GitHub Profile
tstellanova /
Created Nov 22, 2020
Particle serial logging interactive terminal settings (for eg cloud-debug)

Serial logger output tends to be ugly on raw terminal because of missing carriage returns. With picocom you can map raw LFs to CRLF:

picocom -b 115200 --imap lfcrlf  /dev/ttyACM0
tstellanova /
Created Oct 14, 2020
Setup dev env on linux bionic
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded
tstellanova /
Created Aug 18, 2020
number theoretic transform
pub trait FFT: Sized + Copy {
type F: Sized
+ Copy
+ From<Self>
+ Neg
+ Add<Output = Self::F>
+ Div<Output = Self::F>
+ Mul<Output = Self::F>
+ Sub<Output = Self::F>;
tstellanova /
Last active Aug 5, 2020
Embedded board bootloaders and their quirks


  • Source code
  • Allows firmware update via USB (and possibly other methods?)
  • The is 128 kB minimum, some boards reserve 256 kB (eg OpenMV)
  • The jump address varies depending on the board
  • Example: OpenMV H7 board bootloader is 128 kB in size, reserves 256 kB in flash, and has an application jump address of 0x8040000
tstellanova /
Created Jul 7, 2020
Learning about camera modules

There are a million camera modules out there. Many support a common hardware interface:

  • A set of parallel data lines that provide image (pixel) data
  • A set of scan line and frame synchronization output lines (horizontal and vertical sync, and pixel clock)
  • A low-speed two-wire (i2c) configuration and control interface
  • A clock input. Many of these modules do not have their own hardware clock connected: instead they rely upon a microcontroller or the CPU they're attached to to provide a clock.

Fun fact

When you connect the i2c lines of the module to, say, a linux i2c bus and run, say, sudo i2cdetect -y 1,

tstellanova /
Created Jun 25, 2020
Simple mutex using spin lock with atomics in no_std rust
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
struct MyStruct {
/// A mutability lock
mut_lock: AtomicBool,
impl Struct {
tstellanova /
Last active Jun 13, 2020
Installing adsbexchange feeder software on rock64 with Armbian buster

Install Armbian

  • I flashed armbian buster to the eMMC (64 GB)
  • Setup custom hostname
  • Enable avahi for hostname.local ssh access (using armbian-config System/Avahi)

Install readsb dependencies

Install some library dependencies

sudo apt-get install libad9361-dev libiio-dev librtlsdr-dev dh-systemd libfam0 lighttpd
tstellanova /
Created Jun 5, 2020
stm32f3xx_hal serial reading sample
let ( _tx, mut rx) = serial_port.split();
loop {
let mut err_count = 0;
let mut block_count = 0;
let mut burst_count = 0;
loop {
let rc =;
tstellanova /
Last active Jun 2, 2020
Setup python environment for debian 2020
  • Install pyenv
    • Install dependencies:
    sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
    • Install pyenv:
    curl -L | bash
    export PATH="$HOME/.pyenv/bin:$PATH"
tstellanova / atsame70.gdb
Created Jun 2, 2020
gdb configuration for atsame70
View atsame70.gdb
target extended-remote :3333
# print demangled symbols
set print asm-demangle on
# set backtrace limit to not have infinite backtrace loops
set backtrace limit 32
# detect unhandled exceptions, hard faults and panics
#break DefaultHandler
You can’t perform that action at this time.