I am using a Renfell GPIO expansion card on an Fx30 (SWI original Firmware).
When the expansion card is connected, more than half of the usual default GPIO configuration disappears!
Here it the GPIO sys folder without expansion card:
I am using the card “IoT I2C SPI GPIO UART Interface” made by Renfell for MangOH. The Part Number is 0107-10-R1.1.
This card was provided to me as being compatible with the Fx30.
The FX30 has a GPIO expander chip at i2c address 0x20. I’m concerned there is another chip on the IOT card causing an issue with the expander detection. Are you able to see what i2c devices are on the card?
I attach a log file containing the dmesg log and the output of cat /sys/kernel/debug/gpio as requested.
The trace is taken from an Fx30S loaded with R13.1.3.001 and with the GPIO expansion card inserted. GPIO-ExpansionCard-Trace.zip (22.2 KB)
If I hotplug the GPIO card, all existing GPIO remains present (visible on /sys/class/gpio/).
The GPIO 42 of the expansion card can be activated and used (using “echo x > /sys/class/gpio/gpio42/value”).
But the GPIO56 (IO3 of the power cable) is no more usable (it does not respond any more to “echo x > /sys/class/gpio/gpio56/value”). It may be other bad interactions…
Is-it the card not being compatible with the Fx30, or can the bad interactions be solved by a software tweak?
Obviously, to be usable on the field, this card would need to be inserted permanently. Hotplug cannot be an option.
Here is the result of “cat /sys/kernel/debug/gpio” after the hotplug:
GPIOs 0-87, msmgpio:
gpio-32 (sysfs ) out hi
gpio-22 (sysfs ) in lo
gpio-21 (sysfs ) in hi
gpio-2 (sysfs ) in lo
gpio-24 (sysfs ) in lo
gpio-25 (sysfs ) in lo
gpio-7 (sysfs ) in hi
GPIOs 88-93, platform/pm8xxx-gpio, pm-gpio:
gpio-88 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-89 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-90 (-- ) out hi 0x05 0x19 0x2a 0x34 0x40 0x58
gpio-91 (-- ) out lo 0x05 0x18 0x2a 0x35 0x46 0x58
gpio-92 (-- ) out lo 0x05 0x18 0x2a 0x3c 0x40 0x58
gpio-93 (-- ) out lo 0x0d 0x18 0x2a 0x34 0x40 0x58
GPIOs 94-99, platform/pm8xxx-mpp, pm8xxx-mpp:
gpio-94 (-- ) a_in lo 0x68
gpio-95 (VDD_MIN_GPIO) d_in lo 0x00
gpio-96 (-- ) a_out lo 0x85
gpio-97 (-- ) a_in lo 0x6c
gpio-98 (-- ) sink lo 0xa0
gpio-99 (-- ) sink lo 0xa0
GPIOs 100-107, platform/swimcu-gpio, swimcu, can sleep:
gpio-36 (sysfs ) in hi
gpio-38 (sysfs ) in hi
GPIOs 200-223, i2c/0-0022, tca6424, can sleep:
gpio-43 (sysfs ) out lo
gpio-44 (sysfs ) out lo
gpio-45 (sysfs ) out lo
gpio-46 (sysfs ) out lo
gpio-47 (sysfs ) out lo
gpio-48 (sysfs ) out lo
gpio-49 (sysfs ) out lo
gpio-50 (sysfs ) out lo
gpio-51 (sysfs ) out lo
gpio-52 (sysfs ) out lo
gpio-53 (sysfs ) out lo
gpio-54 (sysfs ) out lo
gpio-56 (sysfs ) out lo
gpio-57 (sysfs ) out lo
gpio-58 (sysfs ) out lo
gpio-60 (sysfs ) out lo
gpio-61 (sysfs ) out lo
gpio-62 (sysfs ) out lo
Hi Christian,
It’s strange that you can’t control the GPIO on the expander even though they are detected by the kernel. I noticed you’re switching between an FX30 and FX30S so it’s a bit difficult to determine what exactly is going on.
Could you please send the output of "cat /sys/kernel/debug/gpio for:
FX30 without the IOT card
FX30 after a hotplug of the IOT card
FX30S without the IOT card
Also, have you tried the I2C jumper settings on the IOT card at all?
Here are some trace taken with a Fx30 having the firmware R13.1.2.004.
root@fx30:~# cat /sys/kernel/debug/gpio
GPIOs 0-87, msmgpio:
gpio-32 (sysfs ) out hi
gpio-22 (sysfs ) in lo
gpio-21 (sysfs ) in hi
gpio-2 (sysfs ) in lo
gpio-24 (sysfs ) in lo
gpio-25 (sysfs ) in hi
gpio-7 (sysfs ) in hi
GPIOs 88-93, platform/pm8xxx-gpio, pm-gpio:
gpio-88 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-89 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-90 (-- ) out hi 0x05 0x19 0x2a 0x34 0x40 0x58
gpio-91 (-- ) out lo 0x05 0x18 0x2a 0x35 0x46 0x58
gpio-92 (-- ) out lo 0x05 0x18 0x2a 0x3c 0x40 0x58
gpio-93 (-- ) out lo 0x0d 0x18 0x2a 0x34 0x40 0x58
GPIOs 94-99, platform/pm8xxx-mpp, pm8xxx-mpp:
gpio-94 (-- ) a_in lo 0x68
gpio-95 (VDD_MIN_GPIO) d_in lo 0x01
gpio-96 (-- ) a_out lo 0x85
gpio-97 (-- ) a_in lo 0x6c
gpio-98 (-- ) sink lo 0xa0
gpio-99 (-- ) sink lo 0xa0
GPIOs 100-107, platform/swimcu-gpio, swimcu, can sleep:
gpio-36 (sysfs ) in lo
gpio-38 (sysfs ) in hi
GPIOs 200-215, i2c/0-0020, tca6416, can sleep:
gpio-43 (sysfs ) out hi
gpio-44 (sysfs ) out hi
gpio-45 (sysfs ) out hi
gpio-46 (sysfs ) out hi
gpio-47 (sysfs ) out hi
gpio-48 (sysfs ) out hi
gpio-49 (sysfs ) out hi
gpio-50 (sysfs ) out hi
gpio-51 (sysfs ) out lo
gpio-52 (sysfs ) out hi
gpio-53 (sysfs ) out lo
gpio-54 (sysfs ) out lo
gpio-55 (sysfs ) out hi
gpio-56 (sysfs ) out lo
gpio-57 (sysfs ) out hi
gpio-58 (sysfs ) out hi
The GPIO control by the following commands are working
GPIOs 0-87, msmgpio:
gpio-32 (sysfs ) out hi
gpio-22 (sysfs ) in lo
gpio-21 (sysfs ) in hi
gpio-2 (sysfs ) in lo
gpio-24 (sysfs ) in lo
gpio-25 (sysfs ) in lo
gpio-7 (sysfs ) in hi
GPIOs 88-93, platform/pm8xxx-gpio, pm-gpio:
gpio-88 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-89 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-90 (-- ) out hi 0x05 0x19 0x2a 0x34 0x40 0x58
gpio-91 (-- ) out lo 0x05 0x18 0x2a 0x35 0x46 0x58
gpio-92 (-- ) out lo 0x05 0x18 0x2a 0x3c 0x40 0x58
gpio-93 (-- ) out lo 0x0d 0x18 0x2a 0x34 0x40 0x58
GPIOs 94-99, platform/pm8xxx-mpp, pm8xxx-mpp:
gpio-94 (-- ) a_in lo 0x68
gpio-95 (VDD_MIN_GPIO) d_in lo 0x01
gpio-96 (-- ) a_out lo 0x85
gpio-97 (-- ) a_in lo 0x6c
gpio-98 (-- ) sink lo 0xa0
gpio-99 (-- ) sink lo 0xa0
GPIOs 100-107, platform/swimcu-gpio, swimcu, can sleep:
gpio-36 (sysfs ) in hi
gpio-38 (sysfs ) in hi
GPIOs 200-215, i2c/0-0020, tca6416, can sleep:
gpio-43 (sysfs ) out lo
gpio-44 (sysfs ) out lo
gpio-45 (sysfs ) out lo
gpio-46 (sysfs ) out lo
gpio-47 (sysfs ) out lo
gpio-48 (sysfs ) out lo
gpio-49 (sysfs ) out lo
gpio-50 (sysfs ) out lo
gpio-51 (sysfs ) out lo
gpio-52 (sysfs ) out lo
gpio-53 (sysfs ) out lo
gpio-54 (sysfs ) out lo
gpio-55 (sysfs ) out lo
gpio-56 (sysfs ) out lo
gpio-57 (sysfs ) out lo
gpio-58 (sysfs ) out lo
The GPIO control by the following commands are now not working.
When I disconnect the GPIO expansion card, the control of the LEDs by the GPIO returns to normal.
Up to now, I was only having the GPIO and 5v Jumpers ON.
By connecting the I2C jumper, I obtain the following:
I can switch ON (green) the user LED with “echo 0 > /sys/class/gpio/gpio48/value”, but I cannot trun it OFF.
No action possible on the POWER LED using GPIO 49
the result of the command “cat /sys/kernel/debug/gpio” remains identical.
After disconnection of the expansion card, the controls are back to normal.
And here is the output of the “cat /sys/kernel/debug/gpio” command from an Fx30S loaded with R13.1.3.001.
root@fx30s:~# cat /sys/kernel/debug/gpio
GPIOs 0-87, msmgpio:
gpio-32 (sysfs ) out hi
gpio-22 (sysfs ) in lo
gpio-21 (sysfs ) in hi
gpio-2 (sysfs ) in lo
gpio-24 (sysfs ) in lo
gpio-25 (sysfs ) in hi
gpio-7 (sysfs ) in hi
GPIOs 88-93, platform/pm8xxx-gpio, pm-gpio:
gpio-88 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-89 (-- ) in lo 0x05 0x10 0x28 0x30 0x40 0x58
gpio-90 (-- ) out hi 0x05 0x19 0x2a 0x34 0x40 0x58
gpio-91 (-- ) out lo 0x05 0x18 0x2a 0x35 0x46 0x58
gpio-92 (-- ) out lo 0x05 0x18 0x2a 0x3c 0x40 0x58
gpio-93 (-- ) out lo 0x0d 0x18 0x2a 0x34 0x40 0x58
GPIOs 94-99, platform/pm8xxx-mpp, pm8xxx-mpp:
gpio-94 (-- ) a_in lo 0x68
gpio-95 (VDD_MIN_GPIO) d_in lo 0x00
gpio-96 (-- ) a_out lo 0x85
gpio-97 (-- ) a_in lo 0x6c
gpio-98 (-- ) sink lo 0xa0
gpio-99 (-- ) a_out lo 0x85
GPIOs 100-107, platform/swimcu-gpio, swimcu, can sleep:
gpio-36 (sysfs ) in lo
gpio-38 (sysfs ) in hi
GPIOs 200-223, i2c/0-0022, tca6424, can sleep:
gpio-43 (sysfs ) out hi
gpio-44 (sysfs ) out hi
gpio-45 (sysfs ) out hi
gpio-46 (sysfs ) out hi
gpio-47 (sysfs ) out hi
gpio-48 (sysfs ) out hi
gpio-49 (sysfs ) out hi
gpio-50 (sysfs ) out hi
gpio-51 (sysfs ) out lo
gpio-52 (sysfs ) out hi
gpio-53 (sysfs ) out lo
gpio-54 (sysfs ) out lo
gpio-56 (sysfs ) out lo
gpio-57 (sysfs ) out hi
gpio-58 (sysfs ) out hi
gpio-60 (sysfs ) out lo
gpio-61 (sysfs ) out hi
gpio-62 (sysfs ) out hi
Hi Christian,
How soon after power up did you hot plug the IOT card? It definitely interferes with the GPIO expander being accessed. I’m not sure what else to suggest… have you tried contacting Renfell?
Could you please insert the card without power into your FX30 (not the serial), power it on, and then send me the dmesg logs?
Also, when you discuss with Renfell, please try to get some information on the i2c pull-ups and level translators. There may be some interference caused by these.