GPIO does not toggle

  • Hi,


    I have Starterkit PicoCOMA9X Linux with pre installed Linux fsimx6sx 4.1.15. I want to toggle the PIn 3 of J10 connector (IO8) which mapped to gpio43 according to PicoCOMA9X GPIO Reference Card V1.0.
    I do the following steps which are mentioned in "F&S i.MX6-SoloX Linux First Step" document for setting the pin:

    • echo 43 > /sys/class/gpio/Export
    • echo out > /sys/class/gpio/gpio43/direction
    • echo 1 > /sys/class/gpio/gpio43/value

    All of commands are working without any error, apparently, the direction will Change but value can not be changed to 1. I have run the command "mount -o remount, rw /" also the permission for file value is "-rw-r--r--". Is there something missing? or is there any other way for toggling the gpio?

  • Hi,


    GPIO2_IO11(gpio43) is pin 26 of J1 connector in the gpio reference card. So the main problem is that the default mux option for this pin is set to SPI. That´s the reason why you can´t recognize a state change of this pin. If you want to use this pin as GPIO, then you have to disable the SPI interface in device tree. You can do this by changing the following line:
    #define CONFIG_PICOCOMA9X_SPI_A to //#define CONFIG_PICOCOMA9X_SPI_A
    Then you have to recompile the device tree and install it on your board. After that you should be able to toggle the GPIO.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hi,


    Thank you for your guide. Is there any document About device tree and its Basic and how to do it step by step?
    Also, is there any way to Change the device tree at runtime for this board (like, device-tree-compiler)?

  • Hi


    well in our Linux first steps document you will find how you compile a device tree. You can you a look at chapter 9.1.5/6.
    If you want to change the device tree at runtime you have to enable 2 packets in Buildroot, recompile it and install it. These packets are called BR2_PACKAGE_DTC and BR2_PACKAGE_DTC_PROGRAMS. They are located in "target packages->Libraries->Hardware handling"


    But we recommend you to do changes in the device tree directly in the source code instead of modfiying the binary file. It is more common to do the changes directly in the source file and makes from our point of view more sense.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.