Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Orange Pi Win Plus.Some GPIO pins are not working

Featured Replies

Hello friends;

I have board which Orange Pi Win Plus running Armbian. My problem is, boards 7, 8, 10 and 16 physical pins are not working. When I tried to I/O with this pins, console says: Segmentation Error.

Is it possible to fix it or is it normal?

Thank You.

4 minutes ago, sadkhann said:

My problem is, boards 7, 8, 10 and 16 physical pins are not working

Do you mean S_PWM, S_UART_TX, S_UART_RX and PL9 according to schematic ?

5 minutes ago, sadkhann said:

When I tried to I/O with this pins, console says: Segmentation Error.

How do you try it ?

Which image are you running ?

  • Author

I added screenshot and marked yellow dot the unworking pins. I running Armbian which

Armbian Xenial
desktop legacy kernel 3.10.y

 

and before this image I tried

Armbian Stretch
mainline based kernel 4.19.y

and

Armbian Bionic
desktop mainline based kernel 4.19.y

both

 

I can work with other pins with no problem but these pins are not working.

#include <stdio.h>
#include <wiringPi.h>

// LED Pin - wiringPi pin 0 is BCM_GPIO 17.

#define LED     15

int main (void)
{
  printf ("Raspberry Pi blink\n") ;

  wiringPiSetup () ;
  pinMode (LED, OUTPUT) ;

  for (;;)
  {
    digitalWrite (LED, HIGH) ;  // On
    delay (500) ;               // mS
    digitalWrite (LED, LOW) ;   // Off
    delay (500) ;
  }
  return 0 ;
}

 

Ek Açıklama 2019-05-22 191252.png

2 hours ago, sadkhann said:

I can work with other pins with no problem but these pins are not working.

All those pins are on PL gpio bank. This bank is powered with 1.8V instead of 3.3V on other banks.

So, if you connect something one those, you need to be aware about voltage level and maybe need a voltage shifter.

To test them and check them with voltmeter, you can use gpio sysfs, here an example :

echo 354 > /sys/class/gpio/export 
echo out > /sys/class/gpio/gpio354/direction 
echo 1 > /sys/class/gpio/gpio354/value 

For the "Segmentation Error", it maybe simply a bug of wiringPi not been able to access PL PinController (pinctrl@1f02c00) which is not the same for all other banks (pinctrl@1c20800) ...

  • Author

Thank you for replying me I am so glad.  I realized what you are considering. The codes you write, do I write them console or a file? I haven't done this type of stuff, can you explain a little bit deeper?  

  • Author

Now I tried a lot and find the solution with your help. In your way the GPIO pins looks fine but how to I control them? The classical way of

gpio mode 16 out
gpio write 16 1

not works with this pins.

58 minutes ago, sadkhann said:

do I write them console or a file?

As written above was at the console/shell, but you could write a bash script too, here is a blinking script :

#!/bin/bash

echo 354 > /sys/class/gpio/export 
echo out > /sys/class/gpio/gpio354/direction 

while true ; do
	echo 0 > /sys/class/gpio/gpio354/value
	spleep 0.25
	echo 1 > /sys/class/gpio/gpio354/value
	spleep 0.25
done

 

19 minutes ago, sadkhann said:

In your way the GPIO pins looks fine but how to I control them?

The above way ...

 

Or you can also use python library such pyA64 from https://pypi.org/project/pyA64/

 

#!/usr/bin/env python
"""Basic blinking led example.
"""

import os
import sys

if not os.getegid() == 0:
    sys.exit('Script must be run as root')


from time import sleep
from pyA64.gpio import gpio
from pyA64.gpio import port

led = port.PD5

gpio.init()
gpio.setcfg(led, gpio.OUTPUT)

try:
    print ("Press CTRL+C to exit")
    while True:
        gpio.output(led, 1)
        sleep(0.1)
        gpio.output(led, 0)
        sleep(0.1)

        gpio.output(led, 1)
        sleep(0.1)
        gpio.output(led, 0)
        sleep(0.1)

        sleep(0.6)
except KeyboardInterrupt:
    print ("Goodbye.")

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.