Basic syntax question

Damien LEFEVRE lefevre.da at gmail.com
Wed Apr 8 10:27:04 CEST 2020


Hi,

I'm new to u-boot. I'm trying to store the return value of gpio command to
a variable.

I have the following, (switch released):
Tegra186 (P2771-0000-500) # gpio input FF1
gpio: pin FF1 (gpio 241) value is 1
Tegra186 (P2771-0000-500) # setexpr X 'gpio input FF1'
Tegra186 (P2771-0000-500) # echo $X
0

But I'm expecting X to be 1, the return value of gpio.

If I press the switch I see the value change to 0, so I know the gpio state
changes
Tegra186 (P2771-0000-500) # gpio input FF1
gpio: pin FF1 (gpio 241) value is 0

Thanks,
-Damien


More information about the U-Boot mailing list