GPIO access doubt in I.MX53 SABRE Tablet

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO access doubt in I.MX53 SABRE Tablet

1,504 Views
winstonrodrigue
Contributor IV

Dear Pals,

   

          I am working on IMX53_smd (sabre tablet). since I was trying to toggle the LEDs in Linux ( charge and user debug D27, D32 from schematic ) which are connected to these pins :

                                                                            MX53_PAD_EIM_D30__GPIO_30

                                                                            MX53_PAD_PATA_DA_1__GPIO7_7

   But these definitions are already registered in "iomux-mx53.h" and "mx53_smd.c"

  so I tried to access the pins directly from sysfs like this....

     

       for MX53_PAD_EIM_D30__GPIO_30 : "echo 94 > /sys/class/gpio/export

       But when I do ls i count see any new directory..

    for MX53_PAD_PATA_DA_1__GPIO7_7 I did "echo 199 > sys/class/gpio/export

    Here also No directories created... I dont understand why .. Is it because these pins are already being used for Charge_done and USER_DEBUG ??

Another case :

       I thought I will access the free GPIO pin on the expansion connector,

   that is 40th pin on J78 i.e. MX53_PAD_GPIO_17__GPIO7_12

  So i Added this pin in "../mach-mx5/mx53_smd.c" in static iomux_v3_cfg_t mx53_smd_pads[] array..

    then i recompiled the kernel and deployed it, booted from SD card.

   But when I try to access it : echo 204 > export

                                             echo out > gpio204/direction

                                             echo 1 > gpio204/value

    But when i see the value it is still '0' and the Pin doesnt change. but direction has changed to "out"

   What am I doing wrong here ... ??

Regards,

   Winston.


Labels (4)
0 Kudos
12 Replies

910 Views
bandarulavanya
Contributor V

Hi Yixing Kong,

I have same problem if you know please kindly help me .

i want to toggle gpio pins in sysfs entries.

eg: pin7

echo 7 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio7/direction

cat /sys/class/gpio/gpio7/direction

out

cat  /sys/class/gpio/gpio7/value

0

echo 1 > /sys/class/gpio/gpio7/value

cat  /sys/class/gpio/gpio7/value

0

Here i am not able to change value for this gpio.

i tried with some other gpio's also all are giving like this only

can anyone please help me i am new to the device tree files.

for this am i need to give any thing in dts file.

Thanks & Regards,

Lavanya

0 Kudos

910 Views
BiyongSUN
NXP Employee
NXP Employee

Please set SION Software Input On Field.

You can refer to

Simple GPIO Example - quandry

https://community.freescale.com/message/598834#598834

910 Views
bandarulavanya
Contributor V

Hi Biyong Sun,

But in older version kernels which have BSP support (3.0.35) without SION bit as 0 also we can able to control the value of output gpio.

So what is the difference between dts file and BSP for this SION bit related.

Thanks & Regards,

Lavanya

0 Kudos

910 Views
BiyongSUN
NXP Employee
NXP Employee

Please read the following link carefully.

Simple GPIO Example - quandry

https://community.freescale.com/message/598834#598834

Then confirm your IOMUXC changes in your dts file.

And check the GPIO status in debug fs.

0 Kudos

910 Views
bandarulavanya
Contributor V

Hi Biyong Sun,

Thank you, with this above link i can able to change the status of gpio in debug fs, now i can able see the change in gpio status from out lo  to out hi.

But my doubt is why in older version we are not using SION bit settings to access sysfs, even though if we are not using SION bit as 1 in older versions sysfs entries we can able to change the values. can you please tell me the difference between these old and new versions kernel for this SION bit.I am new to the device tree.

Thanks & Regards,

Lavanya

0 Kudos

910 Views
BiyongSUN
NXP Employee
NXP Employee

Could you please dump the IOMUX settings in the old Linux version that we can have a check?

0 Kudos

910 Views
BiyongSUN
NXP Employee
NXP Employee

I mean runtime dump register.

I don't believe if the SION is not set the GPIO can do capture. 

Also you provide the i.MX6 header.

0 Kudos

910 Views
bandarulavanya
Contributor V

Hi Biyong Sun​,

But in older version kernels which have BSP support (3.0.35) without SION bit as 1 also we can able to control the value of output gpio.

So what is the difference between dts file and BSP for this SION bit related.

Thanks & Regards,

Lavanya

0 Kudos

910 Views
YixingKong
Senior Contributor IV

Winston

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 Kudos

910 Views
YixingKong
Senior Contributor IV

Winston

We have not got your response yet and will close the diacussion in 3 days. If you still need help, please feel free to

reply with an update to this discussion.
Thanks,
Yixing

0 Kudos

910 Views
YixingKong
Senior Contributor IV

Winston

We are sorry for getting back to you so late. Are you still stuck with the issue? If you have somehow to resolved the

issue, can we close the discussion? If you still need Freescale help, please feel free to contact us.

Thanks,

Yixing

0 Kudos