uConsole Power Issue
Due the current uConsole hardware power design, espeically it was designed for CM3 at the time. With the NVMe expansion board installed, the power consumption increases significantly, which may lead to instability issues such as random reboots or failure to boot.
There are a few potential workarounds to mitigate these issues.
Reduce the clock speed of the CM5
This can be done by modifying the boot configuration files to set a lower CPU frequency.
Edit the /boot/firmware/config.txt file and add the following line at the end:
arm_freq=2000
gpu_freq=700
Note that default CM5 CPU frequency is 2200MHz, and CM5 GPU frequency is 750MHz. You can try lower values if stability issues persist. Try to find a balance between performance and stability, then experiment with these values to find the optimal settings for your use case.
Downgrade the NVMe to Gen 2 mode
Edit the /boot/firmware/config.txt file and add the following line at the end:
dtparam=pciex1=on
dtparam=pciex1_gen=2
Configure the NVMe Power State
First, install the nvme-cli tool if you haven’t already:
sudo apt-get install nvme-cli
Then, check what are the Power State available for your NVMe drive. I am using a Raspberry Pi branded NVMe:
➜ sudo nvme id-ctrl /dev/nvme0 -H | grep "operational"
# below is the output:
ps 0 : mp:3.00W operational enlat:100 exlat:600 rrt:0 rrl:0
ps 1 : mp:2.80W operational enlat:150 exlat:700 rrt:1 rrl:1
ps 2 : mp:2.70W operational enlat:200 exlat:1000 rrt:2 rrl:2
ps 3 : mp:0.2100W non-operational enlat:1000 exlat:13000 rrt:3 rrl:3
ps 4 : mp:0.0090W non-operational enlat:2000 exlat:19000 rrt:4 rrl:4
In this case, the NVMe drive has 5 Power States, and the lowest non-operational power state (PS4) consumes only 0.009W, and lowest operational state is PS2 with 2.7W power consumption.
In this case, I can set the NVMe drive to PS2 state to reduce power consumption while still keeping it operational. Use the following command to set the power state:
sudo nvme set-feature /dev/nvme0 -f 2 -v 2
-f 2 indicates that we want to set the Power State feature, and -v 2 indicates that we want to set it to PS2. This means the NVMe drive will not consume more than 2.7W of power, which can help improve stability when using the NVMe expansion board with the uConsole.
This will reset after reboot. Experiment with different power states to find the optmal balance for your use case.
To check the current power state of the NVMe drive, you can use the following command:
sudo nvme get-feature /dev/nvme0 -f 2
To set the power state automatically on boot, you can utlise the udev feature. Create a new rule file in the /etc/udev/rules.d/ directory:
sudo nano /etc/udev/rules.d/99-nvme-power.rules
Add the following content to the file:
ACTION=="add", SUBSYSTEM=="nvme", RUN+="/usr/bin/nvme set-feature /dev/nvme0 -f 2 -v 2"
ACTION=="add" runs when the device is initialized; SUBSYSTEM=="nvme" ensures it only targets NVMe controllers.
finanly reload the udev rules:
sudo udevadm control --reload-rules
sudo udevadm trigger
you can reboot and verify the NVMe drive is set to the desired power state using the get-feature command:
sudo nvme get-feature /dev/nvme0 -f 2