Jump to content

setting gpio "out" hangs networking


ChrisArena52

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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

Important Information

Terms of Use - Privacy Policy - Guidelines