Difference between revisions of "Getting Started with M4"

From Banana Pi Wiki
Jump to: navigation, search
(BPI-M4)
(Install Android)
 
(29 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[zh:快速上手 香蕉派 BPI-M4]]
 
[[zh:快速上手 香蕉派 BPI-M4]]
 +
 
=Introduction=
 
=Introduction=
 
==BPI-M4==
 
==BPI-M4==
[[File:M4_respbian.png|thumb|Overview: BPI-M4 respbian linux]]
+
[[File:Banana_Pi_BPI-M4_1.jpg|thumb|Overview [[Banana Pi BPI-M4]]]]
 +
[[File:Banana_Pi_BPI-M4_2.jpg|thumb|Overview:Realtek RTD1395]]
  
 
   Banana Pi BPI-M4 use [https://drive.google.com/file/d/1Jt8qUwEjLinMqURMftC3db0Xg9MIWIhu/view?usp=sharing Realtek RTD1395] chp design ,it is a 64-bit quad-core A53 mini single board computer. It features 1 GB of RAM and 8 GB eMMC. It also has onboard WiFi for b/g/n/ac and BT 4.2. On the ports side, the BPI-M4 has 4 USB 2.0 ports, 1 USB TYPE C port, 1 HDMI port, 1 audio jack. support M.2 Key E PCIE 2.0 interface.  
 
   Banana Pi BPI-M4 use [https://drive.google.com/file/d/1Jt8qUwEjLinMqURMftC3db0Xg9MIWIhu/view?usp=sharing Realtek RTD1395] chp design ,it is a 64-bit quad-core A53 mini single board computer. It features 1 GB of RAM and 8 GB eMMC. It also has onboard WiFi for b/g/n/ac and BT 4.2. On the ports side, the BPI-M4 has 4 USB 2.0 ports, 1 USB TYPE C port, 1 HDMI port, 1 audio jack. support M.2 Key E PCIE 2.0 interface.  
Line 17: Line 19:
 
*M.2 Key E slot PCIE 2.0 and USB 2.0
 
*M.2 Key E slot PCIE 2.0 and USB 2.0
 
*PoE function support
 
*PoE function support
 +
 +
=Development For Android=
 +
==Basic Development==
 +
===Install Android===
 +
 +
1.Install bootcode (in bpi-m4_bootcode&bootloader_20190625.zip)
 +
 +
1.1 Connect BPI-M4 and PC with debug console, Switch BPI-M4 SW2 to 1, open "hypertrm.exe" on PC.
 +
 +
[[Image:M4_install_pic1.jpg]]
 +
 +
1.2 Set Baud rate: 115200, data bit: 8 bit, stop bit: 1 bit, Parity: NONE, Flow control: NONE
 +
 +
[[Image:M4_install_pic2.jpg]]
 +
 +
1.3 Press and hold "Ctrl+q" on PC, in the meantime power on or reset BPI-M4, hypertrm will print "/d/g/r"
 +
 +
[[Image:M4_install_pic3.jpg]]
 +
 +
1.4 Press “h” button on PC,choose Transfer->Send File in the menu, then choose file ”
 +
bootcode/android_2133/hwsetting.bin”(or RTD1395_hwsetting_BOOT_2DDR4_
 +
8Gb_s2133.bin) , protocol choose “Ymodem-G”.
 +
 +
[[Image:M4_install_pic4.jpg]]
 +
 +
[[Image:M4_install_pic5.jpg]]
 +
 +
1.5 After send file, if transfer successfully, you will see the following picture:
 +
 +
[[Image:M4_install_pic6.jpg]]
 +
 +
1.6 Press “d” button on PC,choose Transfer->Send File in the menu, then choose file ”
 +
bootcode/android_2133/recovery.bin(or Recovery-bananapi-0001-RTD1395
 +
_hwsetting_BOOT_2DDR4_8Gb_s2133.bin) , choose “Ymodem-G”.
 +
 +
[[Image:M4_install_pic7.jpg]]
 +
 +
1.7 After transfer these two files, press “g” to execute it.
 +
 +
[[Image:M4_install_pic8.jpg]]
 +
 +
2.Install bootloader (in bpi-m4_bootcode&bootloader_20190625.zip)
 +
 +
2.1 Press and hold “Esc” button on PC, power on BPI-M4 to enter boot command line.
 +
 +
[[Image:M4_install_pic9.jpg]]
 +
 +
2.2 Input “Realtek> usb start” to recognise udisk
 +
 +
2.3 Input “Realtek> fatload usb 0:1 0x01500000 bootloader.bin ” to load bootloader from udisk
 +
 +
2.4 Input “Realtek> chain 0x01500000 ” to install bootloader
 +
 +
[[Image:M4_install_pic10.jpg]]
 +
 +
3.Install Android Image (In bpi-m4_Android_8_1_system.zip)
 +
 +
3.1 Unzip bpi-m4_Android_8_1_system.zip, then copy these files in to udisk, then plug udisk on Bpi-M4
 +
 +
[[Image:M4_install_pic11.jpg]]
 +
 +
3.2 Reset Bpi-M4,enter to boot command line
 +
 +
3.3 Input “Realtek> usb start” to recognise udisk
 +
 +
3.4 Input “Realtek> fatload usb 0:1 0x02100000 rescue.emmc.dtb ” to load rescue.emmc.dtb from udisk
 +
 +
3.4 Input “Realtek> fatload usb 0:1 0x03000000 emmc.uImage ” to load emmc.uImage from udisk
 +
 +
3.5 Input “Realtek> fatload usb 0:1 0x02200000 rescue.root.emmc.cpio.gz_pad.img” to load rescue.root.emmc.cpio.gz_pad.img from udisk
 +
 +
3.6 Input “Realtek>fatload usb 0:1 0x0f900000 bluecore.audio.enc.A01” to load bluecore.audio.enc.A01  from udisk
 +
 +
3.7 Input “Realtek> boot k”, you will wait for around 5-10 mins, please do not operate during the debug console print log, it will reboot after this.
 +
 +
[[Image:M4_install_pic12.jpg]]
 +
 +
=Development For Linux=
 +
==Basic Development==
 +
==Advanced Development==
 +
===Installed Docker===
 +
To have a test, if docker has installed in your image.
 +
 +
* sudo docker run --rm hello-world
 +
===EMAC===
 +
Use iperf3 to test gmac
 +
 +
1. On PC Terminal:
 +
* Execute "iperf3 -s"
 +
 +
2. On M3 console:
 +
* TCP test: "iperf3 -c serverIP"
 +
* UDP test: "iperf3 -u -c serverIP"
 +
[[Image:M4_Emac_test.jpg]]
 +
 +
===Bluetooth===
 +
'''You have two ways to setup BT'''
 +
 +
1. Use commands to setup BT
 +
* Use bluetoothctl tool to operate BT
 +
* Execute "bluetoothctl"
 +
* If you don't know how to use bluetoothctl, type "help", you will see more commands
 +
* Execute these commands:
 +
 +
[[Image:M4_bluetooth.jpg]]
 +
 +
2. Use UI interface to setup BT
 +
 +
===WiFi on M4===
 +
====WiFi Client====
 +
'''You have two ways to setup WiFi Client'''
 +
 +
1. Use commands to setup WiFi client
 +
* ip link set wlan0 up
 +
* iw dev wlan0 scan | grep SSID
 +
* vim /etc/wpa_supplicant/wpa_supplicant.conf
 +
  network={   
 +
  ssid="ssid"   
 +
  psk="password"   
 +
  priority=1
 +
  }
 +
* wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
 +
* dhclient wlan0
 +
 +
2. Use UI interface to setup WiFi Client
 +
 +
[[Image:M4_WiFi_iperf3.jpg]]

Latest revision as of 23:52, 1 December 2019


Introduction

BPI-M4

Overview:Realtek RTD1395
 Banana Pi BPI-M4 use Realtek RTD1395 chp design ,it is a 64-bit quad-core A53 mini single board computer. It features 1 GB of RAM and 8 GB eMMC. It also has onboard WiFi for b/g/n/ac and BT 4.2. On the ports side, the BPI-M4 has 4 USB 2.0 ports, 1 USB TYPE C port, 1 HDMI port, 1 audio jack. support M.2 Key E PCIE 2.0 interface. 

Key Features

  • Realtek RTD1395 ARM Cortex-A53 Quad-Core 64 Bit
  • Mali 470 MP4 GPU OpenGL ES 1.1/2.0 H.264 H.265,2K4K
  • Onboard1 GB DDR4 (option 2 GB)
  • 8G eMMC flash (max 64 GB)
  • 10/100 Mbit/s Ethernet and RTL8821 module support Wi-Fi 802.11 b/g/n/AC + Bluetooth 4.2
  • USB 2.0 TYPE C
  • M.2 Key E slot PCIE 2.0 and USB 2.0
  • PoE function support

Development For Android

Basic Development

Install Android

1.Install bootcode (in bpi-m4_bootcode&bootloader_20190625.zip)

1.1 Connect BPI-M4 and PC with debug console, Switch BPI-M4 SW2 to 1, open "hypertrm.exe" on PC.

M4 install pic1.jpg

1.2 Set Baud rate: 115200, data bit: 8 bit, stop bit: 1 bit, Parity: NONE, Flow control: NONE

M4 install pic2.jpg

1.3 Press and hold "Ctrl+q" on PC, in the meantime power on or reset BPI-M4, hypertrm will print "/d/g/r"

M4 install pic3.jpg

1.4 Press “h” button on PC,choose Transfer->Send File in the menu, then choose file ” bootcode/android_2133/hwsetting.bin”(or RTD1395_hwsetting_BOOT_2DDR4_ 8Gb_s2133.bin) , protocol choose “Ymodem-G”.

M4 install pic4.jpg

M4 install pic5.jpg

1.5 After send file, if transfer successfully, you will see the following picture:

M4 install pic6.jpg

1.6 Press “d” button on PC,choose Transfer->Send File in the menu, then choose file ” bootcode/android_2133/recovery.bin(or Recovery-bananapi-0001-RTD1395 _hwsetting_BOOT_2DDR4_8Gb_s2133.bin) , choose “Ymodem-G”.

M4 install pic7.jpg

1.7 After transfer these two files, press “g” to execute it.

M4 install pic8.jpg

2.Install bootloader (in bpi-m4_bootcode&bootloader_20190625.zip)

2.1 Press and hold “Esc” button on PC, power on BPI-M4 to enter boot command line.

M4 install pic9.jpg

2.2 Input “Realtek> usb start” to recognise udisk

2.3 Input “Realtek> fatload usb 0:1 0x01500000 bootloader.bin ” to load bootloader from udisk

2.4 Input “Realtek> chain 0x01500000 ” to install bootloader

M4 install pic10.jpg

3.Install Android Image (In bpi-m4_Android_8_1_system.zip)

3.1 Unzip bpi-m4_Android_8_1_system.zip, then copy these files in to udisk, then plug udisk on Bpi-M4

M4 install pic11.jpg

3.2 Reset Bpi-M4,enter to boot command line

3.3 Input “Realtek> usb start” to recognise udisk

3.4 Input “Realtek> fatload usb 0:1 0x02100000 rescue.emmc.dtb ” to load rescue.emmc.dtb from udisk

3.4 Input “Realtek> fatload usb 0:1 0x03000000 emmc.uImage ” to load emmc.uImage from udisk

3.5 Input “Realtek> fatload usb 0:1 0x02200000 rescue.root.emmc.cpio.gz_pad.img” to load rescue.root.emmc.cpio.gz_pad.img from udisk

3.6 Input “Realtek>fatload usb 0:1 0x0f900000 bluecore.audio.enc.A01” to load bluecore.audio.enc.A01 from udisk

3.7 Input “Realtek> boot k”, you will wait for around 5-10 mins, please do not operate during the debug console print log, it will reboot after this.

M4 install pic12.jpg

Development For Linux

Basic Development

Advanced Development

Installed Docker

To have a test, if docker has installed in your image.

  • sudo docker run --rm hello-world

EMAC

Use iperf3 to test gmac

1. On PC Terminal:

  • Execute "iperf3 -s"

2. On M3 console:

  • TCP test: "iperf3 -c serverIP"
  • UDP test: "iperf3 -u -c serverIP"

M4 Emac test.jpg

Bluetooth

You have two ways to setup BT

1. Use commands to setup BT

  • Use bluetoothctl tool to operate BT
  • Execute "bluetoothctl"
  • If you don't know how to use bluetoothctl, type "help", you will see more commands
  • Execute these commands:

M4 bluetooth.jpg

2. Use UI interface to setup BT

WiFi on M4

WiFi Client

You have two ways to setup WiFi Client

1. Use commands to setup WiFi client

  • ip link set wlan0 up
  • iw dev wlan0 scan | grep SSID
  • vim /etc/wpa_supplicant/wpa_supplicant.conf
 network={    
 ssid="ssid"    
 psk="password"    
 priority=1 
 }
  • wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
  • dhclient wlan0

2. Use UI interface to setup WiFi Client

M4 WiFi iperf3.jpg