Skip to content

Instantly share code, notes, and snippets.

@niun
Created October 24, 2014 14:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save niun/f8443db5bbfaaf02b026 to your computer and use it in GitHub Desktop.
Save niun/f8443db5bbfaaf02b026 to your computer and use it in GitHub Desktop.
Create custom device tree blob to configure Raspberry Pi pins on early boot time
apt-get install device-tree-compiler
wget https://raw.githubusercontent.com/raspberrypi/documentation/master/configuration/images/dt-blob.dts
# for example, set P1:26 (BCM pin 7) to active low (on Raspi B Rev2.0, in dts file from August):
awk 'NR==104{print " pin@p7 { function = \"output\"; termination = \"pull_down\"; }; // SPI_CE1_N (P1:26)"}1' dt-blob.dts > dt-blob-mod.dts
dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-mod.dts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment