After upgrading my Linkit7688 based board from 15.05.1 to 18.06.2 and removing Libmraa dependency from my application,I was stuck while doing UART communication
I found out that we need to setup gpio pins using mt7688_pinmux for UART to work properly
but it seems this utility is not part of OpenWrt 18.06.2 and if I build and run this utility using sdk for 18.06.2, it gives me following error
root@mylinkit:~/ctusr/scripts# ./mt7688_pinmux
unable to open mmap file
It seems
#define MMAP_PATH "/dev/mem"
does not exists in latest OpenWrt
Is there a way to replicate the functionality of mt7688_pinmux ?
I appreciate any help.
mt7688_pinmux set pwm0 gpio
mt7688_pinmux set pwm1 gpio
mt7688_pinmux set i2c gpio
mt7688_pinmux set spi_s gpio
mt7688_pinmux set spi_cs1 gpio
mt7688_pinmux set refclk gpio
Anything like that is likely going to be fighting with the kernel and the DTS.
Welcome to the world of obsolete, unmaintained code from OEMs, ODMs, and vendors...
You'll have to carefully compare what is being set there with what is set in the DTS.
GPIOs, when not already reserved for a device (which they should be for a UART), can be managed from user-space with the gpiod-tools as the current way to do so. The "sysfs" approach with export is deprecated, so might as well write against tooling that isn't going to disappear after 2020.
Found the fix for this issue. Posting for future references for anyone facing this issue:
~/openwrt$ make menuconfig
# Menu config opens:
1. Goto `Global Build Settings -->`
2. Select `Kernel build options -->`
3. Scroll down to the option `/dev/mem/ virtual device support` and enable it.
4. Save the configuration and exit
~/openwrt$ make V=s
Hi
I saw that you successfully made pinmux work. I have been using mt7688 with the module skw_92a, I switched to linkit7688 recently. I have been using the I2S pins as GPIO in skw_92a by modifying DTS file. In the original firmware of the linkit its OK to use I2S as gpio, no problem. However when I want to use openwrt 19, I2S doesn't switch to GPIO mode even though I change DTS file and compile whole SDK from zero. The only thing I didn't change is the bootloader.