Skip to content

Commit

Permalink
feat(yocto): add Rock64 machine
Browse files Browse the repository at this point in the history
  • Loading branch information
nikAizuddin committed May 25, 2023
1 parent 7c4d33a commit 6a57e69
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@
[submodule "project/petalinux/kr260/project-spec/meta-user/recipes-apps/ros2-helloworld-python/files/ros2_helloworld_python"]
path = project/petalinux/kr260/project-spec/meta-user/recipes-apps/ros2-helloworld-python/files/ros2_helloworld_python
url = https://github.com/extra2000/ros2_helloworld_python.git
[submodule "project/yocto/layers/meta-rockchip"]
path = project/yocto/layers/meta-rockchip
url = https://git.yoctoproject.org/meta-rockchip
[submodule "project/yocto/layers/meta-arm"]
path = project/yocto/layers/meta-arm
url = https://git.yoctoproject.org/meta-arm
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ git clone --recursive https://github.com/extra2000/yocto-ros2-minimal.git
* [Raspberry Pi Zero 2 W](docs/yocto/specifics/rpizero2-w.md)
* [Raspberry Pi 3 B+](docs/yocto/specifics/rpi3bp.md)
* [Raspberry Pi 4 B](docs/yocto/specifics/rpi4b.md)
* Pine64:
* [Rock64](docs/yocto/specifics/rock64.md)
* All Yocto targets: [Yocto Building for All Targets](docs/yocto/all-targets.md)
4 changes: 3 additions & 1 deletion docs/yocto/all-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Prerequisites

* [extra2000/xilinx-toolkit v3.x image](https://github.com/extra2000/xilinx-toolkit)
* Available disk space: at least 250GB
* Available disk space: at least 350GB
* SDCard with at least 4GB.
* Digilent Analog Discovery 2 for accessing serial console through UART pins.

Expand Down Expand Up @@ -55,6 +55,7 @@ Image files and instructions how to flash to SD card are as follows:
* Raspberry Pi Zero 2 W image file: `project/yocto/build/tmp/deploy/images/raspberrypi0-2w-64/ros-image-core-humble-raspberrypi0-2w-64-*.rootfs.wic.bz2`. See [Flashing to SD Card for Raspberry Pi Zero 2 W](specifics/rpizero2-w.md#flashing-to-sd-card);
* Raspberry Pi 3 B+ image file: `project/yocto/build/tmp/deploy/images/raspberrypi3-64/ros-image-core-humble-raspberrypi3-64-*.rootfs.wic.bz2`. See [Flashing to SD Card for Raspberry Pi 3 B+](specifics/rpi3bp.md#flashing-to-sd-card);
* Raspberry Pi 4 B image file: `project/yocto/build/tmp/deploy/images/raspberrypi4-64/ros-image-core-humble-raspberrypi4-64-*.rootfs.wic.bz2`. See [Flashing to SD Card for Raspberry Pi 4 B](specifics/rpi4b.md#flashing-to-sd-card);
* Rock64 image file: `project/yocto/build/tmp/deploy/images/rock64/ros-image-core-humble-rock64-*.rootfs.wic`. See [Flashing to SD Card for Rock64](specifics/rock64.md#flashing-to-sd-card);


## Testing for Specific Boards
Expand All @@ -64,6 +65,7 @@ To test on specific boards, see the following list:
* [Testing for Raspberry Pi Zero 2 W](specifics/rpizero2-w.md#testing);
* [Testing for Raspberry Pi 3 B+](specifics/rpi3bp.md#testing);
* [Testing for Raspberry Pi 4 B](specifics/rpi4b.md#testing);
* [Testing for Rock64](specifics/rock64.md#testing);


## Cleaning Up
Expand Down
40 changes: 40 additions & 0 deletions docs/yocto/specifics/rock64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Rock64


## Building

Create container:
```
podman run -it --rm \
--network=host \
--userns="keep-id:uid=1000,gid=1000" \
-v ${PWD}/project:${PWD}/project:rw \
--workdir ${PWD}/project/yocto \
--security-opt label=disable \
localhost/extra2000/xilinx-toolkit:latest \
bash
source layers/poky/oe-init-build-env build
```

To check dependencies:
```
bitbake -p mc:rock64:ros-core
```

To build:
```
bitbake mc:rock64:ros-image-core
```


## Flashing to SD Card

Execute the following command:
```
sudo dd bs=4M iflag=fullblock oflag=direct status=progress if=project/yocto/build/tmp/deploy/images/rock64/ros-image-core-humble-rock64-*.rootfs.wic of=/dev/sdX; sudo sync
```


## Testing

Insert SD card and power on Raspberry Pi Zero W. Access serial console and login with `root` user. Then, follow [Testing](../common/testing.md) instructions.
3 changes: 3 additions & 0 deletions project/yocto/build/conf/bblayers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ BBLAYERS ?= " \
${YOCTOROOT}/layers/meta-openembedded/meta-multimedia \
${YOCTOROOT}/layers/meta-openembedded/meta-networking \
${YOCTOROOT}/layers/meta-openembedded/meta-python \
${YOCTOROOT}/layers/meta-arm/meta-arm \
${YOCTOROOT}/layers/meta-arm/meta-arm-toolchain \
${YOCTOROOT}/layers/meta-raspberrypi \
${YOCTOROOT}/layers/meta-rockchip \
${YOCTOROOT}/layers/meta-ros/meta-ros-common \
${YOCTOROOT}/layers/meta-ros/meta-ros2 \
${YOCTOROOT}/layers/meta-ros/meta-ros2-humble \
Expand Down
1 change: 1 addition & 0 deletions project/yocto/build/conf/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ BBMULTICONFIG = "\
raspberrypi0-2w-64 \
raspberrypi3-64 \
raspberrypi4-64 \
rock64 \
"

# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
Expand Down
3 changes: 3 additions & 0 deletions project/yocto/build/conf/multiconfig/rock64.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MACHINE = "rock64"

SERIAL_CONSOLES = "115200;ttyS2"
1 change: 1 addition & 0 deletions project/yocto/layers/meta-arm
Submodule meta-arm added at 81aca8
1 change: 1 addition & 0 deletions project/yocto/layers/meta-rockchip
Submodule meta-rockchip added at 026d6a

0 comments on commit 6a57e69

Please sign in to comment.