[Fx30] The Renfell GPIO expansion card (r1.1) is interferring with the default GPIO config

Hello,

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:

root@fx30:~# ls /sys/class/gpio/

export gpio22 gpio32 gpio43 gpio46 gpio49 gpio52 gpio55 gpio58 gpiochip100 gpiochip94
gpio2 gpio24 gpio36 gpio44 gpio47 gpio50 gpio53 gpio56 gpio7 gpiochip200 unexport
gpio21 gpio25 gpio38 gpio45 gpio48 gpio51 gpio54 gpio57 gpiochip1 gpiochip88

Here is the GPIO sys folder with expansion card connected:

  • For the manipulations, I connect the expansion card, then apply the power of the Fx30. I do not perform hotplug of the card.

root@fx30:~# ls /sys/class/gpio/

export gpio2 gpio21 gpio22 gpio24 gpio25 gpio32 gpio7 gpiochip1 gpiochip88 gpiochip94 unexport

I have the same result with an Fx30S or with the SWI R13.1.3.001 firmware.

I could still work without all GPIOs but I definitively need the 53, 54, 56, 57, 47, 48…

Best regards, Christian.

Hi Christian,
Which GPIO card are you using? Could you please tell me what devices are on the GPIO card i2c bus?
Thanks,
Chris

Hello Chris,

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.

Regards, Christian.

Hi Christian,
Could you please send me:

  • dmesg logs
  • the output of cat /sys/kernel/debug/gpio

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?

BR,
Chris

Hello Chris,

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)

Some more info about the IO Card I’m using:

I do not see on the card what are the I2c chips but according to the card documentation there is an EEPROM chip (Microchip 24AA32A).

Best regards, Christian.

The block diagram on page 2 of the document linked by @CGuyot mentions that addresses 0x52, 0x53, 0x56, 0x57 are used by the card.

@cchenry: Does that conflict with anything on the fx30?

No it doesn’t. So there aren’t any i2c conflicts but I notice there is a swimcu issue in the logs. I’ll consult internally and get back on this.

BR,
Chris

Hi Christian,
Could you please try with a hot plug? I believe the EEPROM at 0x52 is causing an issue.
Thanks,
Chris

Hello Chris,

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.

Best regards, Christian.

Hi Christian,
If the issue is due to the 0x52 EEPROM, the fix should be in software only.

Regarding the GPIO56 issue, are you able to control other GPIO, for example any of the LED’s?

Could you please send me the output of “cat /sys/kernel/debug/gpio” from the hotplug?

BR,
Chris

Hello Chris,

After a hotplug of the GPIO expansion card, the LEDs (GPIO 48 and GPIO49) controls are no more working using the commands:

root@fx30s:~# echo 0 > /sys/class/gpio/gpio48/value
root@fx30s:~# echo 1 > /sys/class/gpio/gpio48/value
root@fx30s:~# echo 0 > /sys/class/gpio/gpio49/value
root@fx30s:~# echo 1 > /sys/class/gpio/gpio49/value

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

Best regards, Christian.

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:

  1. FX30 without the IOT card
  2. FX30 after a hotplug of the IOT card
  3. FX30S without the IOT card

Also, have you tried the I2C jumper settings on the IOT card at all?

BR,
Chris

Hello Chris,

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

root@fx30:~# echo 0 > /sys/class/gpio/gpio48/value
root@fx30:~# echo 1 > /sys/class/gpio/gpio48/value
root@fx30:~# echo 0 > /sys/class/gpio/gpio49/value
root@fx30:~# echo 1 > /sys/class/gpio/gpio49/value

Now I hotplug the GPIO expansion card

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

root@fx30:~# echo 0 > /sys/class/gpio/gpio48/value
root@fx30:~# echo 1 > /sys/class/gpio/gpio48/value
root@fx30:~# echo 0 > /sys/class/gpio/gpio49/value
root@fx30:~# echo 1 > /sys/class/gpio/gpio49/value

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

Best regards, Christian.

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?

BR,
Chris

Hello Chris,

The IOT card connection was performed around one to two minutes after the power-up.
I will follow on this subject with Renfell…

Best regards, Christian.

Hi Christian,

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.

BR,
Chris

Hello Chris,

Here is the requested trace.
TraceFx30WithGpioExpCardOn.zip (11.0 KB)

Best regards, Christian.

Hi Christian,
Did you resolve the issue?

No, I never god an answer from Renfell. I have moved to use a different equipment.