如何将GPIO添加到U-Boot SDK源?

时间:2018-07-02 09:26:42

标签: sdk cross-compiling bootloader u-boot

我想构建u-boot,但出现此错误:

LDS     u-boot.lds
LD      u-boot
common/built-in.o: In function `do_gpio':
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:186: undefined reference to `gpio_request'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:194: undefined reference to `gpio_direction_input'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:195: undefined reference to `gpio_get_value'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:200: undefined reference to `gpio_get_value'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:203: undefined reference to `gpio_direction_output'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:209: undefined reference to `gpio_free'
Segmentation fault (core dumped)
make[1]: *** [u-boot] Error 139
make: *** [sub-make] Error 2

我搜索了该问题,the guide如下:

  

GPIO是soc系统最低配置的一部分,试图   将其添加到系统中并重建。

但是如何将GPIO添加到SDK?我将p64参考板与arm64架构配合使用。谢谢。

1 个答案:

答案 0 :(得分:0)

这就是我为P212板编译U-Boot的全部步骤:

sudo apt-get install gcc-aarch64-linux-gnu
git clone http://git.denx.de/u-boot.git
cd u-boot
git checkout v2018.05
export CROSS_COMPILE=aarch64-linux-gnu-
make mrproper
make p212_defconfig
make

对于经过验证的引导,您需要FIT映像。使用

启用CONFIG_FIT
make menuconfig