In this post, all the pre-installed software packages mentioned (such as gcc, python3, make, i2c-tools, etc.) are carefully compiled and optimized by the DeepComputing team to fit the RISC-V architecture platform (e.g., Ubuntu Noble for RISC-V). These tools not only provide a stable foundation for development but are also deeply tuned for performance and compatibility, ensuring smooth operation across embedded, edge computing, and desktop application scenarios.
DeepComputing focuses on building and advancing the open-source software/hardware ecosystem, committed to providing developers with efficient, user-friendly, and customizable RISC-V development environments. The demonstrations shown here are all performed in this optimized system environment, aiming to help developers better understand system configuration and application development on RISC-V platforms.

#System pre-installed tools (python, gcc, make, i2c-tools...)
$ apt update
$ apt install i2c-tools net-tools wget curl iw pciutils gpiod -y
$ apt install make python3 -y
Code language: PHP (php)

$ roma@roma ~> apt-cache policy gcc python3 make
gcc:
Installed: 4:13.2.0-7ubuntu1
Candidate: 4:13.2.0-7ubuntu1
Version table:
*** 4:13.2.0-7ubuntu1 500
500 http://ports.ubuntu.com/ubuntu-ports noble/main riscv64 Packages
100 /var/lib/dpkg/status
python3:
Installed: 3.12.3-0ubuntu2
Candidate: 3.12.3-0ubuntu2
Version table:
*** 3.12.3-0ubuntu2 500
500 http://ports.ubuntu.com/ubuntu-ports noble-updates/main riscv64 Packages
100 /var/lib/dpkg/status
3.12.3-0ubuntu1 500
500 http://ports.ubuntu.com/ubuntu-ports noble/main riscv64 Packages
make:
Installed: 4.3-4.1build2
Candidate: 4.3-4.1build2
Version table:
*** 4.3-4.1build2 500
500 http://ports.ubuntu.com/ubuntu-ports noble/main riscv64 Packages
100 /var/lib/dpkg/status
Code language: JavaScript (javascript)
i2c-tools is an open-source command-line toolkit for Linux systems used to debug and manage I²C/SMBus (Inter-Integrated Circuit) devices. It directly accesses hardware through /dev/i2c-* interfaces without relying on specific device drivers, making it essential for embedded development, hardware debugging, and system maintenance.
| Tool Name | Function Description | Typical Use Case |
|---|---|---|
| i2cdetect | Scan device addresses on the I²C bus | Detect devices connected to the bus (display addresses from 0x03 to 0x77) |
| i2cget | Read the value of a specified register from an I²C device | Retrieve sensor data / check configuration register status |
| i2cset | Write data to a register of an I²C device | Configure device parameters (e.g., change resolution or mode) |
| i2cdump | Export the values of all registers from a device | Perform a full register map analysis |
| i2ctransfer | Send custom I²C message sequences (supports compound operations) | Test special communication protocols (e.g., multi-byte transfers) |
Example
# List all I²C buses
$ roma@roma ~> sudo i2cdetect -l
i2c-0 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-1 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-2 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-3 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-4 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-5 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-6 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-7 i2c DesignWare HDMI I2C adapter
i2c-8 i2c DesignWare HDMI I2C adapter
# Scan devices on bus 0
$ roma@roma ~> sudo i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
# Scan devices on bus 2
$ roma@roma ~> sudo i2cdetect -y 2
Warning: Can't use SMBus Quick Write command, will skip some addresses
0 1 2 3 4 5 6 7 8 9 a b c d e f
00:
10:
20:
30: -- -- -- 33 -- -- -- --
40:
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60:
70:
# Dump all register values from device 0x33 on bus 2
$ roma@roma ~> sudo i2cdump -y 2 0x33
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 00 00 00 00 00 00 00 00 01 00 00 00 1c 18 ..........?...??
10: 74 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 t?..............
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 41 02 00 00 00 00 b2 f2 00 00 00 00 10 01 00 06 A?....??....??.?
80: 00 00 00 00 00 00 00 00 00 00 01 00 00 00 1c 18 ..........?...??
90: 74 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 t?..............
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 41 02 00 00 00 00 b2 f2 00 00 00 00 10 01 00 06 A?....??....??.?Code language: Shell Session (shell)
Install Dependencies:
#Install the dependency packages required for Python
$ sudo apt install python3-psutil
$ sudo apt install python3-richCode language: Shell Session (shell)
Python Source Code:
import psutil
import time
from rich.console import Console
from rich.panel import Panel
from datetime import datetime
console = Console()
# Emoji mapping
EMOJIS = {
"cold": "❄️",
"normal": "🙂",
"warm": "🔥",
"hot": "🥵"
}
# Status faces with English text
STATUS_FACES = {
"cold": " (¬_¬)zZ Calming down...",
"normal": " (•̀ᴗ•́)و Normal temperature",
"warm": " (sweating) Getting warm!",
"hot": " (°Д°) Too hot! Shutdown now!"
}
def get_riscv_temperature():
"""RISC-V CPU temperature detection function"""
sensors = psutil.sensors_temperatures()
priority_list = ['pvt', 'dummy_pvt', 'soc_thermal', 'cpu_thermal', 'cros_ec', 'tmp102']
for sensor_name in priority_list:
if sensor_name in sensors:
return sensors[sensor_name][0].current
for name, entries in sensors.items():
if "temp" in name or "thermal" in name:
return entries[0].current
return None
def classify_temperature(temp):
"""Classify temperature status"""
if temp < 30:
return "cold"
elif 30 <= temp < 50:
return "normal"
elif 50 <= temp < 70:
return "warm"
else:
return "hot"
def display_temperature(temp):
status = classify_temperature(temp)
emoji = EMOJIS[status]
face = STATUS_FACES[status]
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
console.clear()
panel = Panel(
f"[bold cyan]RISC-V CPU Temperature Monitor[/bold cyan]\n\n"
f"🌡️ Current Temperature: {temp:.2f}°C\n"
f"🕒 Timestamp: {now}\n\n"
f"{emoji} {face}\n",
expand=False,
border_style="blue"
)
console.print(panel)
if __name__ == "__main__":
console.print("[bold green]Starting RISC-V system temperature monitoring...[/bold green]\n")
try:
while True:
temp = get_riscv_temperature()
if temp is not None:
display_temperature(temp)
else:
console.print("[red]❌ Failed to get temperature. Please check sensor driver.[/red]")
time.sleep(5)
except KeyboardInterrupt:
console.print("\n[green]✅ Monitoring manually terminated. Thank you for using![/green]")Code language: Python (python)
Example Output:
$ python3 riscv_coretemp.py
Starting RISC-V system temperature monitoring...
╭─────────────────────────────────────╮
│ RISC-V CPU Temperature Monitor │
│ │
│ 🌡️ Current Temperature: 64.53°C │
│ 🕒 Timestamp: 2025-08-08 10:28:50 │
│ │
│ 🔥 (sweating) Getting warm! │
│ │
╰─────────────────────────────────────╯
╭─────────────────────────────────────╮
│ RISC-V CPU Temperature Monitor │
│ │
│ 🌡️ Current Temperature: 64.94°C │
│ 🕒 Timestamp: 2025-08-08 10:28:55 │
│ │
│ 🔥 (sweating) Getting warm! │
│ │
╰─────────────────────────────────────╯
╭─────────────────────────────────────╮
│ RISC-V CPU Temperature Monitor │
│ │
│ 🌡️ Current Temperature: 64.53°C │
│ 🕒 Timestamp: 2025-08-08 10:29:00 │
│ │
│ 🔥 (sweating) Getting warm! │
│ │
╰─────────────────────────────────────╯
╭─────────────────────────────────────╮
│ RISC-V CPU Temperature Monitor │
│ │
│ 🌡️ Current Temperature: 65.15°C │
│ 🕒 Timestamp: 2025-08-08 10:29:05 │
│ │
│ 🔥 (sweating) Getting warm! │
│ │
╰─────────────────────────────────────╯
^C
✅ Monitoring manually terminated. Thank you for using!Code language: Python (python)
