This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: How to enable gpio command in u-boot

Part Number: AM625

I am using AM62 uboot and would like to use the gpio command for debugging work.

At the moment, the uboot built with reference to the following is working by writing to eMMC via DFU, but the gpio command is not available.

software-dl.ti.com/.../UG-General-Info.html


Therefore, I opened menucofig with the following command, opened configs/am62x_evm_a53_defconfig from load, changed CONFIG_CMD_GPIO to y and built again.

sudo make menuconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf-

Then,  I have not found any errors in include/common.h:16's include/ config.h:4:10 at include/common.h:16, but it failed with No such file or directory.

I do not understand the cause of this. Do I need to bring anything additional?
By the way, if I edit am62x_evm_a53_defconfig directly and set CONFIG_CMD_GPIO=y, it does not work correctly, but the build succeeds and I can execute the command.

=> gpio set 409
i2c_write: error waiting for data ACK (status=0x116)
pca953x gpio@22: Error reading output register
GPIO: '409' not found
Command 'gpio' failed: Error -121
=> gpio clear 409
i2c_write: error waiting for data ACK (status=0x116)
pca953x gpio@22: Error reading output register
GPIO: '409' not found
Command 'gpio' failed: Error -121
=>

  • Hello,

    Can you provide the full log when you try to compile after using menuconfig?

    Can you also provide the output of 'gpio status' at the U-Boot prompt?

    Best Regards,

    Anshu

  • Hello, Anshu!

    The following is a log of the build process.

    ubuntu@ubuntu-VirtualBox:~$ make am62x_evm_a53_defconfig O=build/arm64 -j4 ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu-
    make[1]: Entering directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/build/arm64'
      HOSTCC  scripts/basic/fixdep
      GEN     ./Makefile
      HOSTCC  scripts/kconfig/conf.o
      YACC    scripts/kconfig/zconf.tab.c
      LEX     scripts/kconfig/zconf.lex.c
      HOSTCC  scripts/kconfig/zconf.tab.o
      HOSTLD  scripts/kconfig/conf
    #
    # configuration written to .config
    #
    make[1]: Leaving directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/build/arm64'
    
    
    
    ubuntu@ubuntu-VirtualBox:~$ make ATF=/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/prebuilt-images/bl31.bin TEE=/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/prebuilt-images/bl32.bin DM=/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/prebuilt-images/ipc_echo_testb_mcu1_0_release_strip.xer5f O=build/arm64 -j4 ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu-
    make[1]: Entering directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/build/arm64'
      GEN     ./Makefile
    scripts/kconfig/conf  --syncconfig Kconfig
      UPD     include/config.h
      CFG     u-boot.cfg
      GEN     include/autoconf.mk.dep
      CFG     spl/u-boot.cfg
    In file included from /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/include/common.h:16:
    include/config.h:4:10: fatal error: configs/.h: No such file or directory
        4 | #include <configs/.h>
          |          ^~~~~~~~~~~~
    compilation terminated.
    In file included from /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/include/common.h:16:
    include/config.h:4:10: fatal error: configs/.h: No such file or directory
        4 | #include <configs/.h>
          |          ^~~~~~~~~~~~
    compilation terminated.
    In file included from /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/include/common.h:16:
    include/config.h:4:10: fatal error: configs/.h: No such file or directory
        4 | #include <configs/.h>
          |          ^~~~~~~~~~~~
    compilation terminated.
    /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/scripts/Makefile.autoconf:48: recipe for target 'include/autoconf.mk.dep' failed
    make[2]: *** [include/autoconf.mk.dep] Error 1
    make[2]: *** Waiting for unfinished jobs....
    /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/scripts/Makefile.autoconf:77: recipe for target 'u-boot.cfg' failed
    make[2]: *** [u-boot.cfg] Error 1
    /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/scripts/Makefile.autoconf:80: recipe for target 'spl/u-boot.cfg' failed
    make[2]: *** [spl/u-boot.cfg] Error 1
    make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
    make[1]: *** Waiting for unfinished jobs....
    ===================== WARNING ======================
    This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate
    to binman instead, to avoid the proliferation of
    arch-specific scripts with no tests.
    ====================================================
      CFGCHK  u-boot.cfg
    make[1]: Leaving directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/build/arm64'
    Makefile:167: recipe for target 'sub-make' failed
    make: *** [sub-make] Error 2
    

    Also, the following is a log of a "gpio status" run after a build in which only CONFIG_CMD_GPIO was manually changed to y.

    No errors occurred in this build.

    => gpio status
    i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@22: Error reading output register
    Command 'gpio' failed: Error -121
    =>

    Thank you for your continued support.

  • Hello,

    Our U-Boot expert is out of office for the next week, so I'll try to provide assistance where I can.

    Can you try this command:

    export UBOOT_DIR=<SDK install path>/board-support/u-boot-<version>
    
    make ARCH=arm CROSS_COMPILE=<Full Path to the CC>/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- am62x_evm_a53_defconfig O=$UBOOT_DIR/out/a53
    

    For future readers, CONFIG_CMD_GPIO is set to yes by default in SDK 9.0+.

    Best Regards,

    Anshu

  • Hello,

    Would that be equivalent to what is described in the aforementioned link?
    The command at make after menuconfig already uses it.

    Best Regards,

  • Hello,

    Yes its similar. I was able to build it on my end that way, so I ask you to do the same in case it helped.

    Thanks,

    Anshu

  • Hello, 

    I tried again using the command you told me to use, but I got the same error as last time, except the output hierarchy was different.
    I am passing the full path to the compiler.

    Best regards.

  • The log is below.

    ubuntu@ubuntu-VirtualBox:~/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654$ make menuconfig ARCH=arm CROSS_COMPILE=/home/ubuntu/shared/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-none-linux-gnu-
      HOSTCC  scripts/kconfig/mconf.o
      HOSTCC  scripts/kconfig/lxdialog/checklist.o
      HOSTCC  scripts/kconfig/lxdialog/inputbox.o
      HOSTCC  scripts/kconfig/lxdialog/menubox.o
      HOSTCC  scripts/kconfig/lxdialog/textbox.o
      HOSTCC  scripts/kconfig/lxdialog/util.o
      HOSTCC  scripts/kconfig/lxdialog/yesno.o
      HOSTLD  scripts/kconfig/mconf
    scripts/kconfig/mconf  Kconfig
    
    
    *** End of the configuration.
    *** Execute 'make' to start the build or try 'make help'.
    
    ubuntu@ubuntu-VirtualBox:~/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654$ make -j4 ARCH=arm CROSS_COMPILE=/home/ubuntu/shared/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-none-linux-gnu- am62x_evm_a53_defconfig O=out/a53 
    make[1]: Entering directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/out/a53'
      HOSTCC  scripts/basic/fixdep
      GEN     ./Makefile
      HOSTCC  scripts/kconfig/conf.o
      YACC    scripts/kconfig/zconf.tab.c
      LEX     scripts/kconfig/zconf.lex.c
      HOSTCC  scripts/kconfig/zconf.tab.o
      HOSTLD  scripts/kconfig/conf
    #
    # configuration written to .config
    #
    make[1]: Leaving directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/out/a53'
    ubuntu@ubuntu-VirtualBox:~/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654$ make ATF=/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/prebuilt-images/bl31.bin TEE=/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/prebuilt-images/bl32.bin DM=/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/prebuilt-images/ipc_echo_testb_mcu1_0_release_strip.xer5f O=out/a53 -j4 ARCH=arm CROSS_COMPILE=/home/ubuntu/shared/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-none-linux-gnu-
    make[1]: Entering directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/out/a53'
      GEN     ./Makefile
    scripts/kconfig/conf  --syncconfig Kconfig
      UPD     include/config.h
      CFG     u-boot.cfg
      GEN     include/autoconf.mk.dep
      CFG     spl/u-boot.cfg
    In file included from /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/include/common.h:16:
    include/config.h:4:10: fatal error: configs/.h: No such file or directory
        4 | #include <configs/.h>
          |          ^~~~~~~~~~~~
    compilation terminated.
    In file included from /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/include/common.h:16:
    include/config.h:4:10: fatal error: configs/.h: No such file or directory
        4 | #include <configs/.h>
          |          ^~~~~~~~~~~~
    compilation terminated.
    In file included from /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/include/common.h:16:
    include/config.h:4:10: fatal error: configs/.h: No such file or directory
        4 | #include <configs/.h>
          |          ^~~~~~~~~~~~
    compilation terminated.
    /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/scripts/Makefile.autoconf:48: recipe for target 'include/autoconf.mk.dep' failed
    make[2]: *** [include/autoconf.mk.dep] Error 1
    make[2]: *** Waiting for unfinished jobs....
    /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/scripts/Makefile.autoconf:77: recipe for target 'u-boot.cfg' failed
    make[2]: *** [u-boot.cfg] Error 1
    /home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/scripts/Makefile.autoconf:80: recipe for target 'spl/u-boot.cfg' failed
    make[2]: *** [spl/u-boot.cfg] Error 1
    make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
    make[1]: Leaving directory '/home/ubuntu/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654/out/a53'
    Makefile:167: recipe for target 'sub-make' failed
    ubuntu@ubuntu-VirtualBox:~/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654$ 
    
    

  • Hello,

    I'll try to get some else to comment on this. Thank you for your patience.

    Best Regards,

    Anshu

  • Hello,

    After discussion internally, the top level makefile should also work as a way to compile: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_02_01_10/exports/docs/linux/Overview/Top_Level_Makefile.html

    Try using the top-level makefile to see if the error persists.

    Best Regards,

    Anshu