[BPI-R2]mPCIe Slot Pinout with +5v?

I was reading the mPCIe pinout of BPI-R2 and noticed this:

And according to the mPCIe 1.2, pin 48 should be +1.5v instead of +5v, and pin 46 should be output, instead of a +5v input.

I also noticed all +1.5v inputs are NC in the minicard slot (except for 48, which is connected to +5V).

Wondering why the circuit designed like this, and also want to know what is “ePA 5v solution use”.

Thanks.

This is the special circuit of MTK, the 5G part of MT7615. If you use the external PA chip (ePA), you need 5V, but we only use the internal PA (iPA) for the 7615 module, so we not need to use the 5V

I checked the board again and I found:

  • Pin 42, Pin 46, Pin 48 are supplied via R156, which seems NC on the board, and got 0V.
  • Pin 47 and pin 49 are connected via R158. Both of those pins are having +5V voltage.

And I found the Huawei’s define on their datasheet about Pin 47 and 49:

I think I have found out why my 4G module are broken after connected to this port. The R158 was ought to be removed from the board, isn’t it?

1 Like

Damn! That sucks. I think you’re right, @Silver_Bullet . @sinovoip should look into fixing this!

LTE modules generally do not have SIM card holders, but are placed on the motherboard, and R2 mpcie slots do not have USB

you can use this 4G module http://wiki.banana-pi.org/4G_module_via_USB

In regard to this, is there a way to get 5V out of FAN connector? I have a FAN I’d like to use. I already patched the kernel to allow full ZFS boot, and tuned temp thresholds to correctly throttle once the temp gets higher. But I’d like to take an advantage of having 5V for FAN. I can’t use power connectors for SATA, as I do have two SSDs connected. I am using latest Ubuntu 24.04.1 on BPI-R2 with ZFS root. Due to load I intend to use this board for, the CPU tends to run in higher temps, so FAN is required.

But FAN connector has no power. Do I have to turn it on? How?

Fan socket is 5v,but gnd switched by pwm4. So you can regulate voltage by this pwm.

Btw. Not related to mPCIe…

Sorry, I do not understand this. I do love electronics, but I do not understand it well enough to translate what you’re trying to tell me. Does it mean that I have to send 1 to some dev or sys device? Or are you telling me that I have to wire new ground?

Correction: I do understand. Just had to refresh a bit of what I know. OK, weird that it is not mentioned in the spec docs I’ve seen so far. I will check whether and if I can control that pin.

Example for other pwm: en:bpi-r2:gpio [FW-WEB Wiki]

OK, so I thought I got it, but apparently not. Can I ask you for a bit more explanation?

I checked available gpiods, thought that the id 207 would be it, and run: gpioset gpiochip0 207=0 because it was already high. No change. What am I missing?

Got it, thanks!

This is what I needed.

EDIT: I have to be missing something which wasn’t mentioned in that article.

I am running this:

echo 4 >/sys/class/pwm/pwmchip0/export 
echo 200000 >/sys/class/pwm/pwmchip0/pwm4/period 
echo 100000 >/sys/class/pwm/pwmchip0/pwm4/duty_cycle
echo 1 >/sys/class/pwm/pwmchip0/pwm4/enable

And the fan doesn’t spin. Did I misunderstood it?

And yes, I do have that flag compiled in, before you ask.

root@ap-unimatrix:~# grep CONFIG_PWM_MEDIATEK /usr/src/bpi-router-linux-5.15-main/.config
CONFIG_PWM_MEDIATEK=m
root@ap-unimatrix:~# 

That is literally what I did, but with pwm4. And the fan doesn’t spin. Except for GPIO and GPIO debugfs support, PWM_MEDIATEK, do I need anything else enabled in the kernel? I can control LEDs, even athmospheric sensor through GPIO, but I am unable to make the fan spin. If I’ll connect it to 5V DC, it starts spinning, so the fan is OK, as well as its plug (which matches the socked on the board, btw).

Some fans do not work with pwm…you can measure voltage between the pins with different pwm settings

What does that mean? You mean that I should take the power from elsewhere?

As for multimeter, yep, I already have it here, as I wanted to make sure I do get any power out of that fan connector. If I’ll measure something, I’ll order another 2pin PWM fan. This one is just DC fan.

Now I realized - 2pins aren’t enough for PWM. Or I haven’t found single FAN which would have two wires and PWM features. All of them have 3, but usually 4 wires. According to schematics, GPIO pins do provide 5V and GND as well, but I thought of using original connector for the fan.

Just measured it. If I’ll measure voltage between the pins, I do get nothing. But if I’ll take Positive pin (the closest to IR) and take some other ground, like screw plate or metal shielding of USB ports, I do get stable 2.66V

After running bellow:

echo 4 > /sys/class/pwm/pwmchip0/export
echo 10000 > /sys/class/pwm/pwmchip0/pwm4/period
echo 5000 > /sys/class/pwm/pwmchip0/pwm4/duty_cycle
echo normal > /sys/class/pwm/pwmchip0/pwm4/polarity
echo 1 > /sys/class/pwm/pwmchip0/pwm4/enable

I do get negative 5V, meaning it looks like the port has reversed polarity (towards the connector/fan combo)

Then, I took a look to pwm subsystem:

root@ap-unimatrix:/etc# cat /sys/kernel/debug/pwm
platform/11006000.pwm, 5 PWM devices
 pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-1   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-2   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-3   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-4   (sysfs               ): requested enabled period: 10000 ns duty: 5000 ns polarity: normal
root@ap-unimatrix:/etc# 

So it looks like the fan was enabled, but the port has reversed polarity,although it calls it normal. I tried to reverse it, using:

echo inverse > /sys/class/pwm/pwmchip0/pwm4/polarity

But it returned an error of invalid argument. What is the right way to reverse the polarity, so I don’t have to solder the conector?

Anyway, this looks like an error on my side - and on my side only. I’ve ordered two new fans of the same dimensions, and I will play with the solder pen tomorrow, to use better socket/pin header in order to make sure I do have a connection between fan and the socket pins. maybe my fan is faulty to begin with, since I am certain I do get 5V out of the socket now.

Anyway, thanks a lot for tips!

Pwm driver has no support for inversed mode…tried to add it for r3,but did not get this working.not used fan on r2 which was 5 years my main router.

Understood. All my routers are still runing on Ubqt Router Stations, or even Router Station Pro. They are on their own roofs for past 20 years. So I hope that BPI will replace them. Not all of them, on some places I need three wireless cards, so I will check newer BPI boards. But where is RS, BPI-R2 will fit.

That is also why I was so strict to have ZFS - with Router Stations, if you do use USB or SD as a flash overlay, it will last for a year maybe, maybe two, but will ultimately die. And I am tired of replacing cheap usb flash thumb drives multiple times per year (climbing up the ladder in -14°C is also not quite pleasant :wink: )

BPI-R2 has two SATA connectors, somethin UBQT RS could only dream on - even USB is just a pin header on those boards. And even EMMC could get FS corrupted (did the tests, and was successfull to corrupt rootfs just by repeatedly rebooting the host), which won’t happen with ZFS.

So I am mounting /dev/mmcblk1p1 as /boot in ro mode, and everything else is just ZFS. I tested bootfs on ZFS - also works, but then I couldn’t use the same /boot for SD boot, EMMC boot or ZFS boot. And I couldn’t use uEnv.txt from that very zfs bootfs. And I plan to rebuild uBoot with modified bootmenu in a time. With two drives, I hope that board to last years forward. From this perspective, it is a benefit that it is 6 years old - I had relatively minimal issues importing things I need - otherwise the image for the HW is quite mature.

Update: Another day, another fun. So, I’ve destroyed some old GPIO belt cable, just to get two separate pins - and then I’ve soldered the fan, reversing polarity. And - it works. Awesome.

Thanks!