Jump to content

Recommended Posts

Posted (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 by mustafa_meta
Posted
  On 3/19/2020 at 2:03 PM, mustafa_meta said:

How can i find problem ? What else can i do ?

Expand  

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 ...

Posted

~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...."  ?

Posted

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 ? 

 

Posted
  On 3/20/2020 at 1:24 PM, mustafa_meta said:

"cat /proc/device-tree/soc/spi@1c69000/status" is nothing show.

Expand  

It should show something, but without newline, only at left of command prompt, it must be either "okay" or "disabled"

  On 3/20/2020 at 1:24 PM, mustafa_meta said:

I tried completely the same steps on another OPi Zero and everything okay with it.

Expand  

Are both boards are identical, same revision number ?

  On 3/20/2020 at 1:24 PM, mustafa_meta said:

Is there storage for gpio config other than sd card?

Expand  

I don't understand the question ...

  On 3/20/2020 at 1:24 PM, mustafa_meta said:

Maybe pins damaged ?

Expand  

I doubt, i says "already in use" ...

Posted

Sorry for it
"cat /proc/device-tree/soc/spi@1c69000/status" report disabled.

 

  Quote

Are both boards are identical, same revision number ?

Expand  

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 ...

Expand  

 

Is there an internal disk in the OPi card, such as eMMC flash.  I guess the answer is no.


 

 

Posted
  On 3/20/2020 at 2:15 PM, mustafa_meta said:

No.  OPi Zero and OPi Zero LTS. I have problem with OPi Zero LTS now.  OPi Zero work fine. 

Expand  

Did you try to use the same SDCard from the working one into the other one ?

  On 3/20/2020 at 2:15 PM, mustafa_meta said:

Is there an internal disk in the OPi card, such as eMMC flash.  I guess the answer is no.

Expand  

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 ...

Posted

 

  On 3/20/2020 at 2:35 PM, martinayotte said:

BTW, the whole thing remind me a 2 years old thread here :

Expand  

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 2:35 PM, martinayotte said:

Yes, there is a SPINOR flash, but since SPI isn't enable, it should not interfere ...

Expand  

What is SPINOR role on board? Maybe I intervened in this before?

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines