BananaPi BPI-R3 and m.2-to-SATA convertor

Hi, I have Banana Pi BPI-R3 v.1.1 and I am trying to use it with m.2-to-sata converer board below:

M.2 To SATA 3.0 Riser Card M2 M-KEY PCI-E Expansion Card 5/6 Port SATA3.0 Converter for NVME NGFF To SATA SSD Adapter Card 6Gbps https://www.aliexpress.com/item/1005006160789183.html?spm=a2g0o.order_list.order_list_main.15.531a1802r4Aiuy Chip ASM1166(maybe)

To do so I am trying to compile OpenWRT (branch v24.10.0), although I way far from an expert in the area. I’ve tried also branch v23.05.0, but I was getting some kernel incompatibility errors when I was loading kmod-(s)ata-ahci.

Here is my config file ( config (16.2 KB) ). I created it by combining <OpenWRT (branch v24.10.0)>/target/linux/mediatek/filogic/config-6.6 and diffconfig_mt7986 from this thread (BPi-R3 + OpenWRT: what's the best way to use the rest of my space on my SD card? - #11 by 0xKruzr)

The compilation steps I follow ([OpenWrt Wiki] Build system usage):

cd <path>/openwrt
git checkout v24.10.0
./scripts/feeds update -a
./scripts/feeds install -a
#copy my .config file to <path>/openwrt
make menuconfig
make -j$(nproc) kernel_menuconfig
make -j$(nproc) defconfig download clean world

When Banana Pi BPI-R3 boots with the compiled image, I need to provide power to the sata drives via > 12V/5V XH2.54 connector. To do so I have to set GPIO8, like so:

> cat /sys/class/gpio/gpiochip*/base | head -n1
512
#and sum the base to your GPIO: 512 + 8 = 520
echo "520" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio229/direction
echo "1" > /sys/class/gpio/gpio229/value

I can hear the disk starts rotating now.

But no block device is detected by the system: fdisk -l shows nothing dmesg shows nothing

The most interesting: lspci shows nothing.

Once after installing any modules and packages I came across in discussions in internet, I was able to see /dev/sda. But, again, it was not detected by fdisk and lspci still showed nothing.

Can anyone give me a hand with this? Thank you.

You would need to include the driver for the asm1166 somehow. I donot use openwrt, so cannot help with the specifics…

Best guess: install kmod-ata-ahci

For the pin-header i added an overlay recently to upstream linux,you have to add it in your fit/config.

This is imho already part of openwrt as daniel afair took an older version of my patch. Not sure how they handle it there to get it loaded

frank-w, Eric W - thank you for your resonances.

Today I am with the BPI-R3 again. I abandoned for now the idea to build OpenWRT myself. Now I installed the official image: https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.

I installed kmod-ata-ahci, as suggested. This is the entire list list of packages I have at the moment package_list.txt (2.6 KB)).

Unfortunately these don’t help - the m2-sata convertor board still does not work. On boot its LEDs flash briefly and that’s the only sign of life I get.

lspci still shows nothing.

Here is my lsmod output: lsmod (3.9 KB)

What I see in dmesg is the following (dmesg (25.9 KB) ):

root@OpenWrt:~# dmesg | grep -e pci -e sda
[    0.054084] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[    0.054104] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[    0.054114] mtk-pcie-gen3 11280000.pcie:      MEM 0x0020000000..0x002fffffff -> 0x0020000000
[    0.054222] /soc/pcie@11280000: Failed to get clk index: 0 ret: -517
[    0.054231] mtk-pcie-gen3 11280000.pcie: failed to get clocks
[    5.178127] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[    5.185463] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[    5.191716] mtk-pcie-gen3 11280000.pcie:      MEM 0x0020000000..0x002fffffff -> 0x0020000000
[    5.592134] mtk-pcie-gen3 11280000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x1)
[    5.600940] mtk-pcie-gen3: probe of 11280000.pcie failed with error -110
[   16.492034] sd 0:0:0:0: [sda] Media removed, stopped polling
[   16.497947] sd 0:0:0:0: [sda] Attached SCSI removable disk

It seems the PCIe is not working. But I don’t know how to prove this, as I don’t have nvme device around.

Any other advices?

Thank you.

Try one of mine or Frank’s images. See if lspci shows someting…

Hi,

After last experiments, I think the issue is not in the software(OpenWRT version) but in the hardware. I think I am using incompatible m.2-to-sata convertor.

Today I found one m.2-to-ethernet card like this one: https://www.aliexpress.com/item/1005005176445161.html. Once plugged dmesg seems to recognize it ( pcie_to_ethernet_log (15.7 KB) ). But I forgot to check if lspci shows something.

I will have to find another suitable m.2-to-sata convertor. Once I found such I will write about the result.

Thank you for your time and support.

Here is a report of another sata card recognized:

Hi, I just received this m.2-to-SATA convertor: https://www.aliexpress.com/item/1005006501052620.html?spm=a2g0o.order_list.order_list_main.5.690d1802SOsYWf

It was immediately recognized. Both disks (2.5"), I have installed, are found and running for 30min now.

Now I need to find out how to provide power to them on boot and if I can use them with 5V only.

Thank you for the help.

Great news!

It is however also an ASM1166 card. So the other has something on the pcb that is not compatible. Anyway, good to know that the ASM1166 also works on the R3.

Perhaps you can take a bit more time and help us to complement this:

hardware-compatibility-wiki

Afair only the 3.5in drives need 12v,but you get both voltages on 4pin power jack.you only have to enable it (e.g. via dt overlay).

Do not use gpio pins for powering the drives,it will damage them because current is not enough.