MT7628学习笔记(1) 您所在的位置:网站首页 opengl3d机器人 MT7628学习笔记(1)

MT7628学习笔记(1)

2023-02-10 22:00| 来源: 网络整理| 查看: 265

使用开发板:hiwooya-MT7628

一、安装依赖 $ sudo apt-get update $ sudo apt-get install git g++ make libncurses5-dev subversion libssl-dev gawk libxml-parser-perl unzip wget python xz-utils vim zlibc zlib1g zlib1g-dev openjdk-8-jdk build-essential ccache gettext xsltproc

如果是 64 位操作系统,需要多操作如下步骤:(注意libc6:i386 libncurses5:i386 libstdc++6:i386 中间要加冒号)

$ sudo dpkg --add-architecture i386 $ sudo apt-get update $ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

二、编译U-boot

1、获取源码

方法一:

git clone https://github.com/hi-wooya/u-boot-hiwooya.git

方法二: 提取密码:94fd

安装openjdk 8: 

$ sudo apt-get install openjdk-8-jdk

2、进入U-boot源码目录

$ cd u-boot-hiwooya/

3、解压交叉编译工具链到 /opt 目录(交叉编译工具链在u-boot目录里面)

$ sudo tar xvfj buildroot-gcc342.tar.bz2 -C /opt/

4、图形界面配置参数

$ make clean $ make menuconfig 以 MT7628 内存 DDR2 为 128MBye,SPI Flash 为 16MBye 为例进行配置,配置如下: Chip ID: MT7628 // 选择主控芯片,MT7688 和 MT7628 通用 DRAM Type: DDR2 // 选择 DDR 类型,用的是 DDR2 DDR Component: 512Mb // 选择 DDR 大小,128MBye 就是 1024Mb,但是要考虑位宽 DDR Width: 16bits // 选择位宽

5、编译 U-Boot 源码

make

报错:

/bin/sh: 1: /opt/buildroot-gcc342/bin/mipsel-linux-as: not found /bin/sh: 1: [: Illegal number:  make: /opt/buildroot-gcc342/bin/mipsel-linux-gcc:命令未找到 /home/pjw/linux/MTK/MT7628/SDK/u-boot-hiwooya/config.mk:797: recipe for target 'cpu/ralink_soc/start.o' failed make: *** [cpu/ralink_soc/start.o] Error 127

问题:64位系统中缺少32位库文件导致的

解决:安装步骤一中的64位系统需要安装的依赖。

编译成功:

三、编译OpenWrt源码

1、获取源码

方法一:

$ git clone https://github.com/hi-wooya/openwrt-hiwooya.git

方法二: 提取密码:94fd

2、获取到源码,解压后执行以下命令:(更新包列表,并集成到menuconfig)

注意:以下命令更新很重要,不执行的话编译后会出错!!!  $ ./scripts/feeds update -a $ ./scripts/feeds install -a

3、直接使用配置好的配置文件

$ cp config-HIWOOYA16128 .config

4、图形界面配置参数

$ make menuconfig 16MB+128MB 配置: Target System: Ralink RT288x/RT3xxx Subtarget: MT7688 based boards Target Profile: HIWOOYA16128 32MB+128MB 配置: Target System: Ralink RT288x/RT3xxx Subtarget: MT7688 based boards Target Profile: HIWOOYA32128 16MB+64MB 配置: Target System: Ralink RT288x/RT3xxx Subtarget: MT7688 based boards Target Profile: HIWOOYA1664 32MB+64MB 配置: Target System: Ralink RT288x/RT3xxx Subtarget: MT7688 based boards Target Profile: HIWOOYA3264

5、下载 dl 放到源码顶层目录

在国内编译 OpenWrt 很困难,有很多包被墙无法下载。先单独下载下来,下载后解压放到  openwrt-hiwooya 根目录中即可,减少编译时间。已上传到CSDN:dl包下载地址。

6、编译源码(编译时间较久)

$ make V=99

编译成功后如下图: 

最终编译出来的固件存放在 openwrt-hiwooya/bin/ramips 目录,固件名为 *-squashfs-sysupgrade.bin。 可能出现的报错: collect2: error: ld returned 1 exit status Makefile:66: recipe for target 'shairport' failed make[4]: *** [shairport] Error 1 make[4]: Leaving directory '/home/pjw/linux/MTK/MT7628/openwrt-hiwooya/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/shairport_mmap' Makefile:58: recipe for target '/home/pjw/linux/MTK/MT7628/openwrt-hiwooya/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/shairport_mmap/.built' failed make[3]: *** [/home/pjw/linux/MTK/MT7628/openwrt-hiwooya/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/shairport_mmap/.built] Error 2 make[3]: Leaving directory '/home/pjw/linux/MTK/MT7628/openwrt-hiwooya/package/shairport_mmap' package/Makefile:191: recipe for target 'package/shairport_mmap/compile' failed make[2]: *** [package/shairport_mmap/compile] Error 2 make[2]: Leaving directory '/home/pjw/linux/MTK/MT7628/openwrt-hiwooya' package/Makefile:188: recipe for target '/home/pjw/linux/MTK/MT7628/openwrt-hiwooya/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.package_compile' failed make[1]: *** [/home/pjw/linux/MTK/MT7628/openwrt-hiwooya/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.package_compile] Error 2 make[1]: Leaving directory '/home/pjw/linux/MTK/MT7628/openwrt-hiwooya' /home/pjw/linux/MTK/MT7628/openwrt-hiwooya/include/toplevel.mk:181: recipe for target 'world' failed make: *** [world] Error 2 问题:源码包不完整 解决:执行步骤2的命令更新包列表,并集成到menuconfig。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有