garinus Posted August 8, 2018 Posted August 8, 2018 Hi, I'm tring to solve an issue on my Orange Pi Zero: at boot time the pins PA18 and PA19 are stucked to Vcc. I tried a lot of solution, now the best result is to add at the beginning of the file boot.cmd the command to clear the gpio configuration: gpio clear PA18 gpio clear PA19 and recompile the boot.scr. Despite this the pins goes HIGH for some seconds until the bootloader reach this line. What is the boot scheme? Why i get this pin HIGH? Is it because the I2C1 is configured? Is it possible to disable it? Thanks Simone
martinayotte Posted August 8, 2018 Posted August 8, 2018 Simply because they could be used as I2C1, there are 2K external pullups located as R153/R154 ... Why this is causing you issues ?
garinus Posted August 9, 2018 Author Posted August 9, 2018 Sorry I check a second time on the schematic and I saw the two resistor. I dissoldered them and now it work as i expected. On these pin i have two relays, so when it turns on the relay switch on for some seconds until or the bootloader or the program takes over the control of the pins. Yesterday I tried other option to clear the pins, I report them here to share: connecting on serial press space on the reboot until the console of the bootloader came up (it shows a line: Autoboot in 1 seconds, press <Space> to stop.) write on the console the command: setenv set-io 'gpio clear PXXX' where PXXX is the pin to clear, (eg. PA18), set instead of clear to set high. is possible to set two or more pins using: setenv set-io 'gpio clear PXXX; gpio clear PXXX' now we add on the line preboot. we need to know what is write on this line so we launch the command: printenv and we read the line preboot, like: preboot=usb start now we store the new command: setenv preboot 'run set-io; usb start' and we save saveenv now is possible to boot and reboot the system as usual from armbian: boot this is for me the command that start first. Does anyone know some command that start before the preboot? Or how to put it at the beginning of the bootloader
Johhny Blue Posted August 13, 2018 Posted August 13, 2018 Can someone help me with a way to set the internal pullup resistors on a couple of gpio's on boot up? I want to use a couple of buttons without external resistors and without the resistors I get random triggers. I want to use command line without something like wiringGPIO Thanks for any help. J.
olivluca Posted August 13, 2018 Posted August 13, 2018 I use sunxi-pio (with the legacy kernel), from the sunxi-tools package #!/bin/bash #PA20, input, pull-up sunxi-pio -m 'PA20<0><1><0><0>'
Johhny Blue Posted August 15, 2018 Posted August 15, 2018 Thanks Olivluca. It worked perfectly for me. J.
Recommended Posts