AnsweredAssumed Answered

U-Boot Parameter Set by GPIO

Question asked by Paul DeMetrotion on Feb 15, 2016
Latest reply on Mar 16, 2016 by Victor Linnik

I am attempting to use a jumpered GPIO input to control the bootargs of my u-boot variables. I have added the following lines to my u-boot variables. The selected GPIO is read and the bootargs are changed if the bit is set; otherwise, there is no change.

 

        "bootargs=console=ttymxc2,115200n8 "                    \

            "root=/dev/mmcblk0p2 rootwait rw ${ip_config} "     \

            "lvds_panel=0\0"                                    \

        "setexpr tmpvar *20ac000 '&' 00000100\0"                \

        "if test ${tmpvar} != 0; then setenv bootargs "         \

            "'console=ttymxc2,115200n8 root=/dev/mmcblk0p2 "    \

            "rootwait rw ${ip_config} lvds_panel=1'; fi\0"          \

 

After booting to the u-boot prompt, the setexpr command does not appear to have executed and as a result the bootargs are never changed. There is no tmpvar in the list of environment variables when I run printenv.

 

If I execute the setexpr command from the prompt, it appears to work and there is a tmpvar entry in the variables. I can then successfully run the 'if test ...' statement successfully.

 

Does anybody have experience trying to use GPIO signals during boot? Is the setexpr command only for command prompt use? Am I doing this correctly?

Outcomes