1 Star 0 Fork 0

Sudhesh / primary

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Supported-boards_RaspberryPi4_v1.rst 6.61 KB
一键复制 编辑 原始数据 按行查看 历史
Sudhesh 提交于 2021-03-19 17:38 . test

Raspberry Pi 4 Moel B

Overview

Raspberry Pi 4 Model B is powered with "Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz" This product's key features include a high-performance 64-bit quad-core processor, dual-display support at resolutions up to 4K via a pair of micro-HDMI ports, hardware video decode at up to 4Kp60, 4GB of RAM, dual-band 2.4/5.0GHz wireless LAN, Bluetooth 5.0, Gigabit Ethernet, USB 3.0 and PoE capability (via a separate PoE HAT add-on). The dual-band wireless LAN and Bluetooth have modular compliance certification, allowing the board to be designed into end products with significantly reduced compliance testing, improving both cost and time to market.

Applications

Embedded Design & Development, Hobby & Education, IoT (Internet of Things), Communications & Networking

Hardware

For more details on Raspberry Pi 4 board, see Raspberry Pi hardware page.

Working with the board

Supported images

  • openharmony-image-base
  • openharmony-image-extra

Building OHOS image

To clone the source code, perform the procedure in Getting Started Guide.

Linux image

  1. Source the environment with proper template settings, flavour being linux and target machine being raspberrypi4-64. Pay attention to how relative paths are constructed. The value of TEMPLATECONF is relative to the location of the build directory ./build-linux-raspberrypi4-64, that is going to be created after this step:
$ TEMPLATECONF=../sources/meta-ohos/flavours/linux . ./sources/poky/oe-init-build-env build-ohos-linux-raspberrypi4-64
  1. You will find yourself in the newly created build directory. Call bitbake to build the image. For example, if you are using openharmony-image-base run the following command:
$ MACHINE=raspberrypi4-64 bitbake openharmony-image-base

3. After the build completes, the bootloader, kernel and rootfs image files can be found in "build-ohos-linux-raspberrypi4-64/tmp/deploy/images/$MACHINE/". The key file which is needed to flash into SD card is "openharmony-image-base-raspberrypi4-64.wic.bz2"

Flashing OHOS Linux Image

SD card

The Raspberry Pi 4 board support multiple boot options. Below section describes booting with SD card option.

1. Insert the SD card into your Linux machine and find the device name using the lsblk or dmesg command. In my case its mmcblk0. Always check the dmesg to identify the SD card device name (mmcblk0) and compare against lsblk output, so that you may not do the mistake while formating the SD card.

$ dmesg [23671.831580] mmc0: new ultra high speed SDR104 SDHC card at address aaaa [23671.912821] mmcblk0: mmc0:aaaa SC16G 14.8 GiB [23671.932141] mmcblk0: p1 p2

$ lsblk mmcblk0 179:0 0 14.9G 0 disk ├─mmcblk0p1 179:1 0 40M 0 part /media/sudhesh/raspberrypi └─mmcblk0p2 179:2 0 312M 0 part /media/sudhesh/d5719bf1-e680-4519-be2f-fbdebd15d6bd

In the example above, the name of the SD device is /dev/mmcblk0, but this may vary on your system.

  1. Format the SD card as shown below. Be careful before running the following command and irrevocably erase the drive data. The of= part of the dd command must point SD card device name.

$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=4096 status=progress

Depending on the size of the SD card, the process will take some time to complete. Once done, the dd command will print "No space left on device".

$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=4096 status=progress [sudo] password for sudhesh: 15923740672 bytes (16 GB, 15 GiB) copied, 1129 s, 14.1 MB/s dd: error writing '/dev/mmcblk0': No space left on device 3889537+0 records in 3889536+0 records out 15931539456 bytes (16 GB, 15 GiB) copied, 1129.54 s, 14.1 MB/s

3. Go to the build directory (build-ohos-linux-raspberrypi/tmp/deploy/images/$MACHINE) & extract the ".wix.bz2" image and flash it into the SD card using the below command. Be careful; before running the following command make sure you use the correct target name(SD card name). The of= part of the dd command must point SD card device name.

Extract the wic.bz2 image: $ bzip2 -d -f openharmony-image-base-raspberrypi4-64.wic.bz2

Flash the image: $ sudo dd if=openharmony-image-base-raspberrypi4-64.wic of=/dev/mmcblk0

Once flashing is done it prints the below similar message

$ sudo dd if=openharmony-image-base-raspberrypi4-64.wic of=/dev/mmcblk0 729088+0 records in 729088+0 records out 373293056 bytes (373 MB, 356 MiB) copied, 60.97 s, 6.1 MB/s

4. Validate the SD card After successful flash make sure that you should have two partitions named boot & root. Validate the content inside the partition.

$ ls /media/sudhesh/boot/ bcm2711-rpi-4-b.dtb config.txt fixup4x.dat fixup_x.dat start4cd.elf start_cd.elf bootcode.bin fixup4cd.dat fixup_cd.dat image-version-info start4db.elf start_db.elf bootfiles-20201002.stamp fixup4.dat fixup.dat kernel8.img start4.elf start.elf cmdline.txt fixup4db.dat fixup_db.dat overlays start4x.elf start_x.elf

$ ls /media/sudhesh/root/ bin boot dev etc home lib lost+found media mnt proc run sbin sys tmp usr var

Enable UART:

By default the new GPIO UART is not enabled so the first thing to do is to edit the /media/sudhesh/boot/config.txt file to enable the serial UART:

Add the below line at the bottom of the file.

enable_uart=1

HDMI

Works by default.

1
https://gitee.com/sudhesh/primary.git
git@gitee.com:sudhesh/primary.git
sudhesh
primary
primary
master

搜索帮助