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
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.
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
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.
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?