Skip to content

Instantly share code, notes, and snippets.

@eliotb
eliotb / aisgen.py
Last active October 26, 2022 16:35
Tools for working with Texas Instruments COFF and AIS files
#!/usr/bin/env python
'''Read fully linked TI COFF file, and generate AIS format file
Commandline parameters
enable sequential read,
pll and emifb configuration
pinmux configuration
enable checksums
'Eliot Blennerhassett' <[email protected]>
@ryancdotorg
ryancdotorg / frag32.py
Created August 20, 2015 16:27
A FAT32 fragmenter, because I am a horrible person.
#!/usr/bin/env python
import random
import struct
import sys
# Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833
def ppNum(num):
return "%s (%s)" % (hex(num), num)
@gbaman
gbaman / HowToOTG.md
Last active November 3, 2024 17:19
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@pavel-kirienko
pavel-kirienko / arm-bin-to-elf.sh
Last active November 4, 2024 05:18
Converting flat binary into ARM ELF format, useful for firmware uploading via GDB
# The part .data=0x08000000 should be replaced with the correct base offset of the ROM.
# The value 0x08000000 is valid for STM32.
arm-none-eabi-objcopy -I binary -O elf32-little --change-section-address .data=0x08000000 input.bin output.elf
@grinsted
grinsted / drumkit_split64.py
Last active April 18, 2021 22:14
Tool for quickly making drumkits for the novation circuit
# This file contains code to save 64 samples as a syx file for Novation Circuit
#
# * It reads a single long wave file.
# * splits it into 64 equal chunks
# * crops the sound
# * adds a super fast fadein and "an appropriate fadeout". To remove clicks
# * normalizes every sample
# * Saves the whole thing as a syx file.
#
@darconeous
darconeous / rect-starlink-cable-hack.md
Last active November 8, 2024 16:20
Hacking the Rectangular Starlink Dishy Cable