MTK APSOC 5.0.2 Build Process

2024-02-10 06:18
文章标签 build process 5.0 mtk apsoc

本文主要是介绍MTK APSOC 5.0.2 Build Process,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Host gcc version : gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Target gcc version: mipsel-buildroot-linux-uclibc-gcc-4.6.3

下面是在ubuntu 16.64 x64上编译MTK_APSoC_SDK V5.0.2的过程.

Source 编译过程

recipe for target ‘extra/locale/wctables.h’ failed

  GEN extra/locale/lt_defines.hHOSTCC extra/locale/gen_wctype
extra/locale/gen_wctype.c: In function 'main':
extra/locale/gen_wctype.c:684:2: warning: #warning fix the upper bound on the upper/lower tables... save 200 bytes or so [-Wcpp]#warning fix the upper bound on the upper/lower tables... save 200 bytes or so^GEN extra/locale/wctables.h
extra/locale/Makefile.in:179: recipe for target 'extra/locale/wctables.h' failed
make[1]: *** [extra/locale/wctables.h] Error 1
make[1]: Leaving directory '/home/thomas/work/mtk/MTK_APSoC_SDK/source/uClibc-0.9.33.2'
Makefile:892: recipe for target 'uClibc-0.9.33.2_only' failed
make: *** [uClibc-0.9.33.2_only] Error 2

vi ./uClibc-0.9.33.2/Rules.mak

修改编译警告 Wall 为 W


error: ‘__LOCALE_DATA_WCctype_II_LEN’ undeclared here

In file included from extra/locale/gen_ldc.c:45:0:
extra/locale/locale_mmap.h:11:45: error: '__LOCALE_DATA_WCctype_II_LEN' undeclared here (not in a function)#define __LOCALE_DATA_WCctype_TBL_LEN      (__LOCALE_DATA_WCctype_II_LEN + __LOCALE_DATA_WCctype_TI_LEN + __LOCALE_DATA_WCctype_UT_LEN)^
extra/locale/locale_mmap.h:46:32: note: in expansion of macro '__LOCALE_DATA_WCctype_TBL_LEN'const unsigned char tblwctype[__LOCALE_DATA_WCctype_TBL_LEN];^
extra/locale/locale_mmap.h:11:76: error: '__LOCALE_DATA_WCctype_TI_LEN' undeclared here (not in a function)#define __LOCALE_DATA_WCctype_TBL_LEN      (__LOCALE_DATA_WCctype_II_LEN + __LOCALE_DATA_WCctype_TI_LEN + __LOCALE_DATA_WCctype_UT_LEN)^
extra/locale/locale_mmap.h:46:32: note: in expansion of macro '__LOCALE_DATA_WCctype_TBL_LEN'

/source/uClibc-0.9.33.2/#  patch -p0 < gen_wctype.patch

Download gen_wctype.patch from http://ftp.osuosl.org/pub/manulix/scripts/build-scripts/PPFILES/ppfiles-uclibc/gen_wctype.patch


Busybox no menuconfig

make[1]: Entering directory '/home/thomas/work/mtk/MTK_APSoC_SDK/source/user/busybox'
Makefile:437: *** mixed implicit and normal rules: deprecated syntax
Makefile:1278: *** mixed implicit and normal rules: deprecated syntax
make[1]: *** No rule to make target 'menuconfig'.  Stop.
make[1]: Leaving directory '/home/thomas/work/mtk/MTK_APSoC_SDK/source/user/busybox'
Makefile:306: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2

参见:https://www.cnblogs.com/weidongshan/p/8036182.html

分析原因:
新版Makefile不支持这样的组合目标:config %config(一个有通配符,另一个没有通配符)解决方法:
要么把config %config拆成2个规则,要么把其中一个目标去掉。所以,
a.修改busybox-1.7.0 顶层Makefile 405行:
config%config: scripts_basic outputmakefile FORCE
改为:
%config:scripts_basic outputmakefile FORCEb.修改busybox-1.7.0 顶层Makefile 1242行:
/%/: prepare scripts FORCE
改为:
%/:prepare scripts FORCE

LZMA ERROR 1 When kernel bootup

Bytes transferred = 4302136 (41a538 hex)
NetBootFileXferSize= 0041a538
Automatic boot of image at addr 0x80A00000 ...
## Booting image at 80a00000 ...Image Name:   Linux Kernel ImageImage Type:   MIPS Linux Kernel Image (lzma compressed)Data Size:    4302072 Bytes =  4.1 MBLoad Address: 80001000Entry Point:  803af3c0Verifying Checksum ... OKUncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover

The reason is higher verison of lzma is not back compatible.
MTK use an old version of lzma and mksquashfs to compress the kernel and rootfs.


mksquash_lzma-3.2 连接出错

cc   mksquashfs.o read_fs.o sort.o  -L/home/thomas/work/mtk/MTK_APSoC_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_Alone -L/home/thomas/work/mtk/MTK_APSoC_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C -lpthread -lunlzma_r -llzma_r -lstdc++ -lz -o mksquashfs
/usr/bin/ld: mksquashfs.o: undefined reference to symbol 'log10@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'mksquashfs' failed
make[1]: *** [mksquashfs] Error 1
make[1]: Leaving directory '/home/thomas/work/mtk/MTK_APSoC_SDK/toolchain/mksquash_lzma-3.2/squashfs3.2-r2/squashfs-tools'
Makefile:28: recipe for target 'all' failed
make: *** [all] Error 

https://blog.csdn.net/chaehom/article/details/7776047

After build, do not make install, just copy files:

~/work/mtk/MTK_APSoC_SDK/toolchain/mksquash_lzma-3.2/squashfs3.2-r2/squashfs-tools$ cp mksquashfs /opt/buildroot-gcc463/usr/bin/mksquashfs_lzma-3.2

cp /home/thomas/work/mtk/MTK_APSoC_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_Alone/lzma_alone /opt/buildroot-gcc463/usr/bin/


squashfs4.2 编译错误

thomas@PC3039:~/work/mtk/MTK_APSoC_SDK/toolchain/squashfs4.2/squashfs-tools$ make
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o mksquashfs.o mksquashfs.c
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o read_fs.o read_fs.c
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o sort.o sort.c
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o swap.o swap.c
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o pseudo.o pseudo.c
pseudo.c:69:13: warning: ‘dump_pseudo’ defined but not used [-Wunused-function]static void dump_pseudo(struct pseudo *pseudo, char *string)^
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o compressor.o compressor.c
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o gzip_wrapper.o gzip_wrapper.c
cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"xz\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o xz_wrapper.o xz_wrapper.c
xz_wrapper.c:28:18: fatal error: lzma.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'xz_wrapper.o' failed
make: *** [xz_wrapper.o] Error 1

sudo apt-get install liblzma-dev

~/work/mtk/MTK_APSoC_SDK/toolchain/squashfs4.2/squashfs-tools$ cp mksquashfs /opt/buildroot-gcc463/usr/bin/mksquashfs_lzma-4.2


更换lzma 和mksquashfs 工具后,MTK SDK可以正常运行!!

Ethernet 正常工作了, 但是无线部分没有驱动起来, 还有不少后续工作.


UBOOT Build 过程

首先make menuconfig,按照开发板配置如下选择:
在这里插入图片描述

注意:我采用的板子网络需要如下配置:
在这里插入图片描述
然后执行make, 出现了下面一些错误:

/bin/sh: 1: [: Illegal number: 03-64) 2

/opt/mips-2012.03/bin/../lib/gcc/mips-sde-elf/4.6.3/include -pipe  -DCONFIG_MIPS -D__MIPS__ -mabicalls -DRALINK_MDIO_ACCESS_FUN -DRALINK_DUAL_VPE_FUN -EL -mmt -mips32r2 -DRALINK_SPI_UPGRADE_CHECK -DRALINK_RW_RF_REG_FUN -DRALINK_UPGRADE_BY_SERIAL -DRALINK_CMDLINE -DRALINK_EPHY_INIT -DCONFIG_LZMA -DASIC_BOARD -DMT7621_ASIC_BOARD -DMT7621_MP -DMAC_TO_GIGAPHY_MODE_ADDR=0x1e -DMAC_TO_100PHY_MODE -DMT7621_USE_GE1 -DGE_MII_AN -DRALINK_EV_BOARD_PVLAN -DPDMA_NEW -DRX_SCATTER_GATTER_DMA -DUBOOT_ROM -DON_BOARD_DDR3 -DON_BOARD_DDR_WIDTH_16 -DON_BOARD_16BIT_DRAM_BUS -DON_BOARD_2048M_DRAM_COMPONENT -DCFG_ENV_IS_IN_SPI -Wall -Wstrict-prototypes -c -o i2c_drv.o i2c_drv.c
/bin/sh: 1: [: Illegal number: 03-64) 2
i2c_drv.c:1:0: warning: cannot use small-data accesses for '-mabicalls' [enabled by default]
"/opt/mips-2012.03/bin"/mipsel-linux-gcc -gdwarf-2 -DDEBUG -Os   -D__KERNEL__ -DTEXT_BASE=0xBFC00000 -I/home/thomas/work/mtk/MTK_APSoC_SDK/Uboot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/mips-2012.03/bin/../lib/gcc/mips-sde-elf/4.6.3/include -pipe  -DCONFIG_MIPS -D__MIPS__ -mabicalls -DRALINK_MDIO_ACCESS_FUN -DRALINK_DUAL_VPE_FUN -EL -mmt -mips32r2 -DRALINK_SPI_UPGRADE_CHECK -DRALINK_RW_RF_REG_FUN -DRALINK_UPGRADE_BY_SERIAL -DRALINK_CMDLINE -DRALINK_EPHY_INIT -DCONFIG_LZMA -DASIC_BOARD -DMT7621_ASIC_BOARD -DMT7621_MP -DMAC_TO_GIGAPHY_MODE_ADDR=0x1e -DMAC_TO_100PHY_MODE -DMT7621_USE_GE1 -DGE_MII_AN -DRALINK_EV_BOARD_PVLAN -DPDMA_NEW -DRX_SCATTER_GATTER_DMA -DUBOOT_ROM -DON_BOARD_DDR3 -DON_BOARD_DDR_WIDTH_16 -DON_BOARD_16BIT_DRAM_BUS -DON_BOARD_2048M_DRAM_COMPONENT -DCFG_ENV_IS_IN_SPI -Wall -Wstrict-prototypes -c -o mii_mgr.o mii_mgr.c
/bin/sh: 1: [: Illegal number: 03-64) 2

修改./cpu/ralink_soc/config.mk 中的shell 比较,改成直接赋值:
MIPSFLAGS="-mabicalls"


mt7621_ddr.sh unexpected operator

./mt7621_ddr.sh: 6: [: _2048M: unexpected operator
./mt7621_ddr.sh: 15: [: IN_SPI: unexpected operator

因为ubuntu默认的sh是连接到dash的,dash跟bash的不兼容所以出错了.

    修改sh默认连接到bash, 执行下面的命令,选择NO.

sudo dpkg-reconfigure dash


用tftp 下载uboot.bin并且烧录到spi flash后, 该uboot能运行, 但网络配置不对,不能再使用tftpboot下载.

修改uboot配置 GE1 Connected to : GE_MII_AN --> GE_RGMII_FORCE_1000

使用串口kermit下载烧录后网络功能恢复正常.

Kermit 安装配置

sudo apt-get install ckermit
~/.kermrc

set line /dev/ttyUSB0  
set speed 57600  
set carrier-watch off  
set handshake none  
set flow-control none  
robust
set file type bin  
set file name lit  
set rec pack 1000  
set send pack 1000  
set window 5 define rz !rz < /dev/ttyUSB0 > /dev/ttyUSB0    
define sz !sz \%0 > /dev/ttyUSB0 < /dev/ttyUSB0

参考:https://blog.csdn.net/zijie_xiao/article/details/53283963

这篇关于MTK APSOC 5.0.2 Build Process的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/696335

相关文章

Maven pom.xml文件中build,plugin标签的使用小结

《Mavenpom.xml文件中build,plugin标签的使用小结》本文主要介绍了Mavenpom.xml文件中build,plugin标签的使用小结,文中通过示例代码介绍的非常详细,对大家的学... 目录<build> 标签Plugins插件<build> 标签<build> 标签是 pom.XML

你的华为手机升级了吗? 鸿蒙NEXT多连推5.0.123版本变化颇多

《你的华为手机升级了吗?鸿蒙NEXT多连推5.0.123版本变化颇多》现在的手机系统更新可不仅仅是修修补补那么简单了,华为手机的鸿蒙系统最近可是动作频频,给用户们带来了不少惊喜... 为了让用户的使用体验变得很好,华为手机不仅发布了一系列给力的新机,还在操作系统方面进行了疯狂的发力。尤其是近期,不仅鸿蒙O

MCU7.keil中build产生的hex文件解读

1.hex文件大致解读 闲来无事,查看了MCU6.用keil新建项目的hex文件 用FlexHex打开 给我的第一印象是:经过软件的解释之后,发现这些数据排列地十分整齐 :02000F0080FE71:03000000020003F8:0C000300787FE4F6D8FD75810702000F3D:00000001FF 把解释后的数据当作十六进制来观察 1.每一行数据

Android 10.0 mtk平板camera2横屏预览旋转90度横屏拍照图片旋转90度功能实现

1.前言 在10.0的系统rom定制化开发中,在进行一些平板等默认横屏的设备开发的过程中,需要在进入camera2的 时候,默认预览图像也是需要横屏显示的,在上一篇已经实现了横屏预览功能,然后发现横屏预览后,拍照保存的图片 依然是竖屏的,所以说同样需要将图片也保存为横屏图标了,所以就需要看下mtk的camera2的相关横屏保存图片功能, 如何实现实现横屏保存图片功能 如图所示: 2.mtk

Unity Post Process Unity后处理学习日志

Unity Post Process Unity后处理学习日志 在现代游戏开发中,后处理(Post Processing)技术已经成为提升游戏画面质量的关键工具。Unity的后处理栈(Post Processing Stack)是一个强大的插件,它允许开发者为游戏场景添加各种视觉效果,如景深、色彩校正、辉光、模糊等。这些效果不仅能够增强游戏的视觉吸引力,还能帮助传达特定的情感和氛围。 文档

MTK Android P/Q system/vendor/super快速打包

一、Android 新版本默认开启了动态分区,把system vendor  product等分区打包成一个super分区。这对于我们使用替换分区的方法来排查问题不是很方便,直接替换一个super也不知道到底是哪个部分导致的。所以我们需要自己制作super.img来缩小范围。下面讲讲如何快速生成system、vendor、super,以及vbmeta(校验image,不匹配可能会导致不开机) 二

MTK平台AndroidP/Q快速生成dtb.img和dtbo.img(2秒生成)

背景: MTK升级新的Android版本后,无法快速编译dtbo image,当我们修改DWS和PROJECT DTS后验证问题非常麻烦,必须删除out下KERNEL_OBJ才能生成新的dtbo.img,而且必须整编。 所以跟据编译流程,写了下面这个脚本,可以快速生成dtbo和dtb image,可以几秒钟完成 使用方法: (1)将脚本放在工程跟目录 (2)修改脚本开头的几个变量,改为你

MTK AndroidP/Q快速打包ramdisk

一、Android P/Q ramdisk与老版本的差异 Android老版本的ramdisk是out下的root/ramdisk打包而来,里面包含了init  /sbin  init.rc   default.prop等文件。是一个完整的ramdisk Android新版本ramdisk分为了out 下的ramdisk目录和root目录,init ,init.rc等文件大部分都放到了syst

Android P/Q MTK平台无依赖打包boot.img

背景:        有时排查版本问题,需要用到替换img的方式来查找问题出现在哪个img,若出现在bootimg,那到底是kernel、DTB 还是ramdisk。此时就需要单独替换其中一个的方式来打包,之前直接make bootimage-nodeps就可以了,但现在发现执行这个命令无效了。下面就分析下新版本如何找到正确的打包命令。 一、找到编译boot的命令 之前Android编译lo

鸿蒙开发5.0【Picker的受限权限适配方案】

Picker由系统独立进程实现,应用可以通过拉起Picker组件,用户在Picker上选择对应的资源(如图片、文档等),应用可以获取Picker返回的结果。 类型受限权限使用的picker音频ohos.permission.READ_AUDIO,ohos.permission.WRITE_AUDIOAudioViewPicker文件ohos.permission.READ_DOCUMENT,oh