Gpioexp does not set pin low

I’m using the gpioexp application to configure the signal MTK_TO_WP_UART_EN so I can route the uart2 from the wp7603 to the mt7697 chip.
when I try to

gpioexp 1 5 output normal low

I receive the following:


root@swi-mdm9x28:~# gpioexp 1 5 output normal low
expander#:1 gpio pin:5, i2cAddr:0x3e
module 1, pin 5 i2cAddr 62 bus 4 bank 1
mode:Output
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
ERR* failed to read i2c data
ERR* I2c get addr 0x3e value failureERR* Set mode 0 failurelevel:normal
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
ERR* failed to read i2c data
ERR* I2c get addr 0x3e value failureERR* Set polarity 0 failure
active:low
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
ERR* failed to read i2c data
ERR* I2c get addr 0x3e value failureERR* Set output 0 failure

but when I try
gpioexp 1 5 output normal high

I get:

root@swi-mdm9x28:~# gpioexp 1 5 output normal high
expander#:1 gpio pin:5, i2cAddr:0x3e
module 1, pin 5 i2cAddr 62 bus 4 bank 1
mode:Output
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
        Register Addr 0xf: 0xdf...
Succesfully setup direction mode
level:normal
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
        Register Addr 0xd: 0x0...
active:high
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
Open I2C Bus at, '/dev/i2c/4'
Try open I2C Bus at, '/dev/i2c-4'
        Register Addr 0x11: 0x20...

All cmnds are being issued after a gpioexp 1 5 enable.

Why my gpioexp 1 5 output normal low gives different results, not setting the gpioExpander pin to low?

Can someone give some light on how to activate the MTK_TO_WP_UART_EN pin in order to use the uart2 for the mtk chip?

I believe that GPIO is specifically for the use case where you want to connect to the MTK’s console UART from the WP’s UART. What are you trying to accomplish?

I’m trying to set MTK_TO_WP_UART_EN up, so the tri-state 74LVC2G126 (U304) would be activated, conecting the UART2 from the WP to the UART0 (MT) (cutting of the ‘console’ since the TS3A5018RSV (U302) would be disabeled).

TL;DR : Connect the wifi chip to the WP UART2 instead of the UART1.

By now I’m able to activate the communication WP UART2 <-> mt7697 UART0
using dmesg I can see the commands being sent to/from the mt7697 driver but it looks like the communication its being compromised by something (Absence of flow control through WP UART2 <-> mt7697 UART0 ???) because even though the mt7697 driver sends the right cmd, the wifi chip is not responding accordingly.
Here is my dmesg:

[ 3469.904328] mt7697core mt7697core: bytes (4 0 2 2)                                                     
[ 3469.904346] mt7697core mt7697core: mt7697_wr_cfg_req(): <-- GET CONFIG len(4)
[ 3469.904366] mt7697serial mt7697serial: mt7697_uart_write(): len(1)
[ 3469.904471] mt7697serial mt7697serial: mt7697_uart_write(): written(4)
[ 3469.904492] mt7697serial mt7697serial: bytes (4 0 2 2)
[ 3469.904510] mt7697serial mt7697serial: mt7697_uart_write(): return(1)
[ 3469.934191] mt7697serial mt7697serial: mt7697_uart_read(): read(2)
[ 3469.934223] mt7697serial mt7697serial: mt7697_uart_read word[0]=0
[ 3469.934237] mt7697serial mt7697serial: mt7697_uart_read word[1]=0
[ 3469.934252] mt7697serial mt7697serial: mt7697_uart_read(): return(2)
[ 3469.934273] mt7697core mt7697core: mt7697_proc_80211cmd(): unsupported cmd(0)
[ 3469.934292] mt7697core RSP 00000000: 00 00 00 00 00 00 dc 00
[ 3469.934308] mt7697serial mt7697serial: mt7697_uart_rx_work(): rx_fcn ret(-22)
[ 3469.934323] mt7697serial mt7697serial: mt7697_uart_rx_work(): rx_fcn() failed(-22)
[ 3469.934350] mt7697serial mt7697serial: mt7697_uart_rx_poll(): Rx data mask(0x00000145)
[ 3469.934368] mt7697serial mt7697serial: mt7697_uart_read(): len(8)
[ 3469.934392] mt7697serial mt7697serial: mt7697_uart_read(): read(8)
[ 3469.934408] mt7697serial mt7697serial: mt7697_uart_read word[0]=152
[ 3469.934423] mt7697serial mt7697serial: mt7697_uart_read word[1]=246
[ 3469.934438] mt7697serial mt7697serial: mt7697_uart_read word[2]=193
[ 3469.934452] mt7697serial mt7697serial: mt7697_uart_read word[3]=205
[ 3469.934466] mt7697serial mt7697serial: mt7697_uart_read word[4]=156
[ 3469.934481] mt7697serial mt7697serial: mt7697_uart_read word[5]=56
[ 3469.934495] mt7697serial mt7697serial: mt7697_uart_read word[6]=3
[ 3469.934509] mt7697serial mt7697serial: mt7697_uart_read word[7]=191
[ 3469.934524] mt7697serial mt7697serial: mt7697_uart_read(): return(2)
[ 3469.934538] mt7697core mt7697core: mt7697_proc_80211cmd(): unsupported cmd(0)
[ 3469.934551] mt7697core RSP 00000000: 02 03 00 00 00 00 01 4d
[ 3469.934580] mt7697serial mt7697serial: mt7697_uart_rx_work(): rx_fcn() failed(-22)                     
[ 3469.934597] mt7697serial mt7697serial: mt7697_uart_rx_poll(): Rx data mask(0x00000145)
[ 3469.934612] mt7697serial mt7697serial: mt7697_uart_read(): len(8)
[ 3469.934630] mt7697serial mt7697serial: mt7697_uart_read(): read(8)
[ 3469.934646] mt7697serial mt7697serial: mt7697_uart_read word[0]=152
[ 3469.934661] mt7697serial mt7697serial: mt7697_uart_read word[1]=246
[ 3469.934675] mt7697serial mt7697serial: mt7697_uart_read word[2]=193
[ 3469.934689] mt7697serial mt7697serial: mt7697_uart_read word[3]=205
[ 3469.934703] mt7697serial mt7697serial: mt7697_uart_read word[4]=156
[ 3469.934717] mt7697serial mt7697serial: mt7697_uart_read word[5]=56
[ 3469.934731] mt7697serial mt7697serial: mt7697_uart_read word[6]=3
[ 3469.934745] mt7697serial mt7697serial: mt7697_uart_read word[7]=191
[ 3469.934759] mt7697serial mt7697serial: mt7697_uart_read(): return(2)
[ 3469.934773] mt7697core mt7697core: mt7697_proc_80211cmd(): unsupported cmd(83)
[ 3469.934785] mt7697core RSP 00000000: 54 4b 5f 53 4f 46 54 5f
[ 3469.934799] mt7697serial mt7697serial: mt7697_uart_rx_work(): rx_fcn ret(-22)
[ 3469.934814] mt7697serial mt7697serial: mt7697_uart_rx_work(): rx_fcn() failed(-22)
[ 3469.934830] mt7697serial mt7697serial: mt7697_uart_rx_poll(): Rx data mask(0x00000145)
[ 3469.934846] mt7697serial mt7697serial: mt7697_uart_read(): len(8)
[ 3469.934864] mt7697serial mt7697serial: mt7697_uart_read(): read(8)
[ 3469.934879] mt7697serial mt7697serial: mt7697_uart_read word[0]=152
[ 3469.934894] mt7697serial mt7697serial: mt7697_uart_read word[1]=246
[ 3469.934908] mt7697serial mt7697serial: mt7697_uart_read word[2]=193
[ 3469.934923] mt7697serial mt7697serial: mt7697_uart_read word[3]=205
[ 3469.934937] mt7697serial mt7697serial: mt7697_uart_read word[4]=156
[ 3469.934951] mt7697serial mt7697serial: mt7697_uart_read word[5]=56
[ 3469.934966] mt7697serial mt7697serial: mt7697_uart_read word[6]=3
[ 3469.934980] mt7697serial mt7697serial: mt7697_uart_read word[7]=191
[ 3469.934994] mt7697serial mt7697serial: mt7697_uart_read(): return(2)