mustafa_meta Posted March 19, 2020 Posted March 19, 2020 (edited) I'm using OPi LTS and cant change state of PA13-14-15-16 pins. I trying on fresh Armbian Bionic. Checked SPI is disabled. Trying this code for access pins: import OPi.GPIO as GPIO pin = "PA13" GPIO.cleanup() GPIO.setmode(GPIO.SUNXI) #GPIO.setwarnings(False) GPIO.setup(pin, GPIO.OUT) GPIO.output(pin, 1) and take this error altrough write in code "GPIO.cleanup()" ERROR: "UserWarning: Channel PA13 is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings." When trying "GPIO.setwarnings (False)" before change output of pin. Pin voltages when write "1" to output: PA13 -> 3V PA14 -> 3V PA15 -> 0.95V PA16 -> 3V Pin voltages when write "0" to output: PA13 -> 3V PA14 -> 2.77V PA15 -> 0.78V PA16 -> 3V How can i find problem ? What else can i do ? Edited March 19, 2020 by mustafa_meta
martinayotte Posted March 19, 2020 Posted March 19, 2020 1 hour ago, mustafa_meta said: How can i find problem ? What else can i do ? What "cat /sys/kernel/debug/gpio" is reporting ? Which kernel are you using ? What "uname -a" shows ? BTW, "GPIO.cleanup()" is usually called when program exit, but at the beginning ...
mustafa_meta Posted March 20, 2020 Author Posted March 20, 2020 ~cat /sys/kernel/debug/gp gpiochip0: GPIOs 0-223, parent: platform/1c20800.pinctrl, 1c20800.pinctrl: gpio-17 ( |orangepi:red:status ) out lo gpio-20 ( |reg_vcc_wifi ) out hi gpio-110 ( |onewire@0 ) out lo gpio-166 ( |cd ) in lo ACTIVE LOW gpio-204 ( |usb0_id_det ) in hi IRQ gpiochip1: GPIOs 352-383, parent: platform/1f02c00.pinctrl, 1f02c00.pinctrl: gpio-358 ( |vdd-cpux ) out hi gpio-359 ( |reset ) out hi ACTIVE LOW gpio-362 ( |orangepi:green:pwr ) out hi ~uname -a Linux orangepizero 5.4.20-sunxi #20.02.1 SMP Mon Feb 17 02:09:41 CET 2020 armv7l armv7l armv7l GNU/Linux Yes "GPIO.cleanup()" work for only in used script, read it from comment now. Thanks. But what can i do for "UserWarning: Channel PA13 is already in use...." ?
martinayotte Posted March 20, 2020 Posted March 20, 2020 7 hours ago, mustafa_meta said: But what can i do for "UserWarning: Channel PA13 is already in use...." ? PA13 is SPI1_CS ... Are you sure the SPI1 is disabled ? What "cat /proc/device-tree/soc/spi@1c69000/status" is reporting ?
mustafa_meta Posted March 20, 2020 Author Posted March 20, 2020 I'm sure, SPI is disabled. "cat /proc/device-tree/soc/spi@1c69000/status" is nothing show. I tried completely the same steps on another OPi Zero and everything okay with it. Is there storage for gpio config other than sd card? Maybe pins damaged ?
martinayotte Posted March 20, 2020 Posted March 20, 2020 17 minutes ago, mustafa_meta said: "cat /proc/device-tree/soc/spi@1c69000/status" is nothing show. It should show something, but without newline, only at left of command prompt, it must be either "okay" or "disabled" 18 minutes ago, mustafa_meta said: I tried completely the same steps on another OPi Zero and everything okay with it. Are both boards are identical, same revision number ? 19 minutes ago, mustafa_meta said: Is there storage for gpio config other than sd card? I don't understand the question ... 20 minutes ago, mustafa_meta said: Maybe pins damaged ? I doubt, i says "already in use" ...
mustafa_meta Posted March 20, 2020 Author Posted March 20, 2020 Sorry for it "cat /proc/device-tree/soc/spi@1c69000/status" report disabled. Quote Are both boards are identical, same revision number ? No. OPi Zero and OPi Zero LTS. I have problem with OPi Zero LTS now. OPi Zero work fine. Quote I don't understand the question ... Is there an internal disk in the OPi card, such as eMMC flash. I guess the answer is no.
mustafa_meta Posted March 20, 2020 Author Posted March 20, 2020 I ordered another one from the same board. I try the same steps and if we succeed we can assume that gpios is damaged.
martinayotte Posted March 20, 2020 Posted March 20, 2020 19 minutes ago, mustafa_meta said: No. OPi Zero and OPi Zero LTS. I have problem with OPi Zero LTS now. OPi Zero work fine. Did you try to use the same SDCard from the working one into the other one ? 19 minutes ago, mustafa_meta said: Is there an internal disk in the OPi card, such as eMMC flash. I guess the answer is no. Yes, there is a SPINOR flash, but since SPI isn't enable, it should not interfere ... BTW, the whole thing remind me a 2 years old thread here : Do you have UART3 overlay in /boot/armbianEnv.txt ? The PA13/PA14 pins would be in-use if UART3 is enabled ...
mustafa_meta Posted March 27, 2020 Author Posted March 27, 2020 On 3/20/2020 at 5:35 PM, martinayotte said: BTW, the whole thing remind me a 2 years old thread here : I was read it and sure UART is disabled. Here is output " cat /boot/armbianEnv.txt": verbosity=1 logo=disabled console=serial disp_mode=1920x1080p60 overlay_prefix=sun8i-h3 overlays=w1-gpio rootdev=UUID=4618846b-19e6-421b-8872-767a46ed5e1e rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u Now a new board is came. I tried same sd card both. Old one still not working and new one works with same sdcard. Few weeks before this mistake i've tried work with rc522 module on spi1 pins. I unconsciously tried everything. If this not a software issue I think it damaged these pins. On 3/20/2020 at 5:35 PM, martinayotte said: Yes, there is a SPINOR flash, but since SPI isn't enable, it should not interfere ... What is SPINOR role on board? Maybe I intervened in this before?
martinayotte Posted March 27, 2020 Posted March 27, 2020 9 minutes ago, mustafa_meta said: What is SPINOR role on board? SPINOR flash could be setup to have U-Boot inside which will allows to boot from and having RootFS on a USB drive, while no SDCard needed anymore ...
mustafa_meta Posted March 27, 2020 Author Posted March 27, 2020 Thank you very much for all your help.
Recommended Posts