Some GPIO pins does not work with custom image
I compiled my image from a recently cloned LEDE git repo. Almost everything seems to work correctly except controlling some GPIO pins (15, 16, 17, 18, 19). I've tried to setup the function with
omega2-ctrland setting the pins through
/sys/class/gpio/*interface, none caused any changes the voltage on the pins is ~1.55V (I've checked by scope as well, it is not toggling, it is a flat ~1.55V on all pins I cannot use / configure).
GPIO 45 / 46 seems OK, I can set them GPIO with
omega2-ctrl gpiomux setcommand, and I can configure to in or out, can set or get value through the
I've tried the same HW using official image
v0.1.9-b159.binand I can control the GPIO pins 15, 16, 17 correctly (although in that image
/dev/memis not available, so even that omega2-ctrl is part of the image it is unusable...).
Can anyone suppose a way which direction to start to figure out what's the root cause?
Based on MT7688 datasheet to use GPIO 14-17,
AGPIO_CFGhave to be '1', anyway those pins are
I made a small
devmemlike utility (I was not able to add
devmemapplet to busybox), setting the corresponding bits directly in the registers solved the problem, I checked on the hardware and I can control GPIO 15-17 now.
The question right now, what sets these bits in the official image (or what unset in my custom image)? Whether it happened from kernel or user space? What should I modify (config, source) to be able to use the necessary pins without hacking from user space with an aggressive utility which directly modifies the bits without caring about the consequences?
You surely know that using the official 0.1.10-b160 FW we can control GPIO 15..19 (and 45, 46 too) with
omega2-ctrl gpiomux) fairly well.
The "full" BusyBox v1.26.2 (Length: 1498448 bytes unfortunately) has a
root@Omega-5BE1:~# ./busybox-mipsel devmem --help BusyBox v1.26.2 (2017-01-10 16:07:35 UTC) multi-call binary. Usage: devmem ADDRESS [WIDTH [VALUE]] Read/write from physical address ADDRESS Address to act upon WIDTH Width (8/16/...) VALUE Data to be written
Sorry, I'm afraid this wasn't too much help for you. Actually I have a question.
You compiled a custom image and I'd like to know where can I find the source of the
Yes, I can set GPIOs flashing the mentioned official image to the board, however I need custom image as my I2S HW is not supported in any precompiled images.
The problem is that compiling the LEDE repo by default set GPIOs 14-17 to MDI_xxx (act as Ethernet ports) instead of GPIOs.
I can set those pins to GPIOs with
devmemlike stuffs at or after boot but that's far from elegant.
gpioctl, I did not download it directly, but installed by
./scripts/feeds install gpioctl-sysfs(from the top level directory of the installed SDK). However, it is available as part of libugpio. But it is just an interface to access
/sys/class/gpio/*, it simply reads / writes those files.