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.

setting gpio "out" hangs networking

Featured Replies

On a CB1....

 

cubie@cubieboard:~$ uname -a
Linux cubieboard 4.5.2-sunxi #11 SMP Thu Apr 28 21:53:25 CEST 2016 armv7l GNU/Linux
cubie@cubieboard:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.4 (jessie)
Release: 8.4
Codename: jessie
cubie@cubieboard:~$

 

... I'm trying to use the gpio pins I set up in script.bin with this configuration:

 

 

[gpio_para]

gpio_used = 1
gpio_num  = 4
gpio_pin_1 = port:PG02<1><default><default><default>
gpio_pin_2 = port:PG04<1><default><default><default>
gpio_pin_3 = port:PG06<1><default><default><default>
gpio_pin_4 = port:PG08<1><default><default><default>
 

 

No other peripherals are using those pins that are configured in my fex file. A scan of the DTS file also shows nothing using those pins.

 

When I enable pin 1 via:

 

cd /sys/class/gpio

echo 1 > export

 

the gpio1 device shows up.

 

When I do 

 

cd gpio1

echo "out" > direction

 

 

the network interface stops communicating. The system is still alive as I can use a serial session to look at the system, but the networking is gone and I can't restart it. Rebooting is required to get it back. 

 

The same thing happens with my CB2.

 

What's wrong with what I'm doing? top shows nothing burning cpu cycles.

 

I need networking. I'm trying to get openocd running in my CB to program my STM32F303 via the SWD protocol.

 

Thanks!

Chris

 

cubie@cubieboard:~$ uname -a

Linux cubieboard 4.5.2-sunxi #11 SMP Thu Apr 28 21:53:25 CEST 2016 armv7l GNU/Linux

 

You are using mainline kernel where GPIO numbering is different and FEX settings have no effect.

 

In your case network dies because GPIO 1 maps to PA01, which is used by EMAC core.

 

Please check this page for pin numbering scheme (section "Accessing the GPIO pins through sysfs with mainline kernel"). For example PG02 will be GPIO 194.

  • Author

Umm, what from the script.bin file does something? Is anything driven from its contents? Is it in use during ANY part of the system's operation?

 

If the pin had been assigned a function, how was I able to use it?

 

Thanks,

 

Chris

Umm, what from the script.bin file does something? Is anything driven from its contents? Is it in use during ANY part of the system's operation?

No, with mainline kernel it is not used in any way.

 

If the pin had been assigned a function, how was I able to use it?

No idea. Assigned =/= locked, so it still may be possible to override this function.

  • Author

So why is it preserved when not in use? Seems like an excellent misdirection. 

 

I thought when you grabbed a gpio pin that was supposed to be registered somewhere (gpio driver?) so that the kernel had some control over the access. 

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.