You can of course edit the config to make the pin low on boot, and set other options as well.
Create an overlay file: nano mygpio-overlay.dts You can change the name if you like, you'll just need to change the commands later to reflect this.
Add the following code to the file:
Code: Select all
/dts-v1/;
/plugin/;
/ {
videocore {
pins_3b2 { // Pi 3 Model B rev 1.2
pin_config {
pin@default {
polarity = "active_high";
termination = "pull_down";
startup_state = "inactive";
function = "input";
}; // pin
pin@p6 { function = "input"; termination = "no_pulling"; drive_strength_mA = < 8 >; };
pin@p13 { function = "output"; termination = "pull_up"; drive_strength_mA = < 8 >; startup_state = "active"; };
}; // pin_config
}; // pins
};
};
Use this page as a reference to edit the file as needed to fit your Raspberry Pi model and GPIO pin needs: https://www.raspberrypi.org/documentati ... uration.md
There is a newer blob example file here: https://github.com/raspberrypi/firmware ... t-blob.dts It appears to cover all revisions of the Raspberry Pi so far.
In my example I'm using a Raspberry Pi 3 B rev 1.2. If you were using a Raspberry Pi Zero you would change pins_3b2 in line 6 to pins_pi0
Once you are finished editing the file above, save it then compile it with
Code: Select all
dtc -@ -I dts -O dtb -o mygpio-overlay.dtb mygpio-overlay.dtsCode: Select all
sudo cp mygpio-overlay.dtb /boot/overlaysCode: Select all
device_tree_overlay=overlays/mygpio-overlay.dtb