Kimberly Posted July 14, 2016 Share Posted July 14, 2016 Hi, I'm using banana pi m1+ with armbian legacy kernel. I'm building an application with c sharp and using mono to run in in the banana pi. My application needs to change gpio output levels multiple times while running, so I installed bcm2835 library in the banana pi to control the output level from the application. Using the library, I was able to control those as I want, but I'd noticed that there are default gpio output levels, which are different from each gpio pins. I'm using CON3-P36 and CON3-P38. Right after the boot up, CON3-P38 goes high, while CON3-P36 goes low. I want to adjust the CON3-P38 to go low in the boot up, so that both two have low output as default. I tried changing fex configuration in the script.bin file. In the [gpio_para] section, there is configuration for each gpio like this. gpio_pin_38 = port:PE01<1><default><default><default> I guessed the last <default> would be for the output level, so tried changing it to <0>, but did not change anything. Is there any way to set the default gpio output level? Link to comment Share on other sites More sharing options...
tiamat Posted October 29, 2017 Share Posted October 29, 2017 @Kimberly Did you solve your problem? I'm also struggling with initial gpio mode and state. Is it possible to easily set those settings without modifications of script.bin or dtb file? In my case my Banana Pro controls light relays and after, eg. power outage the gpio's gets default settings, which leads to incorrect relays state. Currently I'm storing gpio state and mode in some file and restore it on boot in rc.local, but it is not the best solution since invalid relay state persist for about 1 minute (until boot process reach rc.local script). This is really annoying especially in the night when eg. at 2:00 AM, lights in my bedroom turns on Link to comment Share on other sites More sharing options...
martinayotte Posted October 29, 2017 Share Posted October 29, 2017 This guide will help for Legacy script.bin : http://linux-sunxi.org/Fex_Guide For Mainline DT, you should read this : https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt Link to comment Share on other sites More sharing options...
Recommended Posts