Yocto layer for Radxa boards

Hi. I’m maintaining a yocto layer called meta-radxa. Currently it has support for Rockpi-4, RockPi-S and the RockPi-E. Here is the link to meta-radxa if you want to build your own image. I currently don’t have the RockPi-4 and the RockPi-E and hence I’ve not been able to test the current builds. If anyone is up for testing these builds here are the images.

RockPi-4 Thud Builds

RockPi-E Thud Builds

Would really appreciate if someone could send me the console logs of it.

3 Likes

Update:

I’ve updated the boot.cmd and uEnv.txt for RockPi-E in the meta-radxa layer. The board should boot up now. Anyone up for testing please use the link above and do send the debug logs. Serial console should be available on UART-2.

1 Like

A quick update:

There was an issue with the trust.img for RockPi-4 and RockPi-E. That has been fixed and the images have been updated on the above links. I received my RockPi-E(D8W2) sample today and have tried the fixed RockPi-E builds. They work perfectly fine. So you can now build your custom image for the RockPi-E board successfully using the meta-radxa layer.

Hi, @nish

I run system image, https://www.dropbox.com/sh/mt9f47u5mkm7kpz/AADV3EIY3nolImBpigmktMUOa/radxa-console-image-rockpi-4b-rk3399-gpt.img?dl=0 on ROCK Pi 4B. The Ethernet, HDMI, USB and so on are working well. But there is one problem with Wi-Fi connection.

From the boot log, I find that there is not AP6256 firmware in /system/etc/firmware/ directory.

To fix that, you can get the AP6256 firmware from this package, https://github.com/radxa/apt/blob/gh-pages/stretch-testing/pool/main/b/broadcom-wifibt-firmware/broadcom-wifibt-firmware_0.6_all.deb . And add the following three files in /system/etc/firmware directory.

root@rockpi-4b-rk3399:~# ls /system/etc/firmware/
fw_bcm43456c5_ag.bin  fw_bcm43456c5_ag_p2p.bin  nvram_ap6256.txt
1 Like

Hey @Stephen

Thank you for taking time out to test the image for RockPi-4. Yes the firmware for AP6256 was missing. I’ve included the firmware to the new builds and also updated the meta-radxa layer for the same. The wifi for RockPi-4 should work now. If you want to try it out here is the link: https://www.dropbox.com/s/767wgi4ktgbo6rr/radxa-console-image-rockpi-4b-rk3399-gpt.img?dl=0

Just a quick update:

I’ve updated to warrior. Here is the change log from thud to warrior:

  1. RockPi-S Kernel updated to 4.4.143-39-daf243b9655a73ee14568e36cf76ac8a094e68e6
  2. RockPi-S U-Boot updated to 2017.09-c3d3bc84bef5ee95d7199c23e1a34e47ea8f0daf (Supports boot.cmd and uEnv.txt)
  3. RockPi-4 Kernel updated to 4.4.154-95-d2ab1f26e1b33970a6ccda18633a681a7730665e
  4. Firmware file location fixed for RockPi-E
  5. Bluetooth works for RockPi-S, RockPi-E and RockPi-4
  6. Added instructions on how to setup bluetooth for each board
  7. RockPi-S serial console changed from UART-2 to UART-0
  8. Radxa binaries are now taken from the radxa official repository

nish,
thanks for your yocto support. I cloned meta-raxda and build successfully the image for the rock pi S. Nice and easy.

Trying to modify the kernel to include gadget audio support, here my steps:

   bitbake linux-rockpi-s -c menuconfig
   bitbake linux-rockpi-s -c do_compile -f
   bitbake linux-rockpi-s
   bitbake -k radxa-console-image

But still no gadget support.
You have any recommendation how to build a custom kernel?

found the issue, the gadget support needs to be set as ‘Module’. the default config has it set in a ‘linked in’ to the kernel.
(I like module support, as it allows you to enable/disable specific Gadget modules.)

I think you can change the ROCK Pi S kernel commit id to 5e1be82eb296ba36f9f656a1b9ee9c2df7e5a1db in file linux-rockpi-s_4.4.bb since ROCK Pi S kernel in Radxa repo helps fixed the issue.

2 Likes

Hi @mattes. I’m glad you found it easy. I checked the commits in the radxa kernel repo for the rockpi-s and this has been solved there as @Stephen rightly pointed out. I’ll update the recipe to the latest commit and this should solve the problem.

Hi @nish,

Thanks again for maintaining this layer :smile:. I’m trying to generate and boot a FIT image for Rock Pi S via Yocto, and I’m not being able to boot it… I’ve moved my changes from my layer to the fitimage branch on my meta-radxa fork on github. Only the last commit (actually changing image type to fitImage) is not working (hanging after Starting kernel ....

On the first 2 commits I patch the device tree to enable uart0 without overlay and disable overlays, to prevent any overlay loading problems.

I’ve also tried to modify the load address and kernel entry point to some common addresses on the machine config by using the following resulting in an abort.

UBOOT_LOADADDRESS = "0x00080000"
UBOOT_ENTRYPOINT  = "0x00080000"

Both bootm and booti fail, but with different outputs. Also I’ve tried to patch the kernel to panic as first statement, but it still hangs.

Logs (for try exactly as in repository):

DDR Version V1.26
REGFB: 0x00000031, 0x00000031
In
589MHz
DDR3
 Col=10 Bank=8 Row=15 Size=512MB
msch:1
Returning to boot ROM...
INFO:    Preloader serial: 0
NOTICE:  BL31: v1.3(release):3a579d3
NOTICE:  BL31: Built : 09:09:17, Jan 29 2019
INFO:    Lastlog: last=0x100000, realtime=0x102000, size=0x2000
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x600000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02383-g233a23e3ed-dirty (Nov 12 2020 - 05:21:59 +0000)

Model: Radxa ROCK Pi S
PreSerial: 0
DRAM:  510 MiB
Relocation Offset is: 1f91b000
vdd_core 1044000 uV
vdd-core init 1044000 uV
MMC:   dwmmc@ff480000: 0, dwmmc@ff490000: 1
Using default environment

In:    serial@ff0c0000
Out:   serial@ff0c0000
Err:   serial@ff0c0000
Model: Radxa ROCK Pi S
Bootdev(atags): mmc 1
PartType: EFI
## Error: Can't overwrite "serial#"
## Error inserting "serial#" variable, errno=1
get part misc fail -1
boot mode: None
CLK:
apll 816000 KHz
dpll 1300000 KHz
vpll0 1179647 KHz
vpll1 903167 KHz
aclk_bus 185714 KHz
hclk_bus 100000 KHz
pclk_bus 100000 KHz
aclk_peri 185714 KHz
hclk_peri 100000 KHz
pclk_peri 100000 KHz
hclk_audio 98303 KHz
pclk_audio 98303 KHz
Net:   Net Initialization Skipped
No ethernet found.
Hit key to stop autoboot('CTRL+C'):  0 
starting USB...
USB0:   Core Release: 3.10a
USB1:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
Card did not respond to voltage select!
mmc_init: -95, time 9
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
reading /boot.scr
1152 bytes read in 7 ms (160.2 KiB/s)
## Executing script at 00500000
Boot script loaded from mmc 1
reading /uEnv.txt
152 bytes read in 5 ms (29.3 KiB/s)
reading /fitImage
5397456 bytes read in 280 ms (18.4 MiB/s)
## Loading kernel from FIT Image at 00280000 ...
   Using 'conf@rockchip_rk3308-rock-pi-s.dtb' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x00280104
     Data Size:    5331929 Bytes = 5.1 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x01314c40
     Entry Point:  0x01314c40
     Hash algo:    sha256
     Hash value:   72ec01ea0e9378b94faf73bc0dd65b5f6e116053bb38144fd019baef5519ef3b
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 00280000 ...
   Using 'conf@rockchip_rk3308-rock-pi-s.dtb' configuration
   Trying 'fdt@rockchip_rk3308-rock-pi-s.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x00795e00
     Data Size:    63542 Bytes = 62.1 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   29a12c015771edcef94ec01822529e5b195162d2f096c1ca7624758d760d9c97
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x795e00
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 000000001f4f7000, end 000000001f509835 ... OK
Adding bank: 0x00200000 - 0x20000000 (size: 0x1fe00000)

Starting kernel ...



Do you have any idea on how to boot correctly the FIT Image?

I’ll go through the commits and get back to you. From a quick glance of the commits, the first 2 seem to be fine and should not be causing this. The 3rd commit is the one I’ll need to check. I haven’t worked with fitImages but surely I’ll go through it.

@Stephen could you take a look at this when you get time?

To boot the FIT Image, a new feature. Sure, I will look at this.

@pheki From the uboot log, I think you have modified the U-Boot. Can you share what you have done to it?

I’ve actually only enabled the iminfo command to get kernel info from u-boot without booting, just added it to my branch: https://github.com/pheki/meta-radxa/blob/fitimage/recipes-bsp/u-boot/files/0001-Enable-iminfo-command-for-rockpi-s-rk3308.patch

There were actually two more patches already on the yocto layer (for Rock Pi S):

  • recipes-bsp/u-boot/files/0001-Makefile-disable-gcc9-s-address-of-packed-member-war.patch
  • recipes-bsp/u-boot/files/0001-Use-local-command.h-file-instead-of-system-file.patch

I also forgot to mention, but I temporarily modified meta/clases/kernel-fitimage.bbclass and removed u-boot-tools-native from

depends = "%s u-boot-tools-native dtc-native" % depends

I don’t think it shows anything new but here is the iminfo output:

=> iminfo ${kernel_addr_r}

## Checking Image at 00280000 ...
   FIT image found
   FIT description: U-Boot fitImage for Poky (Yocto Project Reference Distro)/4.4.143/rockpi-s-rk3308
    Image 0 (kernel@1)
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x00280104
     Data Size:    5331929 Bytes = 5.1 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x01314c40
     Entry Point:  0x01314c40
     Hash algo:    sha256
     Hash value:   72ec01ea0e9378b94faf73bc0dd65b5f6e116053bb38144fd019baef5519ef3b
    Image 1 (fdt@rockchip_rk3308-rock-pi-s.dtb)
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x00795e00
     Data Size:    63542 Bytes = 62.1 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   29a12c015771edcef94ec01822529e5b195162d2f096c1ca7624758d760d9c97
    Default Configuration: 'conf@rockchip_rk3308-rock-pi-s.dtb'
    Configuration 0 (conf@rockchip_rk3308-rock-pi-s.dtb)
     Description:  1 Linux kernel, FDT blob
     Kernel:       kernel@1
     FDT:          fdt@rockchip_rk3308-rock-pi-s.dtb
## Checking hash(es) for FIT Image at 00280000 ...
   Hash(es) for Image 0 (kernel@1): sha256+ 
   Hash(es) for Image 1 (fdt@rockchip_rk3308-rock-pi-s.dtb): sha256+ 

Hi @nish & @Stephen,
Thanks for maintaining this layer.

Do you know how I can add the mali GPU drivers to the build?

“apt-get” cannot be used properly. Installing any package prompt “E: Unable to locate package xxx”:

root@rockpi-s-rk3308:~# apt-get update
Reading package lists… Done
root@rockpi-s-rk3308:~# sudo apt-get update
Reading package lists… Done
root@rockpi-s-rk3308:~# sudo apt-get upgrade
Reading package lists… Done
Building dependency tree… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@rockpi-s-rk3308:~# sudo apt-get install minicom
Reading package lists… Done
Building dependency tree… Done
E: Unable to locate package minicom
root@rockpi-s-rk3308:~# sudo apt-get install python3-pip
Reading package lists… Done
Building dependency tree… Done
E: Unable to locate package python3-pip

“apt-get” tools environment is not configured correctly?

I think the reason is that your OS apt sources does not include minicom and python3-pip.

To test apt-get, can you try this?

Add this patch

diff --git a/recipes-core/packagegroups/packagegroup-radxa-console.bb b/recipes-core/packagegroups/packagegroup-radxa-console.bb
index e626048..ffd645a 100644
--- a/recipes-core/packagegroups/packagegroup-radxa-console.bb
+++ b/recipes-core/packagegroups/packagegroup-radxa-console.bb
@@ -9,6 +9,7 @@ RDEPENDS_packagegroup-radxa-console = "\
     alsa-utils-aplay \
     coreutils \
     cpufrequtils \
+    gnupg \
     hostapd \
     htop \
     iptables \

And get io package from Radxa APT for test.

# export DISTRO=buster-testing
# echo "deb http://apt.radxa.com/$DISTRO/ ${DISTRO%-*} main" | sudo tee -a /etc/apt/sources.list.d/apt-radxa-com.list
# wget -O - apt.radxa.com/$DISTRO/public.key | sudo apt-key add -
# apt update
# apt-get install io

Thank you for your reminding!

Failed to get io package:

root@rockpi-s-rk3308:~# export DISTRO=buster-testing
t.d/apt-radxa-com.list# echo “deb http://apt.radxa.com/$DISTRO/ ${DISTRO%-*} main” | sudo tee -a /etc/apt/sources.lis
deb http://apt.radxa.com/buster-testing/ buster main
root@rockpi-s-rk3308:~# wget -O - apt.radxa.com/$DISTRO/public.key | sudo apt-key add -
wget: bad address ‘apt.radxa.com
Error: gnupg or gnupg2 do not seem to be installed,
Error: but apt-key requires gnupg or gnupg2 for this operation.

root@rockpi-s-rk3308:~# sudo apt-get update
Err:1 http://apt.radxa.com/buster-testing buster InRelease
Temporary failure resolving ‘apt.radxa.com
Reading package lists… Done
W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/apt-radxa-com.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/apt-radxa-com.list:1 2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/apt-radxa-com.lis2
W: Failed to fetch http://apt.radxa.com/buster-testing/dists/buster/InRelease Temporary failure resolving ‘apt.radxa.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/apt-radxa-com.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/apt-radxa-com.list:1 2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/apt-radxa-com.lis2
root@rockpi-s-rk3308:~# apt-get install io
Reading package lists… Done
Building dependency tree… Done
E: Unable to locate package io
root@rockpi-s-rk3308:~# sudo apt-get install io
Reading package lists… Done
Building dependency tree… Done
E: Unable to locate package io

May be the file “/etc/apt/source.list” ?

You forget to apply the patch to add package gnupg and build a new system image.

Yes, the patch was added to this package now. Then, I can install “io” with “DISTRO=buster-testing”, but failed to install another, for examples “git”, “minicom”, “python3-pip”, you known those packages are commonly used.

Testing information:

root@rockpi-s-rk3308:~# sudo apt-get update
Get:1 http://apt.radxa.com/buster-testing buster InRelease [2363 B]
Get:2 http://apt.radxa.com/buster-testing buster/main arm64 Packages [48.1 kB]
Fetched 50.4 kB in 1s (32.7 kB/s)
Reading package lists… Done
root@rockpi-s-rk3308:~# sudo apt-get install io
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
io
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1102 kB of archives.
After this operation, 0 B of additional disk space will be used.
Selecting previously unselected package io.
(Reading database … 21173 files and directories currently installed.)
Preparing to unpack …/apt/archives/io_0.1_arm64.deb …
Unpacking io (0.1) …
Setting up io (0.1) …
root@rockpi-s-rk3308:~# sudo apt-get install git
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package git
root@rockpi-s-rk3308:~# sudo apt-get install python3-pip
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package python3-pip

In addition, I have also append the some sources in the file “/etc/apt/source.list”:

root@rockpi-s-rk3308:~# cat /etc/apt/source.list
deb http://httpredir.debian.org/debian buster main contrib non-free
#deb-src http://httpredir.debian.org/debian buster main contrib non-free
deb http://httpredir.debian.org/debian buster-updates main contrib non-free
#deb-src http://httpredir.debian.org/debian buster-updates main contrib non-free
deb http://httpredir.debian.org/debian buster-backports main contrib non-free
#deb-src http://httpredir.debian.org/debian buster-backports main contrib non-free
deb http://security.debian.org/ buster/updates main contrib non-free
#deb-src http://security.debian.org/ buster/updates main contrib non-free

#deb http://mirrors.aliyun.com/debian/ busterq main non-free contrib

deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib

#deb http://mirrors.aliyun.com/debian-security main/updates main

deb-src http://mirrors.aliyun.com/debian-security buster/updates main

#deb http://mirrors.aliyun.com/debian/ testing-updates main non-free contrib

deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib

#deb http://mirrors.aliyun.com/debian/ testing-backports main non-free contrib

deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

#deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free

deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free

#deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free

deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free

#deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free

deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free

#deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

I am trying to change some kinds of source, but the results are same.