当前位置:网站首页>Banana pie bpi-m5 toss record (2) -- compile u-boot
Banana pie bpi-m5 toss record (2) -- compile u-boot
2022-07-25 02:55:00 【Spend my whole life reading】
The process of tossing the development board is usually to burn the official release Mirror image , Then I was thinking about compiling myself kernal Making mirrors , Before that, you need to compile u-boot,u-boot It is mainly used to boot and load the kernel ,u-boot The compilation process is recorded as follows .
1 install toolchain
To look at first kernal and u-boot Supported by toolchain edition :
[email protected]:~/code/BPI5/BSP/BPI-M5-bsp$ find . -name "compiler-gcc*"
./linux-aml/include/linux/compiler-gcc.h
./linux-aml/tools/include/linux/compiler-gcc.h
./u-boot-aml/include/linux/compiler-gcc4.h
./u-boot-aml/include/linux/compiler-gcc3.h
./u-boot-aml/include/linux/compiler-gcc.h
[email protected]:~/code/BPI5/BSP/BPI-M5-bsp$
You can see that the supported versions are 3、4, So choose toolchain The version is 4.8, Download link :
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
https://releases.linaro.org/archive/14.04/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz
establish toolchain Path and unzip :
sudo mkdir -p /opt/toolchains
sudo tar xvf gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz -C /opt/toolchains/
sudo tar xvf gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz -C /opt/toolchains/
take toolchain Path to the environment variable :
sudo vim ~/.bashrc
Add the following at the end of the file :
export ARCH=arm64
export CROSS_COMPILE=aarch64-none-elf-
export PATH=/opt/toolchains/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:/opt/toolchains/gcc-linaro-arm-none-eabi-4.8-2014.04_linux/bin:$PATH
Carry out orders , Make the environment variable change take effect immediately :
source ~/.bashrc
Execute the following command , Test for successful installation :
aarch64-none-elf-gcc -v
If there are the following similar outputs, the installation is successful :
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin/../libexec/gcc/aarch64-none-elf/4.8.3/lto-wrapper
Target: aarch64-none-elf
......
Thread model: single
gcc version 4.8.3 20131111 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2013.11 - Linaro GCC 2013.10)
2 u-boot
download souce code:
git clone https://github.com/BPI-SINOVOIP/BPI-M5-bsp
cd BPI-M5-bsp
git submodule update --init --recursive
This process takes a long time to download ,,code It contains kernal and u-boot, Only compile this time uboot, Execute the compile script :
./build.sh
give the result as follows :
[email protected]:~/code/BPI5/BSP/BPI-M5-bsp$ ./build.sh
This tool support following building mode(s):
--------------------------------------------------------------------------------
1. Build all, uboot and kernel and pack to download images.
2. Build uboot only.
3. Build kernel only.
4. kernel configure.
5. Pack the builds to target download image, this step must execute after u-boot,
kernel and rootfs build out
6. Update local build to SD with BPI Image flashed
7. Clean all build.
--------------------------------------------------------------------------------
Please choose a mode(1-7):
You can see that there is 7 Compile options , compile u-boot Input 2 that will do , Or directly execute the following command to compile u-boot:
./build.sh 2
It will be compiled in BPI-M5-bsp/u-boot-aml/sd_fuse Directory generation u-boot.bin, Prepare a SD card , Execution of the following command will u-boot Burn writing SD card :
sudo dd if=u-boot.bin of=/dev/mmcblk0 conv=fsync,notrunc bs=512 seek=1
sync
Connect the serial port ,SD Insert the card into the development board , Power up the development board , You can see that the serial port has the startup information printed :
As soon as the power is on, press the Enter key continuously to enter uboot Command mode , Can output help Command view supported commands :
thus u-boot Compilation and burning are finished , The process is quite simple .
边栏推荐
- Daily three questions 7.19
- Solve ''_ Xsrf 'argument missing from post
- "Introduction to interface testing" punch in to learn day07: websocket interface: how to test a completely unfamiliar protocol interface?
- Conceptual distinction between Po, Bo, VO, dto and POJO
- TS uses a third-party library, and there is no type declaration file error handling
- JS interview question - what is the difference between Es5 and ES6?
- Ten year structure and five-year Life-03 trouble as a technical team leader
- Pypi counts the number of Downloads
- Work arrangement of generator set
- Vite dynamically loads static resource pictures, and fixes the 404 problem of pictures after packaging.
猜你喜欢

Redux best practices "Redux toolkit"

Mark down learning

JS foundation -- math

Mid year summary and personal feelings

TS uses a third-party library, and there is no type declaration file error handling

Is it necessary to increase the number of milliseconds and save several KB of memory in the program?

Vulntarget vulnerability shooting range -vulntarget-b

Case analysis of building exhibition service management system with low code development platform

Tensorflow's study notes (I)

Sequence diagram of UML diagram series
随机推荐
The latest interview questions and analysis of software testing in 2022
Interview question -- event cycle
List title of force buckle summary
English grammar_ Reflexive pronoun
StrError and PERROR
Several dpdk control frameworks
Clothing ERP | ten advantages of clothing ERP for enterprises
Routing policy interferes with routing
Learning record Xi
【C】 Advanced knowledge of file operation
JS foundation -- data
Sword finger offer 11. rotate the minimum number of the array
[pyGame practice] nostalgic classic - do you remember the name of this chess game for children? (must collect)
Download the jar package of jsqlparser and PageHelper
Read and upgrade st-link chip information and SWD burning media through STM32 stlink utility tool
JS foundation -- regular expression
C: wechat chat software instance (wpf+websocket+webapi+entityframework)
Flink's study notes
Permanently mount the image steps
How to use blender to make 360 degree panorama and panoramic video?