Hello, I am using a rock 5b with a PWM fan/NVMe and observed some odd behaviour on the hardware side of things. power is provided using a dummy 12 v DC barrel to usb c adaptor
A bit of background: i have a DIY HAT with an FPGA to control a few stepper motor controllers with high precision. It works beautifully with rpi with no problem. below is a pic of it on a RPi4 and a schematic. As you can see, only the gnd, 5v0, 3v3 and the spi bus are connected. The fpga is powered from the 5v0 rail and the 3v3 is used as vcc_io on the stepper motor drivers, i.e. ref voltage for IO logic. The FPGA has an led, which is activated when the control software is loaded, as a way of showing that SPI link is working between the two. the software is loaded with systemd or any other way. all 40 pins are soldered for structural purposes, but as shown in the schematics, they are not traced out.
bottom:
top:
file:///home/rsarwar/Pictures/Screenshots/Screenshot%20from%202023-07-05%2022-25-10.png
Here is the code that does the spi transfers: https://github.com/rsarwar87/CmodA7-SkyTracker/blob/device-CmodA7/koheron-server/context/spi_dev.hpp#L57
Problem 1: when I connect the HAT to the rock 5b with ubuntu_kde_b33, with 5.10.110-11-rockchip, and power it up, the led on the FPGA turns on showing that the SPI link is working. However, any subsequent transaction does not take place. read back is always zero. no data is sent out as well. power cycling the fpga does not change the situation, pulling the FPGA/HAT out and replugging it sometimes restores functionality. but not always. Been scratching my head for a while, before used a snipping tool to cut all pins except 5v0. 3v3, gnd and spi M2 cs0. and suddenly the problem went away. seems like something was disrupting the link, but why, given that it works fine with rpi4? if we know why then i could reengineer the hat to account for this problem
Problem 2: After a shutdown command, the device turns off okay, but the PWM fan speeds up to max power. it only happens when the HAT/FPGA is connected. the FPGA is still drawing power as it is still on and does not support shutdown. Why does this happen?