Contents
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.
Embedded Design & Development, Hobby & Education, IoT (Internet of Things), Communications & Networking
For more details on Raspberry Pi 4 board, see Raspberry Pi hardware page.
To clone the source code, perform the procedure in Getting Started Guide.
$ TEMPLATECONF=../sources/meta-ohos/flavours/linux . ./sources/poky/oe-init-build-env build-ohos-linux-raspberrypi4-64
$ 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"
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.
$ 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
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
Works by default.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。