raspberry 3B+ 編譯u-boot

參考博客linux

https://blog.csdn.net/maowendi/article/details/85611812ubuntu

https://blog.csdn.net/hengwei0412/article/details/81173482工具

PC 環境: ubuntu 18.04 虛擬機flex

1. 下載最新u-boot 源碼

cd /tmp/
wget http://ftp.denx.de/pub/u-boot/u-boot-2019.07-rc4.tar.bz2
tar -xjvf u-boot-2019.07-rc4.tar.bz2

2. 安裝交叉編譯工具鏈

# ubuntu 18.04下的安裝
sudo apt-get install gcc-aarch64-linux-gnu

#查看版本
aarch64-linux-gnu-gcc --version

3. 運行raspberry的編譯配置

#導出環境變量
export ARCH=arm 
export CROSS_COMPILE=aarch64-linux-gnu-

4. 編譯

#安裝解析配置文件須要的工具
sudo apt-get install bison
sudo apt-get install flex

# 生成.config文件
cd u-boot-2019.07-rc4
make rpi_3_defconfig V=1

# 安裝 menuconfig 須要用到的工具
sudo apt-get install libncurses5-dev
make menuconfig

make -j4

5. 配置sd卡

將編譯生成的 u-boot.bin 拷貝至SD卡/boot下,並重命名爲kernel8.imges5

6. 配置串口

在SD卡中的/boot/config.txt中增長一行enable_uart=1使能串口.net

7. 燒錄驗證

插入SD卡,鏈接串口,波特率默認爲115200。上電後看到uboot的輸出便移植成功了。code

相關文章
相關標籤/搜索