I'd like to add an overlay to alter the standard compute module GPIO settings without resorting to a custom device tree blob or adding in a load of raspi-gpio commands during startup
If I've understood the device tree overlay system correctly I should be able to apply an overlay file to alter these settings and add the overlay as an add-on at the bottom of config.txt
So far looking at basic device tree file I've determined what lines I would need to edit out of the main dts file if I were to go for a custom blob as a starting point, however I'm a bit lost as to what I need to wrap the below into turn this into a valid overlay file
Code: Select all
pin@p34 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_high"; };
pin@p35 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
pin@p36 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
pin@p39 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
pin@p44 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
Code: Select all
/dts-v1/;
/ {
videocore {
pins_cm {
pin_config {
pin@p34 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_high"; };
pin@p35 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
pin@p36 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
pin@p39 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
pin@p44 { function = "output"; termination = "no_pulling"; startup_state = "inactive"; polarity = "active_low"; };
}; // pin_defines
}; // pins_cm
}; // videocore
};
Code: Select all
vcdbg log msg
<snip>
002045.785: Loaded overlay 'systemgpio'
<snip>
Code: Select all
raspi-gpio get
<snip>
GPIO 34: level=1 fsel=0 alt= func=INPUT
GPIO 35: level=1 fsel=0 alt= func=INPUT
GPIO 36: level=1 fsel=0 alt= func=INPUT
GPIO 37: level=0 fsel=0 alt= func=INPUT
GPIO 38: level=0 fsel=0 alt= func=INPUT
GPIO 39: level=0 fsel=0 alt= func=INPUT
GPIO 40: level=0 fsel=0 alt= func=INPUT
GPIO 41: level=0 fsel=0 alt= func=INPUT
GPIO 42: level=0 fsel=0 alt= func=INPUT
GPIO 43: level=0 fsel=0 alt= func=INPUT
GPIO 44: level=0 fsel=0 alt= func=INPUT
<snip>
Thanks in advance