Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
growing excited

Todd Stellanova tstellanova

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

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 Oct 14, 2020
Setup particle.io dev env on linux bionic
View particle_linux_setup.md
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 Aug 18, 2020
number theoretic transform
View ntt_notes.rs
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 Aug 5, 2020
Embedded board bootloaders and their quirks
View embedded_bootloader_quirks.md

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 Jul 7, 2020
Learning about camera modules
View cam_module_learning.md

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 Jun 25, 2020
Simple mutex using spin lock with atomics in no_std rust
View atomic_mutex_spin.rs
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
struct MyStruct {
...
/// A mutability lock
mut_lock: AtomicBool,
}
impl Struct {
@tstellanova
tstellanova / adsbx_armbian.md
Last active Jun 13, 2020
Installing adsbexchange feeder software on rock64 with Armbian buster
View adsbx_armbian.md

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
tstellanova / stm32f3xx_hal_serial_read_sample.rs
Created Jun 5, 2020
stm32f3xx_hal serial reading sample
View stm32f3xx_hal_serial_read_sample.rs
let ( _tx, mut rx) = serial_port.split();
rprintln!("loopstart!");
loop {
let mut err_count = 0;
let mut block_count = 0;
let mut burst_count = 0;
loop {
let rc = rx.read();
@tstellanova
tstellanova / python_env_poetry_2020.md
Last active Jun 2, 2020
Setup python environment for debian 2020
View python_env_poetry_2020.md
  • 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 https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
    export PATH="$HOME/.pyenv/bin:$PATH"
    
@tstellanova
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.