The BPI-M4 Berry development board stands as a powerful Single Board Computer (SBC), harnessing the capabilities of the Allwinner H618 System-on-Chip (SoC) to provide developers with impressive performance and a wealth of features. Similar to the Raspberry Pi 4b, the BPI-M4 Berry boasts comparable CPU prowess, LPDDR4 memory support, integrated WiFi and Bluetooth functionalities, and a familiar 40-pin header layout, alongside 4 USB interfaces and a GbE RJ45 port.
Characterized by its robust performance, versatile features, and remarkable image processing capabilities, stands as an exemplary SBC development platform for professionals within the embedded and computing industries. Equipped with 8GB eMMC flash storage, high-performance decoding and encoding capabilities, and an array of interface options, it caters to a wide spectrum of application domains, including media processing, IoT, and entertainment. Whether catering to novices or seasoned developers, the BPI-M4 Berry development board offers an ideal toolset for realizing creative visions and project objectives.
More Infomation: Banana Pi BPI-M4 Berry Main Page |
Allwinner H618, Quad-core ARM Cortex™-A53 processor
ARM Mali G31 GPU
WIFI & Bluetooth
2G LPDDR4 RAM
8G eMMC flash memory
1x USB2.0 Type-C OTG, 5V power supply
4x USB2.0 Type-A
1x HDMI 2.0a
1x 3.5mm Audio & TVE jack socket
1x GbE Ethernet port
Download latest Android image.
Download and Install Allwinner Image Download Tools, PhoenixSuit is for window.
Type-C cable, 5V power supply.
Open PhoenixSuit, click the Firmware icon to switching to firmware download panel, then click Image button and choose the Android Image file.
Press and hold the "FEL" button on M4 Berry while connecting to the computer using type-c, popup a warning dialog.Press Yes.
Download
Download finish
Linux image support SDcard or eMMC bootup, and will boot from the SD card first.
It’s recommended to use A1 rated cards, 8GB at least.
Make sure bootable eMMC is formatted if you want bootup from SDcard.
Make sure SDcard is formatted without Linux image flashed if you want bootup from eMMC and use Sdcard as storage.
Download latest Linux Image, and confirm that the md5 checksum is correct.
Default login: pi/bananapi or root/1234
The wiki guide is only for ubuntu/debian images.
We have prepared 2 methods to help you burn the image, just choose one of them.
Install Image with Balena Etcher, suport Windows, Linux and MacOS.
Balena Etcher an opensource GUI flash tool by Balena, Flash OS images to SDcard or USB drive.
If you are installing it in a Linux desktop operating system, such as Ubuntu, you may need to give AppImage file permission to run first. If you are installing it using Windows, skip this step.
Right-click the AppImage file and click Properties
.
Select Permissions
, then enable Allow executing file as program
, and finally close this bar.
Run Balena Etcher, click on Flash from file
to select image.
Click on Select target
to select USB device.
Click on Flash!
Start burning.
Install Image with Balena Cli, suport Windows, Linux and MacOS.
Balena CLI is a Command Line Interface for balenaCloud or openBalena. It can be used to flash linux image.
Download the installer or standalone package from Balena CLI releases.
Install it correctly to your PC.
Use util available-drives command option of balena to list available drives which are usable for writing an OS image to.
balena util available-drives
Then you can use the local flash command option of balena to flash a linux image to sdcard or usb drive.
Note that you need to change the path of the image file to the correct path you need. And modify the device to the device you want to burn. |
On Windows, just do it.
balena local flash path/to/xxx-bpi-m4-berry-xxx.img.zip --drive \\.\PhysicalDrive2
On Linux, you may need to use the sudo
command to gain root privileges to execute.
sudo balena local flash path/to/xxx-bpi-m4-berry-xxx.img.zip --drive /dev/disk2
The logs in Windows are as follows:
PS D:\temp\Bpi-m4berry_0.0.1_beta_ubuntu_jammy_desktop_xfce_linux6.1.31> balena util available-drives
DEVICE SIZE DESCRIPTION
\\.\PhysicalDrive2 7.9 GB SDHC Card
PS D:\temp\Bpi-m4berry_0.0.1_beta_ubuntu_jammy_desktop_xfce_linux6.1.31> balena local flash .\Bpi-m4berry_0.0.1_beta_ubuntu_jammy_desktop_xfce_linux6.1.31.img --drive \\.\PhysicalDrive2
? This will erase the selected drive. Are you sure? Yes
Flashing [========================] 100% eta 0s
Validating [========================] 100% eta 0s
Make sure that the Linux image has been burned into an SD card and started normally.
Enter the following command in the terminal.
sudo armbian-config
(For those who use the minimal version of the image, please take a look here first.)
Follow the instructions below to install the Linux system image on the eMMC.
Select Ststem
.
Select Install
.
Select Boot from eMMC
.
Select Yes
.
Select ext4
.
Wait a few minutes. Do not power off or restart the board at this time.
The last step is to shut down the board. At this time, disconnect the power supply, remove the SD card, and connect the power again, to boot from eMMC.
Make sure the Linux image has been burned into an SD card and insert the SD card. By default it will boot from the SD card.
Enter the command lsblk
in the terminal to list the block device information in the system, such as hard disks, partitions, disks, etc.
pi@bpi-m4berry:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 7.4G 0 disk
└─mmcblk0p1 179:1 0 7.2G 0 part /var/log.hdd
/
mmcblk1 179:32 0 7.3G 0 disk
└─mmcblk1p1 179:33 0 7.3G 0 part
mmcblk1boot0 179:64 0 4M 1 disk
mmcblk1boot1 179:96 0 4M 1 disk
zram0 252:0 0 993.2M 0 disk [SWAP]
zram1 252:1 0 50M 0 disk /var/log
zram2 252:2 0 0B 0 disk
mmcblk0 is the SD card and mmcblk1 is the eMMC. Enter the following command in the terminal to erase the eMMC. This process takes several minutes and is irreversible. Be careful to back up important data.
sudo dd if=/dev/zero of=/dev/mmcblk1
Using the Ubuntu&Debian desktop version system image, you can get a graphical operation interface.
You need to prepare a monitor with an HDMI interface and an HDMI cable.
Use an HDMI cable to connect the monitor and BPI-M4 Berry, switch the monitor input interface to the corresponding HDMI interface, power on, and wait a moment to see the desktop.
Linux Desktop
Prepare a 3.3v USB to TTL module.
Use the USB to TTL module to connect the PC USB port and the Debug UART port on the board.
Open a serial terminal software on the PC, such as mobaxterm or putty.
Taking mobaxterm as an example, after setting the serial port number and 115200 baud rate, you can open the BPI-M4 Berry UART terminal.
Prepare a network cable and a router.
Use a network cable to connect the LAN port of the router to the BPI-M4 Berry, and also connect the PC to another LAN port.
Check the IP address of BPI-M4 Berry on the router management interface, or use the following command on the BPI-M4 Berry UART terminal to check the IP address.
ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.10 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::3e1f:688f:81ab:d8b7 prefixlen 64 scopeid 0x20<link>
ether 02:00:54:a0:d6:a6 txqueuelen 1000 (Ethernet)
RX packets 553 bytes 92549 (92.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 329 bytes 26023 (26.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 42
Open an SSH terminal software on the PC, such as mobaxterm or putty.
Taking mobaxterm as an example, fill in the obtained IP address, such as 192.168.3.10
above, in the IP address column and 22 in the Port port.
Open the SSH terminal and enter the login username/password: pi/bananapi
or root/1234
(Unless you changed your password
). There will be no prompt when entering the password. Please enter it normally and press Enter when finished.
Make sure BPI-M4 Berry is connected to the Internet and use the following command to download the nomachine DEB installation package in the system.
wget https://download.nomachine.com/download/8.9/Arm/nomachine_8.13.1_1_arm64.deb
Or open NoMachine for ARM - arm64 download page in a PC browser, download the DEB installation package, and then copy it to BPI-M4 Berry user directory through SSH or USB disk.
After the download is completed, install it through the following command. Note that the file name is based on the actual downloaded file name.
sudo dpkg -i nomachine_8.13.1_1_arm64.deb
PC side also needs to download and install NoMachine. NoMachine download page Select the installation package suitable for the PC operating system, download it locally and complete the installation.
Pay attention to keeping the PC and BPI-M4 Berry in the same LAN. You can try SSH connection first to ensure normal communication within the LAN.
Open NoMachine on the PC, click the Add button, enter the IP address of BPI-M4 Berry in the Host bar in the window after the jump, and then click the Add button.
Click the recognized port icon, enter the username/password in the new window that pops up, and then click the OK button.
After completing the subsequent settings, you can see the desktop.
TIP: If no device is connected to the HDMI interface, the NoMachine remote desktop will display a black screen. It is recommended to keep the HDMI connection or connect an HDMI decoy device. |
From now on, you can use commands directly to enter armbian configure without installing it.
sudo armbian-config
Use the nmcli command to scan WiFi hotspots, connect to hotspots, and create AP hotspots.
nmcli device #List devices
nmcli device wifi list # List available wifi access points, list can be omitted
nmcli device wifi connect [SSID] password [PASSWORD] # Connect to the hotspot mySSID.
#After the connection is successful, the configuration file will be automatically generated.
#If you want to connect again in the future, you can use the nmcli connection up [SSID] command.
nmcli device disconnect [device name] # Disconnect wifi, use the wifi device name displayed in the nmcli device command
nmcli device wifi hotspot con-name [NAME] ifname [device name] ssid [SSID] password [PASSWORD] # Create AP hotspot
nmcli connection show #List network connection configuration
nmcli connection down [NAME] # Deactivate a connection
nmcli connection up [NAME] # Activate a connection
nmcli connection delete [SSID] #Delete a configuration and no longer save information and automatically connect
nmcli radio wifi off # Turn off wifi
nmcli radio wifi on # Turn on wifi
To set a static IP, you need to maintain the connection first. If you want to set an Ethernet static IP, you must first maintain the Ethernet connection; if you want to set a wireless network static IP, you must first maintain a connection to a WIFI.
If the upper-level router has assigned the IP address you want to set to other devices, please change it to an idle IP, or ask other devices to give up the IP.
Use the nmcli connection show command to display all connections, for example:
pi@bpi-m4berry:~$ nmcli connection show
NAME UUID TYPE DEVICE
TP-LINK_5G_7747 e4a49726-adf1-44d7-a621-0e3af96cc390 wifi wlx2cc3e6acd5d7
Wired connection 1 612eda94-55dc-3c85-b05e-f16c41775b4e ethernet --
Use the nmcli connection show [NAME] command to display all the properties of a specific connection, such as:
nmcli connection show TP-LINK_5G_7747 #If you want to see Ethernet, change to Wired connection 1
#Only list three common items
ipv4.dns: 192.168.3.1 #The default is the gateway address
ipv4.addresses: 192.168.3.10/24 #The default is the IP address assigned by the router DHCP
ipv4.gateway: 192.168.3.1 #Gateway address, the default is the IP address of the router
Set static IP:
nmcli connection modify TP-LINK_5G_7747 ipv4.addresses 192.168.3.2
Set DNS:
nmcli connection modify TP-LINK_5G_7747 ipv4.dns 8.8.8.8 #Google DNS
Reset:
reboot
After restarting, check whether the modification is successful:
ifconfig
nmcli connection show TP-LINK_5G_7747
Chrony is an open source free Network Time Protocol NTP client and server software. It allows the computer to keep the system clock synchronized with the clock server (NTP), thus allowing your computer to maintain accurate time. Chrony can also be used as a server software to provide time synchronization services for other computers.
timedatectl set-ntp false #Disable NTP-based network time synchronization
sudo apt install chrony #Install chrony
systemctl start chrony #Start chrony
systemctl enable chrony
systemctl status chrony
systemctl restart chrony #Restart service
timedatectl status #View time synchronization status
timedatectl list-timezones #View time zone list
timedatectl set-timezone Asia/Shanghai #Modify time zone
timedatectl set-ntp true #Enable NTP network time synchronization
date #View time
sudo hwclock -r #View hardware clock
You can use the following four commands to find out what hardware the corresponding sensor is checking.
cat /sys/class/thermal/thermal_zone0/type
cat /sys/class/thermal/thermal_zone1/type
cat /sys/class/thermal/thermal_zone2/type
cat /sys/class/thermal/thermal_zone3/type
Then use the following command to check the temperature separately.
cat /sys/class/thermal/thermal_zone0/temp
cat /sys/class/thermal/thermal_zone1/temp
cat /sys/class/thermal/thermal_zone2/temp
cat /sys/class/thermal/thermal_zone3/temp
The value of the queried temperature needs to be divided by 1000, and the unit is Celsius.
For example, divide the cpu temperature by 1000 to obtain 54.17 degrees Celsius.
Prepare a USB disk that has been partitioned normally and insert it into the USB interface of BPI-M4 Berry.
In the Ubuntu desktop version, you can see that the USB disk has been recognized and can be opened in the file manager, or partition management can be performed through the GParted tool.
In the terminal, mount the USB disk to the local directory:
mkdir mnt #Create a separate directory in the ~/user directory for mounting for easy management
cat /proc/partitions | grep "sd*" #List partitions starting with sd
sudo mount /dev/sda1 ~/mnt/ #Mount /dev/sda1 to ~/mnt/
ls ~/mnt/ #After mounting, you can list the files in the USB disk
sudo umount -v /dev/sda1 #umount, then you can remove the USB disk
Prepare an audio file and copy it to the BPI-M4 Berry Ubuntu desktop system through a USB flash drive or SSH.
Prepare a monitor with HDMI audio input function, turn on the relevant functions in the monitor settings, and use an HDMI cable to connect the monitor.
Set the output device to HDMI Audio in the Sound column of the settings.
Play audio.
Prepare a headset or other audio device that uses a 3.5mm plug, insert the plug into the 3.5mm jack of BPI-M4 Berry.
Set the output device to Audio Codec in the Sound column of the settings.
Play audio.
You can query the audio device of your BPI-M4 Berry.
aplay -l #List devices
**** List of PLAYBACK Hardware Devices ****
card 0: audiocodec [audiocodec], device 0: soc@3000000:codec_plat-5096000.codec 5096000.codec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: ahubhdmi [ahubhdmi], device 0: ahub_plat-snd-soc-dummy-dai snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
The following commands are used to play on the corresponding device. ==== Play through the 3.5mm audio jack
aplay -D hw:0,0 [path] #Play the audio file of the specified path
aplay -D hw:1,0 [path] #Play the audio file of the specified path
Open settings in the Ubuntu desktop and connect a Bluetooth device, such as a Bluetooth mouse or keyboard, in the Bluetooth bar.
The method to connect the Bluetooth device through the command line in the terminal is as follows:
pi@bpi-m4berry:~$ sudo bluetoothctl #Open the Bluetooth device management tool
[sudo] password for pi:
Agent registered
[CHG] Controller 2C:C3:E6:AC:D5:D8 Pairable: yes
[bluetooth]# power on #Start the Bluetooth function, power off to turn it off
Changing power on succeeded
[bluetooth]# discoverable on #Allow this device to be discovered
Changing discoverable on succeeded
[CHG] Controller 2C:C3:E6:AC:D5:D8 Discoverable: yes
[bluetooth]# pairable on #Allow device pairing
Changing pairable on succeeded
[bluetooth]# scan on #Start scanning
Discovery started
[CHG] Controller 2C:C3:E6:AC:D5:D8 Discovering: yes
[NEW] Device D4:C4:85:A5:C6:B1 Logitech Pebble #The MAC address and device name of a Bluetooth mouse
[CHG] Device D4:C4:85:A5:C6:B1 TxPower: 4
[bluetooth]# pair D4:C4:85:A5:C6:B1 #Pair the MAC address of the Bluetooth device you want to connect to
Attempting to pair with D4:C4:85:A5:C6:B1
[CHG] Device D4:C4:85:A5:C6:B1 Connected: yes
[DEL] Device A4:C1:38:9B:F6:FD SLPO20N20200059
[CHG] Device D4:C4:85:A5:C6:B1 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device D4:C4:85:A5:C6:B1 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device D4:C4:85:A5:C6:B1 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device D4:C4:85:A5:C6:B1 UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device D4:C4:85:A5:C6:B1 UUIDs: 00001812-0000-1000-8000-00805f9b34fb
[CHG] Device D4:C4:85:A5:C6:B1 UUIDs: 00010000-0000-1000-8000-011f2000046d
[CHG] Device D4:C4:85:A5:C6:B1 ServicesResolved: yes
[CHG] Device D4:C4:85:A5:C6:B1 Paired: yes
Pairing successful #pairing successfully
[CHG] Device D4:C4:85:A5:C6:B1 Modalias: usb:v046DpB021d0007
[bluetooth]# exit #Exit the Bluetooth device management tool
pi@bpi-m4berry:~$
You need to prepare an infrared remote control using NEC format.
Enter the following command in the terminal to start receiving infrared signals.
sudo ir-keytable -c -p NEC -t
Old keytable cleared
Protocols changed to nec
Testing events. Please, press CTRL-C to abort.
258.553895: lirc protocol(nec): scancode = 0x45
258.553926: event type EV_MSC(0x04): scancode = 0x45
258.553926: event type EV_SYN(0x00).
260.667648: lirc protocol(nec): scancode = 0x46
260.667671: event type EV_MSC(0x04): scancode = 0x46
260.667671: event type EV_SYN(0x00).
260.719552: lirc protocol(nec): scancode = 0x46 repeat
260.719568: event type EV_MSC(0x04): scancode = 0x46
260.719568: event type EV_SYN(0x00).
273.263728: lirc protocol(nec): scancode = 0x47
273.263753: event type EV_MSC(0x04): scancode = 0x47
273.263753: event type EV_SYN(0x00).
273.315591: lirc protocol(nec): scancode = 0x47 repeat
273.315608: event type EV_MSC(0x04): scancode = 0x47
273.315608: event type EV_SYN(0x00).
For other commands and specific application methods, please see ir-keytable reference document.
scp (secure copy) command in Linux system is used to copy file(s) between servers in a secure way.
The SCP command or secure copy allows the secure transferring of files between the local host and the remote host or between two remote hosts.
It uses the same authentication and security as it is used in the Secure Shell (SSH) protocol.
You can copy files from a Windows terminal to a Linux system on the same LAN. Just make sure the Open SSH client is turned on and can be viewed in Settings > Applications > Optional Features.
If you want to copy files from Windows systems to Linux systems, you also need to enable the Open SSH server.
The scp command format is:
scp [optionals] file_source file_target
optionals
is an optional parameter, such as -r, which can be used to copy the entire directory recursively.
file_source The file or directory to be copied.
file_target will copy the past path and rename it if a specific file name is entered at the end.
Take copying local files from a Windows system to a Linux system as an example. In the Windows terminal, enter:
PS D:\temp\temp_4> scp ".\hello.txt" [email protected]:"/home/pi/Downloads/"
You can also copy files in the Linux system to the local computer in the Windows terminal:
PS D:\temp\temp_4> scp [email protected]:"/home/pi/Downloads/hello.txt" "D:\temp\temp_4"
Where [email protected] is the user name in the Linux system and the IP address of the BPI-M4 Berry in the LAN.
Where :"/home/pi/Downloads/hello.txt"
is the file path in the Linux system.
Where "D:\temp\temp_4"
is the path in Windows system.
Files can be managed through a graphical interface using mobaxterm or other similar software.
As shown in the figure below, after establishing an SSH connection in mobaxterm, a file management window will appear on the left side of the interface, which supports copying and pasting by dragging and dropping files.
GNU nano is a text editor for Unix-like computing systems or operating environments using a command line interface.
It is easier to use than vim and is suitable for beginners.
Usually you can complete editing, save, and exit the editor in this order:
nano [file path]
edit file
Ctrl+O Offer to write file ("Save as")
edit file path or name, then press Enter
Ctrl+X Exit nano
sudo nano "/boot/armbianEnv.txt"
,rewrite bootlogo=true
as bootlogo=false
.
Press keyboard shortcuts Ctrl+O to write file.
No need to change path, Press Enter to save it.
Press keyboard shortcuts Ctrl+X exit nano.
reboot
, the startup logo would not display.
sudo nano "/boot/armbianEnv.txt"
,rewrite bootlogo=false
as bootlogo=true
.
The storage path of the boot logo file is: /usr/share/plymouth/themes/armbian/watermark.png
.
Prepare a png
image, preferably a pattern with a transparent layer, and rename it to watermark.png
.
Copy it to the /home/pi/watermark.png
path using any method you like.
Copy it to the target path with root privileges.
sudo cp "/home/pi/watermark.png" "/usr/share/plymouth/themes/armbian/watermark.png"
Use this command to apply the changes and wait for tens of seconds for it to complete the build.
sudo update-initramfs -u
reboot
, you will see that boot logo has changed to the image you replaced.
Control the GPIO port to light up the LED light.
Set the high and low levels of GPIO
The following is a demonstration using 7 pin.
Insert the LED light and you can see that it is not lit up.
Execute
gpio mode 2 out
to set it to output mode.
Execute
gpio write 2 1
You can see that the LED light has been turned on.
Execute
gpio write 2 0
You can see that the LED light has been turned off.
Set pull-up and pull-down resistors
Firstly, it is necessary to set the GPIO port to input mode
gpio mode 2 in
Then set the GPIO port as an pull-up resistor
gpio mode 2 up
The LED light is lit up again
Finally, set the GPIO port to dropdown mode
gpio mode 2 down
The LED light goes out again
Bananapi M4 Berry Tested HDMI | |
---|---|
Panel |
Test Video |