Radxa Rock 4 SE supported? Not booting

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
  • Kernel version | uname -a
  • Architecture | dpkg --print-architecture
  • SBC model | Radxa ROCK 4 SE
  • Power supply used | QC3.0, 12v 2.5A
  • SD card used | Samsung Pro Endurance 32GB

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
  • Was the software title installed freshly or updated/migrated?
  • Can this issue be replicated on a fresh installation of DietPi?
    ā† If you sent a ā€œdietpi-bugreportā€, please paste the ID here ā†’
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

Flash sdcard. Try to boot

Expected behaviour

Boot

  • ā€¦

Actual behaviour

Not booting, no picture on hdmi, no heartbeat led

  • ā€¦

Extra details

So before gettting into real discussion - my question - is Radxa ROCK 4SE even supported /meant to be used with ROCK4 images?

I donā€™t think so. You could try to connect serial console to check what happen on early boot process.

it gives:

U-Boot TPL 2022.07-armbian (Nov 26 2023 - 16:22:55)
Channel 0: col error
Cap error!
Channel 1: col error
Cap error!
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

It seems ram training problem:

[PATCH 0/3] rockchip: Fix RAM training on RK3399 based platforms (Rock Pi 4)

Radxa provided image boots fine with messages:

DDR Version 1.25 20210517
In
channel 0
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 1
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 0 training pass!
channel 1 training pass!
change freq to 416MHz 0,1
Channel 0: LPDDR4,416MHz
Bus Width=32 Col=10 Bank=8 Row=16 CS=1 Die Bus-Width=16 Size=2048MB
Channel 1: LPDDR4,416MHz
Bus Width=32 Col=10 Bank=8 Row=16 CS=1 Die Bus-Width=16 Size=2048MB
256B stride
channel 0
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 1
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 0 training pass!
channel 1 training pass!
channel 0, cs 0, advanced training done
channel 1, cs 0, advanced training done
change freq to 666MHz 1,0
ch 0 ddrconfig = 0x101, ddrsize = 0x40
ch 1 ddrconfig = 0x101, ddrsize = 0x40
pmugrf_os_reg[2] = 0x32C1F2C1, stride = 0xD
ddr_set_rate to 328MHZ
ddr_set_rate to 666MHZ
ddr_set_rate to 416MHZ, ctl_index 0
ddr_set_rate to 666MHZ, ctl_index 1
support 416 328 666 MHz, current 666MHz
OUT
Boot1: 2019-03-14, version: 1.19
CPUId = 0x0
ChipType = 0x10, 266
mmc: ERROR: SDHCI ERR:cmd:0x102,stat:0x18000
mmc: ERROR: Card did not respond to voltage select!
emmc reinit
mmc: ERROR: SDHCI ERR:cmd:0x102,stat:0x18000
mmc: ERROR: Card did not respond to voltage select!
emmc reinit
mmc: ERROR: SDHCI ERR:cmd:0x102,stat:0x18000
mmc: ERROR: Card did not respond to voltage select!
SdmmcInit=2 1
mmc0:cmd5,20
SdmmcInit=0 0
BootCapSize=0
UserCapSize=30560MB
FwPartOffset=2000 , 0
StorageInit ok = 45391
SecureMode = 0
SecureInit read PBA: 0x4
SecureInit read PBA: 0x404
SecureInit read PBA: 0x804
SecureInit read PBA: 0xc04
SecureInit read PBA: 0x1004
SecureInit read PBA: 0x1404
SecureInit read PBA: 0x1804
SecureInit read PBA: 0x1c04
SecureInit ret = 0, SecureMode = 0
atags_set_bootdev: ret:(0)
GPT part:  0, name:           config, start:0x8000, size:0x8000
GPT part:  1, name:           rootfs, start:0x10000, size:0x3b9ffdf
no find partition:uboot.
LoadTrust Addr:0x4000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 2000
hdr 0000000003380880 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load OK, addr=0x200000, size=0xdbc38
RunBL31 0x40000
NOTICE:  BL31: v1.3(release):845ee93
NOTICE:  BL31: Built : 15:51:11, Jul 22 2020
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1196): pd status 3e
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 = 0x200000
INFO:    SPSR = 0x3c9


U-Boot latest-2022.10-1-4debc57a-00007-g35459f87 (Mar 06 2023 - 15:51:36 +0000)

SoC: Rockchip rk3399
Reset cause: POR
Model: Radxa ROCK 4SE
DRAM:  3.9 GiB

according Armbian, you can use the Model B builds. Maybe you can check if this one is booting. If yes, you can have a look to our DietPi installer.

But radxa has dedicated images for each 4 modell, also debian based (but only with kernel 5.x). A conversion to DietPi should also be possible with this images.
https://wiki.radxa.com/Rockpi4/downloads

Feel a bit stupid not seeing this info down the page. But no - it seems they all (Dietpi 4, armbian 4, armbian 4b) have same U-boot:

U-Boot TPL 2022.07-armbian (Nov 26 2023 - 16:22:55)

and hence is not working. I think radxa has changed some memory configuration in the revision which now needs ammending.

Thanks for the quick reply thou

If you feel in the mood, you could open a topic in the Armbian forum. But I would recommend to avoid any reference to DietPi and only use Armbianā€™s own images / tools.

1 Like

The most I would like is get the thinned down version of debian like dietpi is. Will it remove packages if converting to dietpi? It has graphical desktop which is the main huge thing, but also other stuff. This is what iā€™m currently using.

Yes, our installer will remove everything that is not provided by us. Could be good to get a lean image, but could also be bad as it will be too much for some SBC that we donā€™t fully support. :wink:

Iā€™m good with some adventure. Not total noobie on linux.
I managed to dodge some errors on the conflicts about radxa-firmware conflicting with armbian-firmware. But now Iā€™m kinda on state where I donā€™t know which door to choose.

Removing radxa-otgutils (0.2.2) ...
Removing radxa-sddm-theme (0.1.1) ...
Removing 'diversion of /usr/share/sddm/themes/breeze/Main.qml to /usr/share/sddm/themes/breeze/Main.qml.bak by radxa-sddm-theme'
Removing task-rock-4se (0.4.10) ...
Removing radxa-system-config-bullseye (0.5.8) ...
Removing radxa-system-config-rk3399 (0.5.8) ...
Removing radxa-system-config-rockchip (0.5.8) ...
Removing 'diversion of /usr/share/applications/mimeapps.list to /usr/share/applications/mimeapps.list.bak by radxa-system-config-rockchip'
Removing 'diversion of /etc/modprobe.d/panfrost.conf to /etc/modprobe.d/panfrost.conf.bak by radxa-system-config-rockchip'
dpkg-divert: error: rename involves overwriting '/etc/modprobe.d/panfrost.conf' with
  different file '/etc/modprobe.d/panfrost.conf.bak', not allowed
dpkg: error processing package radxa-system-config-rockchip (--remove):
 installed radxa-system-config-rockchip package post-removal script subprocess returned error exit status 2
dpkg: too many errors, stopping
Errors were encountered while processing:
 radxa-system-config-rockchip
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
[FAILED] DietPi-Installer | APT autopurge gawk original-awk
 - Command: apt-get -y autopurge gawk original-awk

Any quick pointers. It does need to be detailed or exact.

Iā€™m kind of feeling that I have overstayed my welcome and if itā€™s the case just let me know that it is not the place :slight_smile:

probably Radxa firmware packages donā€™t like to be removed. But honestly, I donā€™t know. Maybe @MichaIng has an idea.

Iā€™m actually just working on it and made progress.
I got it further - i think so too, that they might not be good to remove radxa-firmware. If I used rock4 as base from the dietpi build menu, it would revert to same behaviour as the images from Armbian - stuck in boot.

If i chose generic rk3399, then it actually booted, but lan was not working (it worked with generic usb deongle). So I think also that adding back radxa repo and keys and reinstalling the radxa-firmware after conversion could get it working.

image

In meantime i found that radxa page refest to github page and in github there is minimal cli version of it (250MB packed). It is bullseye thou. But it would be far better and faster base to use for conversion as it took forver to remove all the packages and it was still quite a big size after that.
URL to whomever it might interest: https://github.com/radxa-build/rock-4se/releases/

For what itā€™s worth, I would also send you this link, as I experienced some of the same issues with my Rock 4 SE.
There are many ā€œheavyā€ pages on Radxa that donā€™t lead anywhere, but through their github, I found this download page as well with these images. :face_exhaling:

and if you want an extra image to your bookmark collection, here is openSUSE tumbleweedā€¦
HCL:ROCK Pi 4 - openSUSE Wiki and Portal:Arm - openSUSE Wiki

It used to work in the past, but seems to have been broken with a recent U-Boot update: Rock 4 SE not booting - Rockchip - Armbian Community Forums

Looks like it was broken on purpose, but without fixing the information on the website: Rock 4SE: change uboot defconfig by lanefu Ā· Pull Request #5612 Ā· armbian/build Ā· GitHub

There was a ROCK 4SE config added, but it looks like it results in another 4B-only build: build/config/boards/rock-4se.csc at f9c3b6ce3d68509767ef8a388ac8a6856b0deae8 Ā· armbian/build Ā· GitHub
At least the device tree is wrong and for the bootloader it looks wrong. But it is a different version with different DDR blob than the one for ROCK 4B, so maybe it does work.

Iā€™ll do two thinkgs:

  • Build an image with the latest ROCK 4B bootloader, just in case it magically does work (again).
  • If it doesnā€™t build one with the ROCK 4SE bootloader.
  • If that doesnā€™t work either, Iā€™ll check for mainline U-Boot support with rock-4se-rk3399_defconfig and in case build a bootloader with this being used.

Build is running: DietPi-Build Ā· MichaIng/DietPi@682dfdb Ā· GitHub
@webfinder42 would be great if you could test the image, which will be available in ~30 minutes here: Index of /downloads/images/testing

1 Like
U-Boot TPL 2022.07-armbian (Feb 10 2024 - 01:23:47)
Channel 0: col error
Cap error!
Channel 1: col error
Cap error!
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

Noup. Still the same. I can see new bootloader date.

As on another path I was able to run radxa bullseye image and then upgrade installation to bookworm and even activate 6.5 kernel.

New build running with specific ROCK 4 SE bootloader: DietPi-Build Ā· MichaIng/DietPi@f1fa83c Ā· GitHub

Excellent.

It runs. And it boot so fast. Thank you so much everybody contributing. :heart_eyes:

2 Likes

Great, thanks for testing. I am not happy about the fact that we need to provide two dedicated images now, but at least it can be generated without much hassle: ROCK 4 | Fix support for ROCK 4 SE by MichaIng Ā· Pull Request #6912 Ā· MichaIng/DietPi Ā· GitHub

1 Like

Wellā€¦ these are RK3399 vs RK3399-T chips, which seems like basically the same chip, but interestingly the description on memory support is what differentiates in datasheet, so probably memory initialization is a bit different. As all memory support (DDR3/DDR3L/DDR4 etc) and channels are all software configurable, it becomes a thing.

RK3399:

  • Compatible with JEDEC standard DDR3-1866 /DDR3L-1866 /LPDDR3-1866 /
    LPDDR4 SDRAM

RK3399-T:

  • Compatible with JEDEC standard DDR3-666/DDR3L-666/LPDDR3-666 / LPDDR4-
    666 SDRAM

And sure enought it boots with 666Mhz memory:

DDR Version 1.30 20230417
In
soft reset
SRX
channel 0
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 1
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 0 training pass!
channel 1 training pass!
change freq to 416MHz 0,1
Channel 0: LPDDR4,416MHz
Bus Width=32 Col=10 Bank=8 Row=16 CS=1 Die Bus-Width=16 Size=2048MB
Channel 1: LPDDR4,416MHz
Bus Width=32 Col=10 Bank=8 Row=16 CS=1 Die Bus-Width=16 Size=2048MB
256B stride
channel 0
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 1
CS = 0
MR0=0xB8
MR4=0x1
MR5=0x13
MR8=0x10
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 0 training pass!
channel 1 training pass!
channel 0, cs 0, advanced training done
channel 1, cs 0, advanced training done
change freq to 666MHz 1,0
ch 0 ddrconfig = 0x101, ddrsize = 0x40
ch 1 ddrconfig = 0x101, ddrsize = 0x40
pmugrf_os_reg[2] = 0x32C1F2C1, stride = 0xD
ddr_set_rate to 328MHZ
ddr_set_rate to 666MHZ
ddr_set_rate to 416MHZ, ctl_index 0
ddr_set_rate to 666MHZ, ctl_index 1
support 416 328 666 MHz, current 666MHz
OUT

U-Boot SPL 2023.10-rc2-armbian (Aug 22 2023 - 15:24:08 +0000)
Trying to boot from MMC1
## Checking hash(es) for config config-1 ... OK
## Checking hash(es) for Image atf-1 ... sha256+ OK
## Checking hash(es) for Image u-boot ... sha256+ OK
## Checking hash(es) for Image fdt-1 ... sha256+ OK
## Checking hash(es) for Image atf-2 ... sha256+ OK
## Checking hash(es) for Image atf-3 ... sha256+ OK
NOTICE:  BL31: v1.3(release):8f40012ab
NOTICE:  BL31: Built : 14:20:53, Feb 16 2023
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1203): pd status 3e
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 = 0x200000
INFO:    SPSR = 0x3c9
ns16550_serial serial@ff1a0000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19


U-Boot 2023.10-rc2-armbian (Aug 22 2023 - 15:24:08 +0000)

SoC: Rockchip rk3399
Reset cause: RST
Model: Radxa ROCK Pi 4A
DRAM:  4 GiB (effective 3.9 GiB)
PMIC:  RK808
Core:  288 devices, 30 uclasses, devicetree: separate
MMC:   mmc@fe320000: 1, mmc@fe330000: 0
Loading Environment from MMC... Card did not respond to voltage select! : -110
*** Warning - No block device, using default environment

In:    serial,usbkbd
Out:   serial,vidconsole
Err:   serial,vidconsole
Model: Radxa ROCK Pi 4A
Card did not respond to voltage select! : -110
Unable to get mmc desc
Net:   eth0: ethernet@fe300000
Hit any key to stop autoboot:  0
** Booting bootflow 'mmc@fe320000.bootdev.part_1' with script
303 bytes read in 5 ms (58.6 KiB/s)
29729280 bytes read in 1259 ms (22.5 MiB/s)
12706791 bytes read in 543 ms (22.3 MiB/s)
79666 bytes read in 13 ms (5.8 MiB/s)
Working FDT set to 1f00000
Moving Image from 0x2080000 to 0x2200000, end=3f00000
## Loading init Ramdisk from Legacy Image at 06000000 ...

-T runs on 1.5/1.0Ghz vs 1.8/1.4G on non-T. That seems all the diff I can see for now.

Two problems I quickly looked at :

  • wifi - I tried to enable it, it installed modules and wpa_supplicant, but still after that returned as ā€œWifi - Not foundā€. I do not need it, but if needed I can test it as long as I still have the hw. Wifi is AW-CM256SM
  • cat /proc/device-tree/model reports ā€œRadxa ROCK Pi 4Aā€.
root@DietPi:~# cat /proc/device-tree/model
Radxa ROCK Pi 4Aroot@DietPi:~#

In radxa fw it correctly reports as ā€œRadxa ROCK 4SEā€. We use this for device identification between Radxa, Orangepi, Raspberry

root@rock-4se:~# cat /proc/device-tree/model
Radxa ROCK 4SEroot@rock-4se:~#
1 Like

Oh, I was expecting the ā€œROCK 4 SEā€ U-Boot build to define the ā€œROCK 4 SEā€ device tree as default, but obviously it does not. We need to set it in /boot/dietpiEnv.txt then, with the fdtfile= variable.

EDIT: Oh, the kernel/dtb package shipped by Armbian via their APT repo does not contain the ROCK 4 SE device tree yet. Probably it works when just updating the kernel. @janno can you test this:

cd /tmp
wget https://dietpi.com/downloads/binaries/linux-{image,dtb}-current-rockchip64.deb
dpkg -i linux-{image,dtb}-current-rockchip64.deb
rm linux-{image,dtb}-current-rockchip64.deb
reboot

If not, then after above:

G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3399-rock-4se.dtb' /boot/dietpiEnv.txt
reboot

I also just triggered a new image build with both above things done, but I am still curious whether the bootloader picks the correct device tree automatically, when it exists.