Skip to content

Instantly share code, notes, and snippets.

View tstellanova's full-sized avatar
💭
growing excited

Todd Stellanova tstellanova

💭
growing excited
View GitHub Profile
@tstellanova
tstellanova / sdr_rpi4_buster.md
Last active September 6, 2021 20:01
Setup SDR on RPi4 buster image
sudo apt-get update --fix-missing
sudo apt-get install -y  screen sox build-essential libconfig++-dev libsox-fmt-mp3 libfftw3-dev librtlsdr-dev libshout3-dev 
sudo timedatectl set-timezone America/Los_Angeles
@tstellanova
tstellanova / particle-cli-install-buster.md
Created February 28, 2021 19:20
Install particle-cli on Raspberry Pi 4 running raspbian buster
sudo apt-get update
sudo apt-get install build-essential libudev-dev
bash <( curl -sL https://particle.io/install-cli )
@tstellanova
tstellanova / rust-serialports.md
Last active February 7, 2021 15:17
Serial port enumeration with rust

Assumes Debian-based linux

  • (install rust, eg sudo snap install --classic rustup on Ubuntu, or via bash command curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
  • Using serialports-rs package
  • requires libudev under linux: sudo apt-get install libudev-dev
  • git clone https://gitlab.com/Susurrus/serialport-rs
  • cargo run --example list_ports
  • With a couple Particle devices attached, output will be something like:
@tstellanova
tstellanova / monolithic_particle_fw.md
Created January 19, 2021 01:45
Build monolithic particle firmware

In the device OS directory

cd main
make PLATFORM=boron MODULAR=n all APPDIR=/path/to/your/app/dir
@tstellanova
tstellanova / particle_serial_term_setings.md
Last active January 7, 2021 19:03
Particle serial logging interactive terminal settings (for eg cloud-debug) using picocom

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
tstellanova / particle_linux_setup.md
Created October 14, 2020 19:16
Setup particle.io 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
tstellanova / ntt_notes.rs
Created August 18, 2020 02:37
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
tstellanova / embedded_bootloader_quirks.md
Last active August 5, 2020 18:00
Embedded board bootloaders and their quirks

Micropython

  • 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
tstellanova / cam_module_learning.md
Created July 7, 2020 20:37
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
tstellanova / atomic_mutex_spin.rs
Created June 25, 2020 19:50
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 {