S32G274A-RDB2 board yocto image GPIO set error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32G274A-RDB2 board yocto image GPIO set error

ソリューションへジャンプ
2,425件の閲覧回数
0xEC
Contributor IV

Hi everyone,

I am trying to get familiar with yocto on s32g274a-rdb2 board. I built an image and deploy it into sdcard works with u-boot, kernel etc. I am trying to control user led on the board which is connected to GPIO95, whenever i try to set GPIO by using following command on target:

>> echo 95 > /sys/class/gpio/export

i got following error message:

>> invalid argument

does anyone use GPIOs in s32g274a-rdb2 board from a53 core in yocto manner?

thanks in advance, 

 

 

タグ(3)
0 件の賞賛
返信
1 解決策
2,399件の閲覧回数
MayanksPatel
NXP Employee
NXP Employee

Hi @0xEC,

Thank you for reaching out to us.

you can not toggle GPIO directly because there were gpio controllers available on the board and through that controller, you can change the value of a particular GPIO.

By default, in the Yocto build libgpiod library included by using, you can change the value of GPIO.

Please refer to "S32G2_LinuxBSP_33.0_User_Manual.pdf Chapter-20" for more detail.

Please use the below command which will turn on GPIO95 for 10 seconds.

sudo gpioset --mode=time --sec=10 gpiochip0 95=0 //Turn ON GREEN LED 

sudo gpioset --mode=time --sec=10 gpiochip0 95=1//Turn OFF GREEN LED

 

Hope this helps you.

 

Thanks,

Mayank s Patel

元の投稿で解決策を見る

5 返答(返信)
1,902件の閲覧回数
ankit0812
Contributor I

I want to access GPIO ports from my c++ application for S32G3 board. Can anyone help me with which library and header files I should include from the bsp-sdk

 

0 件の賞賛
返信
2,400件の閲覧回数
MayanksPatel
NXP Employee
NXP Employee

Hi @0xEC,

Thank you for reaching out to us.

you can not toggle GPIO directly because there were gpio controllers available on the board and through that controller, you can change the value of a particular GPIO.

By default, in the Yocto build libgpiod library included by using, you can change the value of GPIO.

Please refer to "S32G2_LinuxBSP_33.0_User_Manual.pdf Chapter-20" for more detail.

Please use the below command which will turn on GPIO95 for 10 seconds.

sudo gpioset --mode=time --sec=10 gpiochip0 95=0 //Turn ON GREEN LED 

sudo gpioset --mode=time --sec=10 gpiochip0 95=1//Turn OFF GREEN LED

 

Hope this helps you.

 

Thanks,

Mayank s Patel

2,393件の閲覧回数
0xEC
Contributor IV
hi @MayanksPatel
Thank you for reply,
I did set as you say, it works by gpioset command,
Further question, how can i use gpios in c program, which headers should i use, i am suffering to find documentation about yocto and this board programming in yocto manner.
Best,
0 件の賞賛
返信
2,390件の閲覧回数
MayanksPatel
NXP Employee
NXP Employee

Hi @0xEC ,

One way by which you use those commands using a system call from the c Program.

system(command(GPIO Set Command)).

 

2,385件の閲覧回数
0xEC
Contributor IV
Ok @MayanksPatel thank you,
Best,
0 件の賞賛
返信