第一步 移植Uboot
http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide(官方文档仅供参考,与实际编译有出入,总体内容丰富,涵盖了所有启动方法的介绍,请详细阅读)。
在AM335x中,ROM代码充当引导加载程序,有时称为初始程序加载程序(IPL)或主程序加载程序(PPL)。通过U-Boot二进制文件在两个连续的阶段完成booting。第一阶段U-BOOT的二进制被称为二级程序装入程序(SPL)或MLO。第二U-BooD阶段的二进制被简单地称为U-BooD。SPL是非交互式加载器,是U-BooD的一种特殊版本。它是在构建U-BooT时并发构建的。
ROM代码可以从以下任何设备加载SPL图像
交叉编译工具链下载地址:https://releases.linaro.org/components/toolchain/gcc-linaro/5.2-2015.11/(编译uboot提示版本低)
https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/(换成7.2.1即可)
具体编译方法参考这个博客:https://blog.csdn.net/zy812248258/article/details/39252733
首先
下载TI官方文件,地址如下:http://www.ti.com/tool/beaglebk#technicaldocuments 选择:PROCESSOR-SDK-LINUX-AM335X :Linux Processor SDK for AM335x 选择get software 进入 http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/latest/index_FDS.html 下载
am335x-evm-linux-sdk-src-05.01.00.11.tar.xz |
step1:在进行任何操作之前,先清除源码树,$make distclean
step2:编译之前的配置工作 $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 O=am335x_beaglebone_black am335x_boneblack_defconfig
step3: 正式编译 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 O=am335x_beaglebone_black all
第二步 移植内核(方法A-C还未走通)
方法X:
参考借鉴了这位兄弟的方法:https://blog.csdn.net/zy812248258/article/details/39253989
编译方法见:http://processors.wiki.ti.com/index.php?oldid=149205#Getting_the_Code
我实现的步骤为如下:
一、到kernel.org下载linux-4.9内核
二、下载gcc-linaro-5.2-2015.11-x86_64_arm-linux-gnueabihf.tar 交叉编译器并修改环境变量
三、 在http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/latest/index_FDS.html 下载am335x-evm-sdk-src-06.00.00.00.tar,将内核源码中arch/arm/configs中的tisdk_am335x-evm_defconfig(一说:bb.org_defconfig)拷贝到linux-4.9内核arch/arm/configs的目录中
四、执行命令 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig 生成 .config文件
五、执行make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage 生成 zImage 文件
生成设备树
六:执行命令:make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x-boneblack.dtb (注:由于粗心没有输入ARCH=arm 导致编译出错)
七:执行命令:make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules 产生模块
方法A:
https://elinux.org/Building_BBB_Kernel#Downloading_and_building_the_Linux_Kernel
方法B:
打开beaglebone官网
在 Other currently available software images 标题下找到如下内容:
At the time of release, not all of these distributions support BeagleBone Black, but should soon.
- Texas Instruments releases: Android, Linux, StarterWare (no OS)
- Linux: Debian, Angstrom Distribution, Ubuntu, ArchLinux, Gentoo, Sabayon, Buildroot, Erlang, Fedora
- Other: QNX, FreeBSD
- Projects page
- 选择Debian 进入https://beagleboard.org/p/robertcnelson-myopenid-com/debian-ab3bb7页面
在网页底部找到
For Debian images for boards other than BeagleBone, check out http://elinux.org/BeagleBoardDebian.字样
然后由https://elinux.org/BeagleBoardDebian中的第9项找到Building Kernel 链接选择BeagleBone Black进入
https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black网页
未走通
方法C:
打开beagle bone 官网,在 Other currently available software images 标题下找到如下内容
At the time of release, not all of these distributions support BeagleBone Black, but should soon.
- Texas Instruments releases: Android, Linux, StarterWare (no OS)
- Linux: Debian, Angstrom Distribution, Ubuntu, ArchLinux, Gentoo, Sabayon, Buildroot, Erlang, Fedora
- Other: QNX, FreeBSD
- Projects page
- 选择Debian 进入https://beagleboard.org/p/robertcnelson-myopenid-com/debian-ab3bb7页面