Radxa M.2 E key to SATA breakout card on Armbian. HDD is not visible. [UNRESOLVED]

I have looked into the Radxa rock5b KDE image, it uses kernel 6.1.43-15-rk2312 and there is only 1 sata overlay:

/usr/lib/linux-image-6.1.43-15-rk2312/rockchip/overlays# ls -al rock-5b*sata*
-rw-r--r-- 1 root root 829 Aug  8  2024 rock-5b-sata.dtbo

For a latest updated armbian bookworm:

/usr/lib/linux-image-6.1.99-vendor-rk35xx/rockchip/overlay# ls -al rock-5b*sata*
-rw-r--r-- 1 root root 829 Feb 17 14:54 rock-5b-sata.dtbo

Although different timestamp, they are binary the same.

So I don’t know what is meant with ‘sata2’; it is not there. It is there for rock3a (in Radxa overlays), in Armbian overlays there is also only 1. In Radxa overlays it looks like you can also turn the USB3 ports into sata it seems, but I guess no-one will do that.

I could only get both NVMe and SATA on my Rock-3A working if I use older 2017.9 dated U-Boot and 6.1.99 kernel. I would hope/expect that the same will work on Rock5b as otherwise it makes not really sense to buy it in order to have a faster variant of the Rock3a.

So maybe check the U-Boot variant the board is started with, maybe SPI contains other version than on SD card image (or EMMC?).

The sata messages look similar for my rock3a, but also the HDD is detected. Maybe check power, cables etc:

root@rock3a:~# dmesg | grep -e sata -e ata1
[   13.818506] ahci-dwc fc800000.sata: Looking up ahci-supply from device tree
[   13.818556] ahci-dwc fc800000.sata: Looking up ahci-supply property in node /sata@fc800000 failed
[   13.818661] ahci-dwc fc800000.sata: supply ahci not found, using dummy regulator
[   13.819439] ahci-dwc fc800000.sata: Looking up phy-supply from device tree
[   13.819491] ahci-dwc fc800000.sata: Looking up phy-supply property in node /sata@fc800000 failed
[   13.819590] ahci-dwc fc800000.sata: supply phy not found, using dummy regulator
[   13.820073] ahci-dwc fc800000.sata: Looking up target-supply from device tree
[   13.820114] ahci-dwc fc800000.sata: Looking up target-supply property in node /sata@fc800000 failed
[   13.820206] ahci-dwc fc800000.sata: supply target not found, using dummy regulator
[   13.820662] ahci-dwc fc800000.sata: PMPn is limited up to 5 ports
[   13.821189] ahci-dwc fc800000.sata: forcing port_map 0x0 -> 0x1
[   13.821301] ahci-dwc fc800000.sata: AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl platform mode
[   13.821322] ahci-dwc fc800000.sata: flags: ncq sntf pm led clo only pmp fbs pio slum part ccc apst  
[   13.821365] ahci-dwc fc800000.sata: port 0 is not capable of FBS
[   13.854652] ata1: SATA max UDMA/133 mmio [mem 0xfc800000-0xfc800fff] port 0x100 irq 123
[   14.326426] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[   14.327966] ata1.00: ATA-9: ST8000AS0002-1NA17Z, AR13, max UDMA/133
[   14.328007] ata1.00: 15628053168 sectors, multi 0: LBA48 NCQ (depth 32)
[   14.329337] ata1.00: configured for UDMA/133

Yes - it’s identical except irq and link status.
Does it mean that programmatically it is correct?

I’s using external power from my PC’s PSU and literally the same sata cable from the same PC, that I have used to ensure that disk itself is working.

Could it be because powers sources for board and HDD are different? Any other ideas?

Sorry, I have no idea what is U-boot? Is it some other image?

sata module base address and irq is indeed different, but that should not matter (it is also different SBC and kernel).
You now show more info and if it says ‘SATA link down’, it could mean something electrical or timing.
I have had HDD and rock3a powered separately, so each there own 230V mains PSU, meaning only SATA cable is the electrical link and that worked. But that same Seagate 8TB SMR HDD sometimes refused to be detected in Intel J1900 board and currently also on AMD E350 it does not work reliably anymore. I also once thought the SATA cable was the problem, changed it, then it worked. But it also means complete power disconnect, so that could be the reason it worked atfer cable switch. So I thought lets try ARM SBC to operate those large HDDs.

U-Boot is the bootloader, it is loaded first by the Rockchip RK35xx SoC from the area on the SD-card location between partition table and first partition. It in turn loads the linux kernel. There are combinations of U-Boot variant and kernel variant that fail to get a correctly working NVMe+SATA. But U-Boot is specific per SBC, so it can setup things differently per board. That is why I ask for what version you run/have. You need a serial console cable to see it actually working when board is powered on. Make sure you have such a cable. Or make sure you understand how a Rock5b boots; See Radxa documentation;
I checked:

~# dd if=Armbian_24.11.3_Rock-5b_bookworm_vendor_6.1.84_minimal.img count=32k of=imgheaddump
16777216 bytes (17 MB, 16 MiB) copied, 0.231042 s, 72.6 MB/s
~# strings imgheaddump | grep "U-Boot SPL"
U-Boot SPL board init
U-Boot SPL 2017.09-armbian-2017.09-S2284-Pe069-H331a-Vec5e-Bb703-R448a (Jan 07 2025 - 09:55:23)

But I think software / programmatically is OK for your setup, I am not sure about the cabling. Maybe try a SATA SSD instead of SATA HDD. I might be a timing issue, the HDD may not initialize fast enough, I don’t know.

Hello,
Thanks for creating fresh topic, this i way easier to navigate and talk about specific version in right context,

As @Eric_Woudstra mentioned - 5A and 5B are different boards and SoCs on them, so they need may need specific dtbs for similar features.

Here it’s the one I talked about:


I needed to test my sata card, checked it on ROCK 3A, 3B, 5A and 5B. Only last one worked with same ssd, m.2 card and sata cable. I’m sure this worked on 5.x kernel before. Some workaround is to use any m.2 A+E pcie to sata adapter (one or two port) - its about the speed of native sata, or just use A+E to M adapter and some 2230 nvme (this don’t require any additional power line, it’s fast, but this one needs right adapter to fit in this slot).

Hello,

Hm, it looks really close to 5A one, tried it. Unfortunately, result is the same for now.

Yeah - I ordered ASM1166 as I planned from the beginning, will continue with it.
I ordered radxa adapter first with hope, that it will just work, so I’ll be able to test whole system with minimal hardware. It was a mistake.

Thank you all.

As I mentioned earlier - none of them worked for me on 3A,3B,5A on kernel >5.1
It worked perfectly with radxa image 5.1, I guess that something is wrong about new kernel/dtb for sata,
dtb brings up SATA link but it’s not stable,

Reconsider this choice,
If we are talking about A+E slot on all of those boards (3A,3B,5A,5B) we have there 1x pcie 2.1
native sata card would be about the same speed as downgraded (to 1x pcie 2) nvme.
additionally nvme don’t need separate power, but You need cheap, non active adapter A+E => M (and this is not easy, most of them will not fit)
ASM1166 in such slot is limited to 25% of its bandwidth. You will get 6 ports but only one at time will be able to work at about full speed. This still can be usable, especially for older hdds, but ssds will be quickly limited. ASM1166 can handle up to four sata devices at full speed (on 2x pcie 3.0)

So… if we are still taking about A+E slot - just get any cheap jmb582 a+e card:

with 5A:

  • You don’t need any extender and adapter, fits perfectly
  • will work for one drive about the same as native sata card, second sata port is plus (will be limited, but someday You can plug card into newer SBC to get full speed)
  • cheaper than ASM1166

Thank you for the explanation.
Did I understand correctly that in full-size M2 on the back of Rock5b ASM1166 should work fine? I don’t really need super-speed I just need relatively big storage.

Also, You have mentioned this jmb582 for smaller port. If I use 1 ssd with it would be full speed? (Sure, if it works at all)

Yes because ASM1166 uses 2x pcie 3.0, Rock 5B has 4x pcie 3.0 so m.2 will not limit the card,
You can even run two such card using bifurcation adapter, both will link at 2x/3.0, 5B+ has two m.2 ports like this,
As far as I remember tests 3x sata drives on this card work at full speed (560MB/s), 4x are slightly limited (about 500MB/s) and for 6x speed is 300-400MB/s. Not bad, but obviously 6x is more than 2x/3.0. Usually it’s not any real problem.

Yes, sata ssd can reach about 550MB/s,
I got about same ~510/s for nvme, ssd via asm and ssd via sata breakout board.
Of course same nvme could do much more in bottom slot :slight_smile:

The ‘sata2’ is referring to the mainline armbian kernel, so latest I have installed is 6.13.4. For mainline rockchip64, there are:
rockchip-rk3566-sata2.dtbo
rockchip-rk3588-sata1.dtbo
rockchip-rk3588-sata2.dtbo

Comparing with rock-5b-sata.dtbo which is there in vendor kernel 6.1.99 confuses me a bit; I see there is
pcie2x1l0 and pcie2x1l1
What is on which connector I am not sure/don’t know; Comparing the decompiled:

~# diff -y --color rock-5b-sata.dtso  rockchip-rk3588-sata2.dtso
/dts-v1/;                                                       /dts-v1/;

/ {                                                             / {

        metadata {                                            <
                title = "Enable SATA1";                       <
                compatible = "radxa,rock-5b";                 <
                category = "misc";                            <
                description = "Enable SATA1.\nWhen SATA1 is e <
        };                                                    <
                                                              <
        fragment@0 {                                                    fragment@0 {
                target = <0xffffffff>;                                          target = <0xffffffff>;

                __overlay__ {                                                   __overlay__ {
                        status = "disabled";                                            status = "disabled";
                };                                                              };
        };                                                              };

        fragment@1 {                                                    fragment@1 {
                target = <0xffffffff>;                                          target = <0xffffffff>;

                __overlay__ {                                                   __overlay__ {
                        status = "disabled";                  <
                };                                            <
        };                                                    <
                                                              <
        fragment@2 {                                          <
                target = <0xffffffff>;                        <
                                                              <
                __overlay__ {                                 <
                        status = "disabled";                  <
                };                                            <
        };                                                    <
                                                              <
        fragment@3 {                                          <
                target = <0xffffffff>;                        <
                                                              <
                __overlay__ {                                 <
                        status = "okay";                                                status = "okay";
                };                                                              };
        };                                                              };

        __fixups__ {                                                    __fixups__ {
                wifi_disable = "/fragment@0:target:0";        |                 pcie2x1l1 = "/fragment@0:target:0";
                bt_wake = "/fragment@1:target:0";             |                 sata2 = "/fragment@1:target:0";
                pcie2x1l0 = "/fragment@2:target:0";           <
                sata1 = "/fragment@3:target:0";               <
        };                                                              };
};                                                              };

This seems to be different, would not work; instead:

~# diff -y --color rock-5b-sata.dtso  rockchip-rk3588-sata1.dtso
/dts-v1/;                                                       /dts-v1/;

/ {                                                             / {

        metadata {                                            <
                title = "Enable SATA1";                       <
                compatible = "radxa,rock-5b";                 <
                category = "misc";                            <
                description = "Enable SATA1.\nWhen SATA1 is e <
        };                                                    <
                                                              <
        fragment@0 {                                                    fragment@0 {
                target = <0xffffffff>;                                          target = <0xffffffff>;

                __overlay__ {                                                   __overlay__ {
                        status = "disabled";                                            status = "disabled";
                };                                                              };
        };                                                              };

        fragment@1 {                                                    fragment@1 {
                target = <0xffffffff>;                                          target = <0xffffffff>;

                __overlay__ {                                                   __overlay__ {
                        status = "disabled";                  <
                };                                            <
        };                                                    <
                                                              <
        fragment@2 {                                          <
                target = <0xffffffff>;                        <
                                                              <
                __overlay__ {                                 <
                        status = "disabled";                  <
                };                                            <
        };                                                    <
                                                              <
        fragment@3 {                                          <
                target = <0xffffffff>;                        <
                                                              <
                __overlay__ {                                 <
                        status = "okay";                                                status = "okay";
                };                                                              };
        };                                                              };

        __fixups__ {                                                    __fixups__ {
                wifi_disable = "/fragment@0:target:0";        |                 pcie2x1l0 = "/fragment@0:target:0";
                bt_wake = "/fragment@1:target:0";             |                 sata1 = "/fragment@1:target:0";
                pcie2x1l0 = "/fragment@2:target:0";           <
                sata1 = "/fragment@3:target:0";               <
        };                                                              };
};                                                              };

This seems to match, so ‘sata1’ is enabled on ‘pcie2x1l0’
Or l0 l1 are also changed order in the main dts from vendor to mainline?

Now I don’t have Rock5B, but this might give me some hints for my Rock3A. The M.2 E-key slot is PCIe2x1, in the .dtso file I see ‘pcie2x1’. I looks like I have to compare main .dts and SoCs RK3568 and RK3588.

Another piece of info, from schematics https://dl.radxa.com/rock5/5b/docs/hw/radxa_rock_5b_v1423_sch.pdf

image

So on the M.2 E key the sata number is 1
Number 0 would disable RJ45, number 2 would disable USB if I understand correctly.

I think I do not understand something, because if this ^ true, network should be down when I turned on this overlay:

	fragment@2 {
		target = <&pcie2x1l0>;

		__overlay__ {
			status = "disabled";
		};
	};

But it did not.

I think I need to try with single power source when it arrive. And probably disassemble old laptop to scavenge some sata ssd.
Also, I tried 2,5" hdd from the same laptop and it did not even spin with external power, I’m starting to think that they are selling special sata cable with 5v power sourced from 40pin connection for a reason.

Are we talking about 5B or 3A?

About the 5B. But I have no 5B (yet) and have a SATA overlay working on 3A, with kernels: Radxa 5.10.160, Armbian vendor 6.1.99, Armbian current 6.12.x, Armbian edge 6.13.x (all with Linux boot+root from SD-card).

So I am interested in this getting to know that at least (a) SATA overlay works with 5B.

I think @ElRato likely has some power issue. I have seen and had a lot of troubles with my Rock3A getting it to work initially. Now U-Boot 2017.09 + kernel 6.1.99 + single source 12V 10A PSU I transferred 2TB of data to the system, with NVMe in M.2 M-key and HDD on M.2 E-key Radxa breakout (in complex caching setup). So I am trying to figure out if the same would be possible on 5B?

Ok, so I recently tried it with Armbian edge 6.13.x and worked with no issues. I could not make it to work on 3B and 5A, same stuff just different SBC. I’ll try with 3A, I’m quite sure that it was not working, it bring up sata, but was not stable on anything >5.1.

Those usually don’t come up on init and cause sbc reboot. For me there is something about dtb/kernel. I confirmed that same setup (ssd, sata card, ac adapter) work on 5B but not on 5A which should need less energy.

So, my 1166 had arrived. And working without any shenanigans on operation system or hardware. Separate power working fine as well.

But there is a note about this product itself. It contradict Euclidian geometry and can not be screwed correctly because of it’s thickness. It rests on some rock board element and plastic stand of radxa fan. I’d call it design flaws from radxa.

There is some sort of isolation screwed to the 1166 and I probably can slightly modify it with rasp, but I have no idea what to do with the fan stand anyway.

Use some insulation tape for this non-Euclidean part

Yep, I’ll definitely do this :slightly_smiling_face:
Main trouble right now - I’ll bend it if screw it properly. Will need to make it Euclidean first.

This is easy to solve :slight_smile:
I just replaced plastics clips for long plastic screws on same spring, some of those:
image

Touching inductor should not be a problem, still You can just remove bottom plate, board will be much more flexible and easier to damage, but this wont happen if You don’t plug/unplug sata ports while card is in m.2 slot.

I ordered a ‘blue ROCK5B’ on aliexpress but got a ‘green’ one. Also ordered a E-key breakout board, again a different one then the picture showed, but it fits on the ROCK5B without cracking the solder on the connector needed for ROCK3A.

Also ordered a ASM1166, same as written earlier in this topic, it touches PCB components on the ROCK5B, but ‘it works’. I removed 1 metal screw that holds the plastic isolate plate, so it also did work in my NanoPi-R6C without risk of shortcutting PCB components below. I might use it permanently with my ROCK3A sometime in future, but needs a custom case design, which currently is a piece of wood to hold the M.2 M-key NVMe in its place (it is my NAS currently).
The ROCK3A only works with Raxda U-Boot + vendor kernel + vendor sata_overlay (Armbian build), that will become a problem as the Rockchip 6.1 SDK based kernel has some stability issues (and is getting ‘old’) although no fatal crash until now, but that is because already complicated mitigations I did.

Back on topic, the ROCK5B + breakout board works as expected and has a 3 software/firmware/OS stacks working, tested all 3, meaning I can use the ROCK5B with NVMe SSD in M-Key and SATA HDD in E-key simultaneously.

  • vendor U-Boot + vendor kernel + vendor sata_overlay (all Armbian build)
  • mainline (edge) U-Boot + mainline kernel + mainline sata_overlay (all Armbian build)
  • EDK2_UEFI 1.1 with SATA ‘1’ enabled in settings + mainline kernel (armbian build kernel, up to 6.15.0-rc1)

I already forgot I wrote the schematics analysis here, but it is correct and verified now. The (mainline) overlay needed for the breakout board is the generic RK3588 sata1 one, the sata2 also shows a AHCI port in dmesg, but HDD does not work, because that should turn the USB3 port(s?)/connector(s?) into SATA. A sata0 is not there as overlay, similar is greyed-out in EDK2_UEFI as it is the PHY for the PCIe 2.5GbE ethernet controller.

So I am glad this E-Key slot is usable as I guessed/hoped/thought. Pity that I need to drill a hole in the Radxa ROCK5B aluminum case for the SATA cable, but that is easier than maybe solder a USB3-SATA cable (see my other topic SATA on Rock5B via M.2 E-key_board or USB3_connector). And my ROCK3A system/NAS can now be replaced by ROCK5B (when I want).

1 Like