Quad Sata hat and RockPi 4b+ still can't see all four drives

So after trying numerous combinations of images, old/new kernels, reading a great deal of the posts here, I’m stuck at a point where I can get two hard drives to show, and that’s it. I’ve also tried both the usb adapter and two usb a/a cables.

I extracted enough out of the scripts to get it to partially install, but obviously it depends on your board being raspberry. The penta hat scripts do not, but this is a quad sata hat. Is the advertised support for Rockpi4 and quad sata hat nonexistent? Others seem to have this problem.

I have a Raspberry Pi3 that worked with the quad sata hat and I may just go back to that. But the whole reason I got the RockPi4b+ is that it’s supposed to have better I/O performance since there are multiple USB buses for the ports and the ethernet.

At this point I don’t care about the fan speed (always on is fine) or the oled display since it’s in my enclosure. I just want all four drives to connect.

This appears to be someone with the same problem, was the rock pi support never added?

I would really love if it was!

I believe your question is represented in the thread: Raspbian/Ubuntu Server cannot detect JMS561 nor /dev/sd? where @setq indicated a possible future update to software.

The Penta SATA HAT is a PCIE device, rather than a USB3.0 device, so the controller is actually seen and the Linux driver module loaded outside of the SATA HAT service during bootup, before the hat service is loaded. That means that the rockpi software does not need to enable the controller’s on boot.

The QUAD SATA controllers are recognized when the SATA HAT software loads the first time, and sets “pin37(bcm26) sata0, pin22(bcm25) sata1”, to enable the controllers on the HAT. If you are plugging a Quad hat into the rockpi’s 40-pin connector, or powering the hat separately from the rockpi and only using the USB3, I don’t know what signals might be on those pins by default. That could leave you with one, or both controllers disabled.

When the controllers are enabled by the hat service Linux then sees the micron controllers through udev and recognizes the devices behind them if the udev rules have been setup right. There are other threads about that and possible rules changes changes in the past.
.

I toyed with pulling in lib mraa and swapping the raspberry pi dependencies out. Just for the hard drive enabling/disabling. I didn’t mess with the oled or fans yet, as that’s not important

That said, I’m not super familiar with programming GPIO so going is slow.

Also, I’d actually prefer the penta hat but those were put when I looked. Maybe I’ll do both at some point (and put my pi3 back on duty for the quad hat).

I don’t need PCIE performance for these drives though, the USB performance should be fine. It was ok on the RPi3.

I have both a Quad, on a pi 4, and a Penta on a 4b+ and have seen that the Penta is noticeably faster in disk IO through a Raid 5. The physical drives (4 x 2TB Seagates) were the same drives, transplanted, so the IO difference was due either to the Rockpi or the PCIE controllers.

So if you really want the performance you might just want to get the Penta hat board. I suspect, but do not know, that you could use the top-hat from the Quad on the Penta (though you might need a pullup for the switch to work correctly). See: Penta SATA HAT enhanced display (oled, I/O, temp) and operation (button, fan)

Right now I only need one NAS device so I’ll stick to the Quad. At some point I might consider upgrading but considering shortages I haven’t seen the Penta available yet…

Ok, so I fixed up the quad sata drivers locally based partially on the penta sata drivers. I compiled libmraa locally as well, as I couldn’t get it out of the repos that are described on the wiki, but I could be confused.

With my updates to the drivers, the OLED display and fan control work. However, I’m still only seeing 2/4 disks. Also, here’s the end of my dmesg:

[    9.576887] scsi host1: uas
[    9.597398] scsi 1:0:0:0: Direct-Access     JMicron  Tech             8136 PQ: 0 ANSI: 6
[    9.599842] scsi 1:0:0:1: Direct-Access     JMicron  Tech             8136 PQ: 0 ANSI: 6
[    9.603671] sd 1:0:0:0: [sda] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[    9.605211] sd 1:0:0:1: [sdb] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[    9.606600] sd 1:0:0:0: [sda] Write Protect is off
[    9.606626] sd 1:0:0:0: [sda] Mode Sense: 67 00 10 08
[    9.607137] sd 1:0:0:1: [sdb] Write Protect is off
[    9.607161] sd 1:0:0:1: [sdb] Mode Sense: 67 00 10 08
[    9.607277] sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
[    9.607533] xhci-hcd xhci-hcd.9.auto: ERROR Transfer event for disabled endpoint or incorrect stream ring
[    9.608395] xhci-hcd xhci-hcd.9.auto: @00000000697579b0 00000000 00000000 1b000000 01078000
[    9.609463] sd 1:0:0:1: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
[    9.609759] xhci-hcd xhci-hcd.9.auto: ERROR Transfer event for disabled endpoint or incorrect stream ring
[    9.610614] xhci-hcd xhci-hcd.9.auto: @0000000069757a50 00000000 00000000 1b000000 01078000
[    9.731414]  sda: sda1 sda9
[    9.732639]  sdb: sdb1 sdb9
[    9.738973] sd 1:0:0:1: [sdb] Attached SCSI disk
[    9.740655] sd 1:0:0:0: [sda] Attached SCSI disk

Other posts that reference ERROR Transfer event for disabled endpoint or incorrect stream ring indicate a hardware defect. Am I stuck now?

Relevant section of /boot/hw_intfc.conf:

intfc:pwm0=on
intfc:pwm1=on
intfc:uart2=off
intfc:uart4=off
intfc:spi1=off
intfc:spi2=off
intfc:i2c2=off
intfc:i2c6=off
intfc:i2c7=on

Relevant update to misc.py:

def set_mode(pin, mode=1):
    try:
        pin = mraa.Gpio(pin)
        pin.dir(mraa.DIR_OUT)
        pin.write(mode)
    except Exception as ex:
        print(ex)

def disk_turn_on():
    blk1 = get_blk()
    set_mode(37, 1)
    time.sleep(0.5)
    set_mode(22, 1)
    wait_blk(10)
    blk2 = get_blk()
    conf['disk'] = sorted(list(set(blk2) - set(blk1)))


def disk_turn_off():
    set_mode(37, 0)
    time.sleep(0.5)
    set_mode(22, 0)

I can share the rest of my changes if it helps.

I don’t know who needs to see this, but I finally got all four drives to show, OLED to work, fans to work (I think) and maybe even the button on a RockPi 4b+ running ubuntu with the 4.4 rockpi kernel. When I’m done testing everything I will post a github link with the custom drivers that enable all the drives to run.

In case anyone stumbles on this and is curious: the switch underneath the usb hub was in the right position, it needed to be in the left position (for device).

1 Like

Certainly makes sense, and one would never have thought of it working with a Quad HAT.

Hope all remains well.

Me too. Next step is a bigger power supply, these 3.5” drives take 1.7a at load and I miscalculated how much I’d need.

Once I have that I’ll report back on stability and the scripts

Nice that you were able to resolve this. Did you have you have time to report back with the stability and scrips?

I’m interested as I’ve got a Penta & Rock pi4b on the way, my second allnet experiment.

Thanks.