set gpio imx8mn

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

set gpio imx8mn

1,424件の閲覧回数
razriel
Contributor III

I am trying to set gpio immidiatly after power cycle.

I want to do it in u-boot enviormant before kernel loads.

found two possible solutions:

1. use gpio-hog in device tree. so few example how to use in device trees of other boards.

2. setting it in board_init function under board/freescale/imx8mn_evk/imx8mn_evk.c by adding gpio_request gpio_direction_output.

I am using yocto imx-5.15.5-1.0.0 honister and cannot find much information how to do this.

I belive both approaches cannot work together. one will overwrite the other. 

which one I should use ?

BR,

Roy

 

BR,

Roy 

0 件の賞賛
返信
3 返答(返信)

1,401件の閲覧回数
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @razriel,

I hope you are doing well.

 

To set the GPIO during startup in U-Boot one could add a script to set the IO.
E.g.,

# setenv set-io 'gpio set <gpio-number>'
# setenv bootcmd 'run set-io; run ubiboot; run sdboot'
# saveenv

 

Or else you can use the board_init  function to access the GPIO.

 

Either one can be used.

 

Thank you.
Best Regards,
Dhruvit.

0 件の賞賛
返信

1,396件の閲覧回数
razriel
Contributor III

The method you suggest is not could for prouductization.

how do I make it part of the image creation and not something to be done manualy ?

0 件の賞賛
返信

1,392件の閲覧回数
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @razriel,

You can define a script in the environment variable, as described in my last reply for the automatic access of the GPIO. 

And for the board_init function method can also be part of the image creation. 

 

Best Regards,
Dhruvit.

0 件の賞賛
返信