Cannot set GPIO state with 'gpio_direction_output'

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Cannot set GPIO state with 'gpio_direction_output'

647 次查看
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 回复

622 次查看
June_Lu
NXP TechSupport
NXP TechSupport

Please share the MPU and SDK information

0 项奖励
回复