Hi,

Tarmo Kuuse <tarmo.ku...@gmail.com> 於 2018年12月27日 週四 下午10:51寫道:

<snip>

> Pin is muxed as GPIO and has value 1, but it's still configured as input:
> conf_gpmc_a1 = 0x27
> GPIO_OE = 0xFE1FFFFF
> GPIO_DATAOUT = 0x820000
> Output voltage = 0.58 V
>
> # gpioinfo gpiochip1
> gpiochip1 - 32 lines:
> ...
>         line  17:    "GPMC_A1"       unused  output  active-high
>
> This is not OK - pin should be configured as an output in the GPIO_OE 
> register and it should have a voltage of around 3.3 V.

This issue looks similar to this one [1], could you confirm it?

Thanks.

[1] https://github.com/brgl/libgpiod/issues/32

SZ

>
> 3. Attempting to set gpio1[17] to low, failure
>
> # gpioset gpiochip1 17=0
> # echo $?
> 0
>
> Pin is muxed as GPIO and has value 0, but is configured as an input:
> conf_gpmc_a1 = 0x27
> GPIO_OE = 0xFE1FFFFF
> GPIO_DATAOUT = 0x800000
> Output voltage = 0.58 V
>
> This is not OK either - pin should be an output and have a voltage of around 
> 0 V.
>
> 4. Verification using sysfs, success
>
> To compare and contrast, I exported the pin and set it high using the 
> "deprecated" sysfs interface:
>
> # echo 49 > /sys/class/gpio/export
> # echo high > /sys/class/gpio/gpio49/direction
>
> Pin is muxed as GPIO, configured as output and has the value 1:
> conf_gpmc_a1 = 0x27
> GPIO_OE = 0xFE1DFFFF
> GPIO_DATAOUT = 0x820000
> Output voltage = 3.36 V
>
> This is the expected result - GPIO_OE has output enabled for pin 17 and the 
> output is 3.36 V.
> I also looked at the gpioinfo for this test:
>
> # gpioinfo gpiochip1
> gpiochip1 - 32 lines:
> ...
>         line  17:    "GPMC_A1"      "sysfs"  output  active-high [used]
>
> It looks to me that libgpiod "gpioset" does not enable the pin as output in 
> GPIO_OE register. This register is described in section "25.4.1.16 GPIO_OE 
> Register (offset = 134h) [reset = FFFFFFFFh]" of "AM335x and AMIC110 Sitara 
> Processors Technical Reference Manual Rev. P" from 
> http://www.ti.com/lit/pdf/spruh73.
>
> I have also tried writing a small C program directly against the kernel's 
> "linux/gpio.h" API to achieve the same result as gpioset does. It fails in 
> the same way as gpioset does.
>
> === Environment and hardware details ===
>
> Hardware: BeagleCore BCM.ETR1 (compatible with a Beaglebone Black rev C)
> CPU: Texas Instruments AM3358BZCZA100 (armv7l)
> Debian: Buster/10 (BeagleBoard.org Debian Image 2018-12-10 from 
> https://rcn-ee.net/rootfs/bb.org/testing/2018-12-10/buster-iot/bone-debian-buster-iot-armhf-2018-12-10-4gb.img.xz)
> Kernel: ver 4.14.79-ti-r86
> libgpiod and gpiod packages: ver 1.2-3
>
>
> -- System Information:
> Debian Release: buster/sid
>   APT prefers testing
>   APT policy: (500, 'testing')
> Architecture: armhf (armv7l)
>
> Kernel: Linux 4.14.79-ti-r86 (SMP w/1 CPU core; PREEMPT)
> Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
> (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
>
> Versions of packages libgpiod2 depends on:
> ii  libc6       2.28-2
> ii  libgcc1     1:8.2.0-13
> ii  libstdc++6  8.2.0-13
>
> libgpiod2 recommends no packages.
>
> libgpiod2 suggests no packages.
>
> -- no debconf information

Reply via email to