Using GPIO36-38 on WP7607

Hello

We have a custom PCB layout with GPIO35, GPIO36, GPIO37 and GPIO38 wired to two external ISM radio chips that we want to program with these pins. I can control GPIO35 but not the other 3.

I know they are:
e. Accessible via sysfs/Legato only.
f. Only available in Group A variants; this pin is Reserved in Group B variants.
WP7607 is a group A variant along with WP7601, WP7603, WP7607, WP7608, WP7609.

Tried:

root@swi-mdm9x28-wp:/sys/class# echo 36 > /sys/class/gpio/export
sh: write error: No such device
root@swi-mdm9x28-wp:/sys/class# echo 37 > /sys/class/gpio/export
sh: write error: No such device
root@swi-mdm9x28-wp:/sys/class# echo 38 > /sys/class/gpio/export
sh: write error: No such device

Also tried the le_gpio.api but get

gpioSysfsUtils.c ExportGpio() 151 | Failed to export GPIO 38. Error Operation not permitted

Can somebody help me please?

What is return value of at+wiocfg?

As these ports are sysfs/legato only they do not show I guess but her is the output:

image

No problem is found on my wp7609.

root@swi-mdm9x28-wp:~# echo 36 > /sys/class/gpio/export
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# cm info
Device: WP7609
IMEI: 359782080100373
IMEISV: 6
FSN: WA803370311610
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07[ 53.453151] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x3a MSTR_STS:0x0c1300c8 OPER:0x00000090
Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
[ 53.471036] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x3a MSTR_STS:0x0c1300c8 OPER:0x00000090
MCU Version: 002.011
PRI Part Number (PN): 9908102
PRI Revision: 001.000
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_000
SKU: 1103843
Last Reset Cause: Power Down
Resets Count: Expected: 87 Unexpected: 1
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# echo 37 > /sys/class/gpio/export
[ 73.641734] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:18) mode:FIFO slv_addr:0x3a MSTR_STS:0x0c1300c8 OPER:0x00000090
[ 73.657294] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:18) mode:FIFO slv_addr:0x3a MSTR_STS:0x0c1300c8 OPER:0x00000090
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# echo 38 > /sys/class/gpio/export

Could it be a bug in WP7607-1?
Will test on another WP7607-1 and mangoh PCB.

My output:

root@swi-mdm9x28-wp:~# echo 36 > /sys/class/gpio/export
sh: write error: No such device
root@swi-mdm9x28-wp:~# cm info
Device: WP7607-1
IMEI: 359780080542313
IMEISV: 6
FSN: VP919601060610
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version:
PRI Part Number (PN): 9908664
PRI Revision: 001.001
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_000
SKU: 1104193
Last Reset Cause: Power Down
Resets Count: Expected: 266 Unexpected: 1
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# echo 37 > /sys/class/gpio/export
sh: write error: No such device
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# echo 38 > /sys/class/gpio/export
sh: write error: No such device
root@swi-mdm9x28-wp:~#

I’m on Legato 19.04. What legato version are you using @jyijyi ?

it is strange that you don’t have the “MCU version”.
My FW is using the official R13. Legato version should be 19.02.

Tested on a mangoh with WP7607 now (LE19.04) and 36 and 38 export without error.
gpio37 responded with resource busy or something like that but I tried again now and now it worked.

Device: WP7607
IMEI: 359779080106830
IMEISV: 6
FSN: VN811485561010
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version: 002.011
PRI Part Number (PN): 9907327
PRI Revision: 001.003
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_000
SKU: 1103511
Last Reset Cause: Power Down
Resets Count: Expected: 384 Unexpected: 4

But that does not help much as all our devices are WP7607-1.

This time MCU Version is 002.011

Yes the missing MCU Version might be a clue.
Found another gateway prototype that did work:

root@swi-mdm9x28-wp:~# cm info
Device: WP7607-1
IMEI: 359780080485307
IMEISV: 6
FSN: VP918600371310
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version: 002.011
PRI Part Number (PN): 9908664
PRI Revision: 001.001
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_000
SKU: 1104193
Last Reset Cause: Power Down
Resets Count: Expected: 430 Unexpected: 0
root@swi-mdm9x28-wp:~# echo 36 > /sys/class/gpio/export
root@swi-mdm9x28-wp:~# echo 37 > /sys/class/gpio/export
root@swi-mdm9x28-wp:~# echo 38 > /sys/class/gpio/export

And then another gateway from our mass production that did not work:

Gateway with new PCB:
root@swi-mdm9x28-wp:~# cm info
Device: WP7607-1
IMEI: 359780080541927
IMEISV: 6
FSN: VP919600061110
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version:
PRI Part Number (PN): 9908664
PRI Revision: 001.001
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_000
SKU: 1104193
Last Reset Cause: Reset, User Requested
Resets Count: Expected: 55 Unexpected: 0

Nov 13 08:49:34 swi-mdm9x28-wp user.err Legato: =ERR= | powerManagerService[886]/powerMgr T=main | le_ulpm.c le_ulpm_GetFirmwareVersion() 417 | Unable to open file /sys/module/swimcu_pm/firmware/version for reading (No such file or directory). Wrong platform/mcu-firmware

then seems your module has some problem.

Will check with sierra.

Btw: check your response in this thread. You are missing MCU version here as well…?

I don’t quite remember, it is long time ago.
Maybe you download the official FW and see if it can recover the MCU version.

Usually when the MCU version is not shown that indicates an I2C issue at startup between the MCU and the MDM. GPIO 36 and 38 route internally to the MCU, and the kernel needs the I2C communication to be operational to access them through sysfs.

If you power cycle your device, does it work?

BR,
Chris

Yes you are right this is a I2C issue. Will check our peripherals and I2C lines.

I2C is used internally for the GPIO extender and for retrieving the MCU version but what else?

Note: I2C slave addresses 0x10 and 0x3a are reserved for internal use.

@nilsa, have you change something in your FW? can you share the dmesg log after a reboot, please? have you tried to reflash another FW?

I found the problem. It was a chip connected to the I2C with pin as a low output.
I2C works again now but be question is still what exactly is the I2C used for inside the WP?

FYI: Turns out there is a mistake in the PTS.

The note:

Note: I2C slave addresses 0x10 and 0x3a are reserved for internal use.

Integrated Audio codec is on address 0x1a and not 0x10.