How to access gpio from Linux commands?

Hello,

I try to access gpio from Linux command as explained in the user guide.
I’m particularly interested by the user LED, so gpio 47 and 48.

but ls /sys/class/gpio/ only gives me:
export gpiochip1/ gpiochip100/ gpiochip88/ gpiochip94/ unexport

not any individual port.

What’s the problem?

Alain

Hi Alain,
Sounds like you are running an FX30, but what version are you running? Could you please send the output of “fwupdate query”?

Are you running stock WP firmware or FX30 firmware?

BR,
Chris

Hi Chris,
WP I suppose, I’m running a yocto image based on source

And looking at the syslog, I can see:

2018-08-14T15:03:42.238629+00:00 (none) Legato:  INFO | gpioService[532]/sysfsGpio T=main | gpioSysfs.c _sysfsGpio_COMPONENT_INIT() 9397 | Skipping starting GPIO Service for Pin 47 - pin not available or disabled by config
2018-08-14T15:03:42.239911+00:00 (none) Legato:  INFO | gpioService[532]/sysfsGpio T=main | gpioSysfs.c _sysfsGpio_COMPONENT_INIT() 9414 | Skipping starting GPIO Service for Pin 48 - pin not available or disabled by config

Hi Alain,
You’ll need to run the FX30 firmware, the WP stock will not support these GPIO. Try the R14 FX30 firmware from the Source.
BR,
Chris

Unfortunately, building my app with FX30 source code fails :frowning:!

build log

Alain

PS: you asked me for the firmware version and I didn’t answer you:

So fwupdate query says:
Firmware Version: SWI9X15Y_07.12.14.00 r34472 CARMD-EV-FRMWR1 2017/11/29 18:24:42
Bootloader Version: SWI9X15Y_07.12.14.00 r34472 CARMD-EV-FRMWR1 2017/11/29 18:24:42
Linux Version: 3.14.29ltsi-961ca71325_a0464d543a #2 PREEMPT Thu Aug 16 10:25:56 CEST 2018

Hi Alain,
Ya you’re running stock WP firmware so that won’t work.
When you build R14.0.4.002, have you modified anything?
Looks like you need to install python-m2crypto on your Ubuntu machine.
BR,
Chris

Yes, I added my layer which builds fine with WP source on the same host. So, is it normal?

Hi,
Excellent,. How can I find out which module has reserved a reserved gpio.
I executed “cat /sys/kernel/debug/gpio”. I have posted a portion of the output below.
GPIOs 148-178, GPH:
gpio-162 (? ) in lo
gpio-163 (? ) in lo
gpio-164 (? ) in lo
gpio-165 (? ) in lo

Please help.

Hi there,
I’m not clear what you are asking. Are you trying to configure your own gpio?
BR,
Chris