Testing single-board computer Rock 3a (2GB) on Armbian (vendor).
I chose vendor (kernel 6.1) because I’m not satisfied with the fact that current (kernel 6.6+) doesn’t support npu (planning to work with HA+Frigate), and power management features (USB wake-up or flexible sleep system).
Built Bookworm vendor (kernel 6.1.75), what doesn’t work by default:
- USB wake-up doesn’t work (mouse/keyboard/even Bluetooth dongle) - fixed in dts below
- Wake-up timer doesn’t work (e.g., at specified time) - fixed in dts below
- Buggy Ethernet (sometimes connects at 100Mbps instead of 1000Mbps, sometimes reconnects) - fixed timings in dts below
What critically works by default is SD-card speed on sdr104 protocol (in my case slightly above 60MB read speed), while on current kernel this protocol didn’t work and memory card speed was 25MB (like class 10)
For me, current (kernel 6.6+) is raw and the above doesn’t work, and there’s no possibility to enable all this since there are no drivers and modules.
Tested WoL via LAN - buggy, I thought this function doesn’t work at all, spent lots of time, but discovered a bug - to enable this function on Ethernet you need to enable it first, then disable it, and enable again:
sudo ethtool -s end1 wol g
sudo ethtool -s end1 wol d
sudo ethtool -s end1 wol g
(g = enable Magic Packet, d = disable, u = enable Unicast Any Packet, can be combined gu or separately)
Also noticed that there is less consumption if the SBC goes to sleep (and wakes) up at least once, the following sleep at same booted system will be with less consumption if we sleep the first time.
fixes-vendor-rock-3a.dts
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&i2c5>;
__overlay__ {
status = "okay";
pinctrl-0 = <&i2c5m0_xfer>;
hym8563: hym8563@51 {
compatible = "haoyu,hym8563";
reg = <0x51>;
interrupt-parent = <&gpio0>;
interrupts = <27 8>; //RK_PD3 IRQ_TYPE_LEVEL_LOW
#clock-cells = <0>;
clock-frequency = <32768>;
clock-output-names = "hym8563";
pinctrl-names = "default";
pinctrl-0 = <&hym8563_int>;
wakeup-source;
};
};
};
fragment@1 {
target = <&pinctrl>;
__overlay__ {
hym8563 {
hym8563_int: hym8563-int {
rockchip,pins = <0 27 0 &pcfg_pull_up>; //GPIO0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up
};
};
};
};
fragment@2 {
target-path = "/";
__overlay__ {
rockchip_suspend: rockchip-suspend {
compatible = "rockchip,pm-rk3568";
status = "okay";
rockchip,sleep-debug-en = <1>;
rockchip,sleep-mode-config = <
(0
| (1 << 2) // RKPM_SLP_CENTER_OFF
| (1 << 6) // RKPM_SLP_HW_PLLS_OFF
| (1 << 7) // RKPM_SLP_PMUALIVE_32K
| (1 << 10) // RKPM_SLP_32K_PVTM
// | (1 << 5) // RKPM_SLP_PMIC_LP (less power compsumtion but no USB and no WoL, only GPIO/RTC wakeup)
)
>;
rockchip,wakeup-config = <
(0
| (1 << 4) // RKPM_GPIO_WKUP_EN
| (1 << 9) // RKPM_USB_WKUP_EN
| (1 << 0) //RKPM_CPU0_WKUP_EN
)
>;
};
};
};
fragment@3 {
target = <&gmac1>;
__overlay__ {
/* delay time for phy reset cannot be too short, which may cause phy reset fail */
snps,reset-delays-us = <0 50000 100000>;
tx_delay = <0x30>;
rx_delay = <0x20>;
};
};
};
To apply this overlay, you need to copy it somewhere on the single-board computer and execute the command:
cd <path to fixes-vendor-rock-3a.dts>
sudo armbian-add-overlay fixes-vendor-rock-3a.dts
Reboot.
(if it doesn’t boot at all or something doesn’t work, you can always delete these changes from the /boot/overlay-user/ folder)
RTC Wake-up timer testing:
sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
sudo sh -c "echo `date '+%s' -d '+ 1 minutes'` > /sys/class/rtc/rtc0/wakealarm"
sudo systemctl suspend
(here we set wake-up after 1 minute from current time, you can choose seconds/minutes/hours and others, maybe even days - haven’t tested)
Power Consumption:
Testing was performed on Imax B6 Evo / OWON HDS242S.
Note that this doesn’t include power consumption of m.2 SSD, SD-card, eMMC (they should be turned off in sleep mode), but USB devices weren’t used, tested bare single-board computer, each module will have its own consumption, and especially USB-connected devices, add your values to sleep mode consumption.
Wake-up by GPIO, RTC only:
In the most power-saving mode (Enabled RKPM_SLP_PMIC_LP, other options in dts untouched. Also we sleeping one time already.) I got:
Command to sleep or power-off | Power supply | Power | Current |
---|---|---|---|
sudo systemctl suspend | 12V | 0.62W | 0,052A |
sudo shutdown -h now | 12V | 0.60W | 0,050A |
(note that in mode with enabled RKPM_SLP_PMIC_LP only GPIO or RTC wake-up will work, even if RKPM_USB_WKUP_EN and/or RKPM_CPU0_WKUP_EN are enabled)
Wake up by GPIO, RTC, USB, WoL:
As I wrote before, there is a buggy Ethernet (it is somehow not initialized correctly or something), before objective measurements should be done:sudo ethtool -s end1 wol g && sudo ethtool -s end1 wol d
(Turn-on/Turn-off WoL, further it affects the final consumption, if you do not turn it off unnecessarily - it takes 35mA more in sleep mode.)
In mode with (Disabled RKPM_SLP_PMIC_LP, other options in dts untouched. Also we sleeping one time already.) I got:
Command to sleep or power-off | Power supply | Power | Current |
---|---|---|---|
sudo ethtool -s end1 wol d && sudo systemctl suspend | 12V | 0.81W | 0,068A |
sudo ethtool -s end1 wol g && sudo systemctl suspend | 12V | 0.96W | 0,080A |
sudo shutdown -h now | 12V | 0.60W | 0,050A |
(note that in mode with disabled RKPM_SLP_PMIC_LP wake-up will work via GPIO, RTC, USB (if RKPM_USB_WKUP_EN option is enabled) and WoL (if RKPM_CPU0_WKUP_EN option is enabled). Different combinations of enabling or disabling RKPM_USB_WKUP_EN/RKPM_CPU0_WKUP_EN don’t affect power consumption in sleep mode)
When RTL8852BE arrives, I’ll test if it’s possible to wake up via PCIE - WiFi WoL…