Cannot set GPIO state with 'gpio_direction_output'

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

Cannot set GPIO state with 'gpio_direction_output'

503件の閲覧回数
Axent
Contributor II

Hello. I try to init GPIO in 'legacy' approach through GPIO number request.
I have the simple code:

 

//BASE for GPIO2 is : 448
//GPIO2_04 is : 448+4 = 452
gnum = gpio_request(452, "pin2");
if(gnum < 0) return -1;
//Configure as output and set HIGH level
gnum = gpio_direction_output(452, 1); //doesnt work. always 0 at output
if(gnum < 0) return -2;

 

 

All functions return with OK.
But.. when I touch my oscilloscope I see low-level at the line
Command promt:
cat /sys/kernel/debug/gpio shows me also - "out lo" (I m expecting "out hi")

Alsi I tried to read GPDAT register from memory. And this also shows me zero value in output.

What is going wrong? I cannot to set 'HIGH' level for any pin from GPIO2 block.
Thanks

タグ(1)
0 件の賞賛
返信
1 返信

478件の閲覧回数
June_Lu
NXP TechSupport
NXP TechSupport

Please share the MPU and SDK information

0 件の賞賛
返信