User:Brendlefly62/Radxa x4 N100 sbc with RP2040

From Gentoo Wiki
Jump to:navigation Jump to:search

Construction of this page began 5 March 2025 (Work in Progress)

The Radxa X4 is a small, low power (6 Watt) sbc with a form-factor very similar to raspberry pi 4, but it is based on a quad-core Intel N100 cpu supported by Ami UEFI bios and has a raspberry pi 2040 (pico) microcontroller on-board, to provide control of the sbc's 40 GPIO pins. The board is a few milimeters wider, where the pin-header is mounted, than a Pi 4, so it probably won't fit in a Pi-4 case, but its primary cooling need is for the N100 cpu mounted on the *bottom of the board, so it's probably best to use the cooling solution (doubling as a case) that comes with the board (see photos).

Tip
* Since this is actually an x86_64 "motherboard", despite the tiny size, the install procedure is basically the same as for any other x86_64. Follow the Gentoo Handbook:AMD64. The layout and procedures documented below show how this installation was performed, taking advantage of the "joetoo" ecosystem available to support a wide variaety of sbcs. Mini-PCs excluded, this is the first x86_64 sbc in the joetoo umbrella sbc project.

Overall status: Up and running! See performance section below Several RP2040 example programs validated, other new programs developed; see two of them at Use_the_RP2040_Microcontroller More to follow...

Radxa X4 SBC with M.2 nvme main storage. The case is shown "upside down" here, with the active cooler resting on the desktop, so the board is visible.


Board Specs[1]

Hardware

X4 SBC, shown in image to the right, mounted on cooler, with USB-C power (3A switched Raspberry Pi wall-wart PSU) and micro HDMI cable connected, and USB storage, USB keyboard/mouse dongle inserted. The device is actually shown inverted here, since the N100 cpu is mounted on the bottom of the sbc, and it is affixed to its cooler from "below", so the cooler can vent to open space above the device. For normal operation, the entire unit is turned over, to sit on 4 x rubber feet depicted in this photo. Note also visible in the picture are 128G NVMe M.2 stick, real-time clock battery, and wifi antennae. In this project, the nvme stick holds bootfs and rootfs partitions, with the luks-encrypted rootfs consisting of several lvm lvs unlocked and mounted via custom initramfs that resides with the kernel on the bootfs. The lunks encryption key can be provided by external usb storage device as shown here. Note also that the 40 x GPIO pins are controlled by an on-board Raspberry Pi RP2040 (pico).

Specifications

Make/model Notes
Board Radxa X4(8 GB) https://radxa.com/products/x/x4/
RAM LPDDR5

- Maximum Frequency of 4800 MT/s - 8GB (4GB, 12GB, 16GB options)

Firmware UEFI merican Megatrends International, LLC. version: 5.27 (08/19/2024) Size: 64KiB; capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppynec int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int14serial int17printer int10video acpi usb biosbootspecification uefi


Boot media 128GB nvme stick in M.2 slot for this application (use uefi bios [and in this project, grub] to boot )

SoC

Note
The hardware is tested on kernel version 6.12.16-gentoo as described below
Device Make/model Status kernel drivers Notes
CPU Intel® Processor N100 (Alder Lake-N)
  • Family: 6; Model: 190
  • Total Cores: 4
  • Total Threads: 4
  • Max Turbo Frequency: 3.40 GHz
  • Cache: 6 MB Intel® Smart Cache
  • Intel® Gaussian & Neural Accelerator 3.0
  • Intel® Image Processing Unit 6.0
  • Support for Intel® Virtualization Technology (VT-x)
Works (see lscpu output, under "performance" section below)
GPU Intel® UHD Graphics
  • Graphics Max Dynamic Frequency: 750 MHz
  • DirectX Support: 12.1
  • OpenGL Support: 4.6
  • OpenCL Support: 3.0
Works intel[2]
i915, xe
firmware: i915/tgl_guc_70.bin i915/tgl_huc.bin i915/adlp_dmc.bin i915/adlp_dmc_ver2_16.bin i915/tgl_guc_70.1.1.bin i915/tgl_guc_69.0.3.bin) should auto-load if i915 is a module (m), else they must be built-in with CONFIG_EXTRA_FIRMWARE
NPU Intel® Gaussian & Neural Accelerator 3.0 Not tested
Memory LPDDR5 8GB Works
Storage M.2 nvme slot (2230 only) Works nvme populated with 2230mm 128GB nvme stick
Display Dual Display Outputs via Two Micro HDMI up to 4Kp60 HDMI Works
Audio 1x Headphone Jack with Microphone Input Not tested HDMI audio works; 3.5mm jack not yet tested
Ethernet 1x 2.5G Ethernet Port with PoE Support(Additional PoE HAT Required) Works igc
Wi-Fi, BT module IEEE 802.11 a/b/g/n/ac/ax (WiFi 6) and Bluetooth 5.2 with BLE Works rtw89_8852be
USB USB 3.0 , 2.0
  • 1x USB 2.0 HOST Type A Port
  • 3x USB 3.0 HOST Type A Ports
Works hub
IO Connectivity
  • 1x RTC Battery Socket (comes with)
  • 1x 2-Pin Fan Header
  • 1x 2-Pin Power Input Header
  • 40-Pin Color GPIO Header
  • - Up to 2x SPI
  • - Up to 2x UART
  • - Up to 2x I2C
  • - Up to 16x PWM
  • - Up to 8x PIO(Programmable IO)
  • - 2 x 5V DC power out
  • - 2 x 3.3V power out
Works UART and PWM validated; SPI, I2C not yet tested. libgpiod can be used to put the rp2040 in usb-storage mode, but it is not used to control the board's extermal GPIO pins. That is done with uf2 firware "flashed" to the rp2040 (see using the RP2040, below)

Accessories

  • Active cooler (heatsink/fan) which functions as case (Sold only with SBC board)
  • 3A Power supply (re-used old switched 27W Raspberry Pi USB-C PSU $17.99 at this link, "found lying around")
  • Keyboard, mouse, micro-HDMI cable (re-used Logitech nano receiver w kbd/mouse $34.99 at this link, "found lying around")
  • 2230mm KIOXIA 128GB NVMe SSD stick (reused from old Tinker 2s project, "found lying around")
  • 16GB micro SD card in USB uSD reader ($5.59 at this link, "found lying around")

Pictures

Layout[3]

GCC optimization

Use app-misc/resolve-march-native to identify cflags[4]

FILE /etc/portage/make.confX4 example
COMMON_FLAGS=" -O2 -pipe"
COMMON_FLAGS=${COMMON_FLAGS}" -march=alderlake -mabm -mno-cldemote -mno-hreset -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=6144"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Note
For a hardened system consider appending -fstack-protector-all

Assemble a Working Gentoo System on the Radxa X4 SBC

To assemble a working Gentoo system with minimal effort, consult Assemble_a_Gentoo_System

Use the RP2040 Microcontroller to manipulate GPIO pins

To flash a program to the RP2040 microcontroller, consult Use_the_RP2040_Microcontroller

Performance

lscpu output

root #lscpu

lshw output

root #lshw

Geekbench6 results

System Information
Header text Header text
Operating System Gentoo Linux
Kernel Linux 6.12.16-gentoo-x86_64-n100-joetoo x86_64
Model Default string Default string (Radxa X4)
Motherboard Default string Default string (Radxa X4)
BIOS American Megatrends International, LLC. 5.27
CPU Information
Header text Header text
Name Intel N100
Topology 1 Processor, 4 Cores
Identifier GenuineIntel Family 6 Model 190 Stepping 0
Base Frequency 3.40 GHz
L1 Instruction Cache 64.0 KB x 2
L1 Data Cache 32.0 KB x 2
L2 Cache 2.00 MB
L3 Cache 6.00 MB
Instruction Sets se2 sse3 pclmul fma3 sse41 aesni avx avx2 shani vaes avx-vnni
Memory Information
Header text Header text
Size 7.53 GB
Scores
Header text Header text
Single-Core Score 1215
Multi-Core Score 2972


OpenCL Information
Header text Header text
Platform Vendor Intel(R) Corporation
Platform Name Intel(R) OpenCL Graphics
Device Vendor Intel(R) Corporation
Device Name Intel(R) UHD Graphics
Device Driver Version 24.35 .030872
Maximum Frequency 750 MHz
Compute Units 24
Device Memory 6.62 GB
Graphics performance information
Background Blur 1541 6.38 images/sec
Face Detection 1113 3.63 images/sec
Horizon Detection 4361 135.7 Mpixels/sec
Edge Detection 5452 202.3 Mpixels/sec
Gaussian Blur 2851 124.2 Mpixels/sec
Feature Matching 1068 42.1 Mpixels/sec
Stereo Matching 9874 9.39 Gpixels/sec
Particle Physics 9559

btop views

Pretty high temp and cpu utilization - it may be oscillating in and out of throttling...

X4 compiling the cross-gcc for its RP2040

X4 compiles gcc as part of cross-toolchain for its rp2040 microcontroller

X4 compiling pico-examples for its RP2040

X4 compiles pico-examples (c software) for its rp2040 microcontroller

Temp/Freq Monitoring

joetoo's joetoolkit package has a temp_freq tool --

user $cat /usr/local/sbin/temp_freq


user $watch -n2 temp_freq
temp data:
  thermal_zone 0: 27.80 C; 82.04 F
  thermal_zone 1: 35.00 C; 95.00 F

freq data:
  f_max: 3.40 MHz
  f_min: .70 MHz

  cpu 0: 1.40 MHz
  cpu 1: 1.40 MHz
  cpu 2: 1.40 MHz
  cpu 3: 1.40 MHz

References