BPI-M3 BSP Cross Compile teach
thank 陳鈞 share it.we just transfer to english.
use system message:
1
[email protected]:~$ uname -a
2
Linux jim-Ubuntu 4.2.0-34-generic #39-Ubuntu SMP Thu Mar 10 22:13:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Copied!
1 Compile BPI-M3 BSP
create a dir for BPI-M3 and get source code from gitgub
1
mkdir bananapi
2
cd bananapi
3
git clone https://github.com/BPI-SINOVOIP/BPI-M3-bsp.git
Copied!
1
cd BPI-M3-bsp
2
mkdir -p linux-sunxi/output/lib/firmware
Copied!
2, run this segment if you use 64 bits platform
the official kit was compiled on 32 bit platform ,so you must support 32bit execution in your 64 bits ubuntu.
1
sudo dpkg --add-architecture i386
2
sudo apt-get update
3
sudo apt-get upgrade
4
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386
Copied!
3,install necessary tools:(skip this if you have executed the two instructions in the segment of the 64 bits)
1
sudo apt-get update
2
sudo apt-get upgrade
3
sudo apt-get install build-essential u-boot-tools binutils-arm-linux-gnueabihf gcc-4.7-arm-linux-gnueabihf-base g++-4.7-arm-linux-gnueabihf gcc-arm-linux-gnueabihf gcc-arm-linux-gnueabi cpp-arm-linux-gnueabihf libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot kernel-package zlib1g-dev libncurses5-dev
Copied!
4,begin to Compile
for me, i need use LCD on BPI-M3, so i choose is:3
1
./build.sh
Copied!
now choose menu:
1
BPI-M3 BSP Build Tool
2
==========================================
3
4
This tool support following BPI board(s):
5
------------------------------------------
6
1. BPI_M3_720P
7
2. BPI_M3_1080P
8
3. BPI_M3_LCD7
9
4. BPI_M3_USB_720P
10
5. BPI_M3_USB_1080P
11
6. BPI_M3_USB_LCD7
12
------------------------------------------
13
Please choose a target(1-6): 3
14
15
16
Now configuring...
17
18
BPI_M3_LCD7 configured. Now run `make`
19
20
Configure success!
Copied!
please waitting , it need long time to compile,it takes a while and depends on the performance of your computer
Could not load image
Note: if compile success ,will have ../bananapi/BPI-M3-BSP dir.if it does not show up, any other "build success" screen are deceptive.
5 burn image to SD card:
take a new SD card , and install official image to SD card.
the next step, be sure to choose the correct device.
1
sudo fdisk -l
Copied!
1
umount /dev/sdf*
Copied!
clean
1
sudo fdisk /dev/sdf
2
p
3
d
4
w
5
sync
Copied!
please use "d" clean partition.And then dropped the device completely clear
dd if=/dev/zero of=/dev/sdf bs=4M
buru official image to SD card .please do not Android and Berryboot image.
example: ArchLinux
image name: 015-12-09-ArchLinuxARM-lite-bpi-m3-sd-emmc.img.zip
1
unzip 2015-12-09-ArchLinuxARM-lite-bpi-m3-sd-emmc.img.zip -d ~
2
cd ~
3
sudo dd if=2015-12-09-ArchLinuxARM-lite-bpi-m3-sd-emmc.img of=/dev/sdf bs=4M
Copied!
waiting still dd finish.
1
umount /dev/sdf*
Copied!
check partition
1
sudo fsck /dev/sdf1
2
sudo fsck /dev/sdf2
Copied!
change /dev/sdf2 to ext2,and change size
1
sudo tune2fs -O ^has_journal /dev/sdf2
2
sudo e2fsck -f /dev/sdf2
Copied!
Write the first compiled data: next step will clean partition table, so we must transcribe it at first
go to we just compiled things stored folder
1
cd ~/bananapi/BPI-M3-bsp/download/BPI_M3_LCD7
Copied!
all file will such as this below:
Empty memory card 1m before space (and clears the partition table)
1
sudo dd if=/dev/zero of=/dev/sdf bs=1M count=1
Copied!
in order to write compiled file
1
sudo dd if=boot0_sdcard.fex of=/dev/sdf bs=1k seek=8
2
sudo dd if=u-boot.fex of=/dev/sdf bs=1k seek=19096
3
sudo dd if=sunxi_mbr.fex of=/dev/sdf bs=1k seek=20480
4
sudo dd if=boot-resource.fex of=/dev/sdf bs=1k seek=36864
5
sudo dd if=env.fex of=/dev/sdf bs=1k seek=69632
6
sudo dd if=boot.fex of=/dev/sdf bs=1k seek=86016
Copied!
recovery partition table,and increase the capacity to the memory card is the largest,also change to /dev/sdf2.
1
sudo fdisk /dev/sdf
2
p
3
n
4
p
5
1
6
204800
7
729087
8
t
9
c
10
n
11
p
12
2
13
729088
14
# here just "enter",default will get max size
15
w
16
sync
17
sudo fsck /dev/sdf1
18
sudo fsck /dev/sdf2
19
sudo resize2fs /dev/sdf2
20
sudo tune2fs -j /dev/sdf2
21
sudo e2fsck -f /dev/sdf2
Copied!
all is finish. just use this SD card to boot your banana pi.
Last modified 1yr ago
Copy link