Search

Banana Pi BPI-M2 Pro

OS/Banana Pi /BPI-Bit 2021. 6. 12. 12:32 Posted by 파란크리스마스

출처

CPU

Amlogic S905X3 quad core Cortex-A55 (2.0xxGHz)

eMMC

pi@bananapi:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0          7:0    0 48.8M  1 loop /snap/core18/1936
loop1          7:8    0   27M  1 loop /snap/snapd/10494
loop2          7:16   0 15.2M  1 loop /snap/ubuntu-mate-welcome/627
loop3          7:24   0   16K  1 loop /snap/software-boutique/56
loop4          7:32   0    8K  1 loop /snap/ubuntu-mate-pi/11
loop5          7:40   0 14.9M  1 loop /snap/ubuntu-mate-welcome/578
loop6          7:48   0 27.9M  1 loop /snap/snapd/11843
loop7          7:56   0 48.9M  1 loop /snap/core18/2068
mmcblk0      179:0    0 14.6G  0 disk 
mmcblk0boot0 179:32   0    4M  0 disk 
mmcblk0boot1 179:64   0    4M  0 disk 
mmcblk0rpmb  179:96   0    4M  0 disk 
mmcblk1      179:128  0 14.9G  0 disk 
├─mmcblk1p1  179:129  0  256M  0 part /boot
└─mmcblk1p2  179:130  0  6.8G  0 part /

SM 확장

디스크 확인

pi@bananapi:~$ sudo fdisk -l | grep '^Disk'
Disk /dev/loop0: 48.85 MiB, 51200000 bytes, 100000 sectors
Disk /dev/loop1: 26.10 MiB, 28286976 bytes, 55248 sectors
Disk /dev/loop2: 15.17 MiB, 15900672 bytes, 31056 sectors
Disk /dev/loop3: 16 KiB, 16384 bytes, 32 sectors
Disk /dev/loop4: 8 KiB, 8192 bytes, 16 sectors
Disk /dev/loop5: 14.87 MiB, 15572992 bytes, 30416 sectors
Disk /dev/loop6: 27.9 MiB, 29237248 bytes, 57104 sectors
Disk /dev/loop7: 48.9 MiB, 51257344 bytes, 100112 sectors
Disk /dev/mmcblk0: 14.57 GiB, 15634268160 bytes, 30535680 sectors
Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/mmcblk1: 14.86 GiB, 15931539456 bytes, 31116288 sectors
Disklabel type: dos
Disk identifier: 0x5e283d7d

기존 파티션을 삭제하고 새로 파티션 생성

pi@bananapi:~$ sudo fdisk /dev/mmcblk1
 
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
 
Command (m for help): p
Disk /dev/mmcblk1: 14.86 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5e283d7d
 
Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1      204800   729087   524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      729088 14940159 14211072  6.8G 83 Linux
 
Command (m for help): d
Partition number (1,2, default 2): 2
 
Partition 2 has been deleted.
 
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-31116287, default 2048): 729088
Last sector, +/-sectors or +/-size{K,M,G,T,P} (729088-31116287, default 31116287): 
 
Created a new partition 2 of type 'Linux' and of size 14.5 GiB.
Partition #2 contains a ext4 signature.
 
Do you want to remove the signature? [Y]es/[N]o: Y
 
The signature will be removed by a write command.
 
Command (m for help): w
The partition table has been altered.
Syncing disks.
 
pi@bananapi:~$ sudo shutdown -r now

bpi-tool 설치

pi@bananapi:~$ sudo apt-get install pv
pi@bananapi:~$ curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
 
bpi files:
/usr/bin/bpi-tools      v1.3.1(github)
/usr/bin/bpi-bootsel    v1.3.4(github)
/usr/bin/bpi-copy       v1.3.4(github)
/usr/bin/bpi-get        v1.3.7b(github)
/usr/bin/bpi-migrate    v1.3.11(github)
/usr/bin/bpi-hw v1.3.3(github)
/usr/bin/bpi-update     v1.3.8(github)

eMMC에 OS 설치

pi@bananapi:~$ sudo bpi-copy 2021-01-21-ubuntu-20.04-mate-desktop-bpi-m5-aarch64-sd-emmc.img.zip /dev/mmcblk0
SRC=2021-01-21-ubuntu-20.04-mate-desktop-bpi-m5-aarch64-sd-emmc.img.zip
DST=/dev/mmcblk0
COPYMODE=imagetodisk
imagetodisk
bpi-copy(v1.3.4(github)), bananapi image & disk tools
 
Usage: bpi-copy [OPTIONS]...
       bpi-copy [ --help | -v | --version ]
       bpi-copy IMGFILE
       bpi-copy IMGDIR
       bpi-copy IMGFILE DEVICE
       bpi-copy DEVICE IMGFILE
 
Warning: Try to write 2021-01-21-ubuntu-20.04-mate-desktop-bpi-m5-aarch64-sd-emmc.img.zip to BOOTDISK /dev/mmcblk0
==============================================================
Sat 12 Jun 2021 06:01:17 PM IST
*** start COPY (blue led on ) .....
INFO: /dev/mmcblk0 : SD/eMMC !!
umount device: /dev/mmcblk0
==============================================================
IMGFILE=2021-01-21-ubuntu-20.04-mate-desktop-bpi-m5-aarch64-sd-emmc.img.zip
==============================================================
zip
7.12GiB 0:02:12 [55.0MiB/s] [                                                          <=>                              ]
0+113169 records in
0+113169 records out
***  end  COPY (blue led off) .....
Sat 12 Jun 2021 06:03:35 PM IST
==============================================================
RUNTIME 2:18
OK!! You can remove the BOOTDISK /dev/mmcblk0 now!!

WiringPi

pi@bananapi:~$ git clone https://github.com/BPI-SINOVOIP/amlogic-wiringPi
pi@bananapi:~$ cd amlogic-wiringPi
pi@bananapi:~/amlogic-wiringPi$ chmod a+x build
pi@bananapi:~/amlogic-wiringPi$ sudo ./build

WiringPi 핀 배열

pi@bananapi:~/amlogic-wiringPi$ gpio readall
 +-----+-----+---------+------+---+--- M5 ---+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3V |      |   |  1 || 2  |   |      | 5V      |     |     |
 | 493 |   8 |   SDA.2 | ALT1 | 1 |  3 || 4  |   |      | 5V      |     |     |
 | 494 |   9 |   SCL.2 | ALT1 | 1 |  5 || 6  |   |      | 0V      |     |     |
 | 481 |   7 |  IO.481 |   IN | 1 |  7 || 8  | 1 | ALT1 | TxD1    | 15  | 488 |
 |     |     |      0V |      |   |  9 || 10 | 1 | ALT1 | RxD1    | 16  | 489 |
 | 479 |   0 |  IO.479 |   IN | 1 | 11 || 12 | 1 | IN   | IO.504  | 1   | 504 |
 | 480 |   2 |  IO.480 |   IN | 1 | 13 || 14 |   |      | 0V      |     |     |
 | 483 |   3 |  IO.483 |   IN | 1 | 15 || 16 | 1 | IN   | IO.476  | 4   | 476 |
 |     |     |    3.3V |      |   | 17 || 18 | 1 | IN   | IO.477  | 5   | 477 |
 | 484 |  12 |    MOSI | ALT4 | 1 | 19 || 20 |   |      | 0V      |     |     |
 | 485 |  13 |    MISO | ALT4 | 1 | 21 || 22 | 1 | IN   | IO.478  | 6   | 478 |
 | 487 |  14 |    SLCK | ALT4 | 1 | 23 || 24 | 1 | OUT  | SS      | 10  | 486 |
 |     |     |      0V |      |   | 25 || 26 | 1 | IN   | IO.492  | 11  | 492 |
 | 474 |  30 |   SDA.3 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.3   | 31  | 475 |
 | 490 |  21 |  IO.490 |   IN | 1 | 29 || 30 |   |      | 0V      |     |     |
 | 491 |  22 |  IO.491 |   IN | 1 | 31 || 32 | 0 | IN   | IO.495  | 26  | 495 |
 | 482 |  23 |  IO.482 |   IN | 0 | 33 || 34 |   |      | 0V      |     |     |
 | 503 |  24 |  IO.503 |   IN | 1 | 35 || 36 | 0 | IN   | IO.432  | 27  | 432 |
 | 505 |  25 |  IO.505 |   IN | 0 | 37 || 38 | 1 | ALT4 | IO.506  | 28  | 506 |
 |     |     |      0V |      |   | 39 || 40 | 0 | IN   | IO.500  | 29  | 500 |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+--- M5 ---+---+------+---------+-----+-----+

댓글을 달아 주세요

  1. 2021.06.28 16:19  댓글주소  수정/삭제  댓글쓰기

    비밀댓글입니다

평소에 라즈베리파이를 가지고 여러가지 시도 해보았는데,
아이씨뱅규에서 라즈베리파이를 이용한 무상체험단 모집을 하고 있어서 소개합니다.

최근에 OpenCV를 배우면서 무엇을 해볼까 고민중이었는데, 라즈베리파이, 파이카메라, RC카가 하나로 만들어진 제품을 찾고 있었는데, 초음파 센서에 라인트레이서 모듈까지 RC로 구현하고 싶은 모든게 다 있는것 같습니다.

OpenCV를 이용한 라이트레이싱이나 손가락 인식을 이용한 RC카 제어를 해봐야겠습니다.

[체험단 56기] AI RC카 라즈봇(RASPBOT) 무상체험단 10명 모집 YAHBOOM

https://www.youtube.com/watch?v=MX2p7SqF3iY

★무상체험단★신제품! 라즈베리파이 AI RC카 '라즈봇(Raspbot)' 소개!

댓글을 달아 주세요