本系列调试说明记录了Linux在全志T113-S3/S4平台上的移植过程,说明过程中可能会技术瑕疵,希望大家提供宝贵意见。
本文移植的硬件平台来自于盈鹏飞嵌入式的SBC-T113S(处理器是T113-S3)主板。
SBC-T113S产品特性:
- 采用Allwinner公司Cortex-A7双核T113-S3/S4处理器,运行最高速度为1.2GHZ;
- 内置64-bit XuanTie C906 RISC-V协处理器(仅T113-S4支持);
- 支持JPEG/MJPEG视频编码,最大分辨率1080p@60fps;支持多格式1080P@60fps视频解码 (H.265,H.264, MPEG-1/2/4);
- 支持RGB666/LVDS/MIPI-DSI,分辨率最高1920x1080;
- 支持128-256M Bytes DDR3 SDRAM,其中T113-S3内置128MB;T113-S4内置256MB;
- 支持SPI NAND存储和启动(默认:256MB;最大1GB)或者EMMC启动(默认:4GB,最大32GB);
- 支持一路USB2.0 OTG(设计为TYPE-A接口);支持二路USB2.0 HOST;
- 支持七路RS232通信或者6路RS232和1路RS485(隔离);
- 支持一路CAN BUS通信(隔离);
- 支持一路10/100M以太网;
- 稳定的操作系统的支持,可预装LINUX 5.4或者OpenWRT;
- 经典尺寸主板,尺寸为120*100MM;
产品功能评估图:
产品尺寸:
编译报错日志
make[3]: *** ../: Is a directory. Stop.
>>> dhcpcd 7.0.3 Building PATH="/home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/host/bin:/home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" /usr/bin/make -C /home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/build/dhcpcd-7.0.3 all for x in src hooks; do cd $x; /usr/bin/make all; cd ..; done ------------------------------------------------------------------------------------------------------ /home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/host/bin/arm-linux-gnueabi-gcc -fPIC -DPIC -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -DNDEBUG -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DINET -DARP -DARPING -DIPV4LL -DINET6 -DDHCP6 -DAUTH -DPLUGIN_DEV -I../../ -I../..//src -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -std=c99 -I/home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/host/bin/../arm-buildroot-linux-gnueabi/sysroot/usr/include -c udev.c -o udev.So /home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/host/bin/arm-linux-gnueabi-gcc -Wl,-export-dynamic -shared -Wl,-x -o udev.so -Wl,-soname,udev.so \ udev.So -L/home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/host/bin/../arm-buildroot-linux-gnueabi/sysroot/usr/lib -ludev make[3]: *** ../: Is a directory. Stop. >>> dhcpcd 7.0.3 Installing to target ------------------------------------------------------------------------------ # Move RDM monotonic to new location if [ ! -e /home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/target/var/db/dhcpcd/rdm_monotonic -a \ -e /home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/target/var/db/dhcpcd/../dhcpcd-rdm.monotonic ]; \ then \ mv /home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/target/var/db/dhcpcd/../dhcpcd-rdm.monotonic \ /home/lxg/code/t113_linux/out/t113/evb1_auto/longan/buildroot/target/var/db/dhcpcd/rdm_monotonic; \ fi make[3]: *** ../: Is a directory. Stop.
调试方法
dhcpcd/Makefile
添加echo打印,辅助调试
SUBDIRS= src hooks
#######################
all: config.h
@echo "---------start-------------"
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
@echo "----------end--------------"
dhcpcd/hooks/Makefile
TOP= ..
include ${TOP}/iconfig.mk
@echo "-----------11111111111-----------"
#######################
all:
@echo "-----------hook start-----------"
${PROG} ${MAN8} ${SCRIPTS} ${EGHOOKSCRIPTS}
@echo "-----------hook end-------------"
编译输出发现11111111111未打印出来,说明此Makefile 文件编译报错,出错文件在iconfig.mk
dhcpcd/iconfig.mk
# Nasty hack so that make clean works without configure being run # Requires gmake4 TOP?= .
_CONFIG_MK!= test -e ${TOP}/config.mk && \
echo config.mk || echo config-null.mk
CONFIG_MK?= ${_CONFIG_MK}
include ${TOP}/${CONFIG_MK}
定位到CONFIG_MK变量为空,导致编译报错
编译验证方法
方法1
cd out/t113/evb1_auto/longan/buildroot/build/dhcpcd-7.0.3
make
方法2
rm -rf out/t113/evb1_auto/longan/buildroot/build/dhcpcd-7.0.3
./build.sh buildroot
修改方案
对比高版本的iconfig文件修改如下
# Nasty hack so that make clean works without configure being run TOP?= .
_CONFIG_MK!= test -e ${TOP}/config.mk && \
echo config.mk || echo config-null.mk
# add start _CONFIG_MK?= $(shell test -e ${TOP}/config.mk && \
echo config.mk || echo config-null.mk)
# add end
CONFIG_MK?= ${_CONFIG_MK}
include ${TOP}/${CONFIG_MK}
最终生成patch文件文件放入buildroot/buildroot-201902/package/dhcpcd/0001-iconfig-build-error.patch
diff --git a/iconfig.mk b/iconfig.mk
index 465e02ea..50c50340 100644 --- a/iconfig.mk +++ b/iconfig.mk @@ -1,7 +1,8 @@
# Nasty hack so that make clean works without configure being run
-# Requires gmake4 TOP?= .
_CONFIG_MK!= test -e ${TOP}/config.mk && \
echo config.mk || echo config-null.mk
+_CONFIG_MK?= $(shell test -e ${TOP}/config.mk && \ + echo config.mk || echo config-null.mk) CONFIG_MK?= ${_CONFIG_MK}
include ${TOP}/${CONFIG_MK}