🛠 Configuring Serial I/O and GPIO on EdgeComp MS-U320
Objectives
This tutorial guides you through utilizing the industrial interfaces of the BIOSTAR EdgeComp MS-U320. Unlike standard PCs, this module integrates four serial COM ports (RS232/422/485), essential for IoT connectivity and automation. We will configure a serial port to read sensor data and explore basic peripheral access under Linux. Although the MS-U320 is based on the Intel Wildcat Lake platform, serial port access uses standard drivers, offering significant software flexibility.
Required Materials
- A BIOSTAR EdgeComp MS-U320 module.
- An RS232 serial cable or USB-to-Serial converter for testing.
- A serial-compatible sensor (e.g., industrial temperature sensor) or a terminal emulator (like PuTTY or minicom).
- Ubuntu 24.04 installed on the module.
- An HDMI or DisplayPort screen for console display.
Steps
Open a terminal and identify available serial ports. Under Linux, they typically appear as /dev/ttyS0 to /dev/ttyS3 for internal ports. ``bash ls -l /dev/ttyS* ` Note the active ports. If none appear, check if serial drivers are loaded via dmesg | grep tty`.
- Identify Serial Ports
To communicate with a sensor, configure the baud rate, data bits, parity, and stop bits. Use stty to set these parameters on the chosen port (e.g., ttyS0). ``bash sudo stty -F /dev/ttyS0 9600 cs8 -cstopb -parenb `` This command sets 9600 baud, 8 data bits, 1 stop bit, and even parity.
- Configure Port Parameters
Connect your sensor to the serial port. To read data in real-time, use cat or minicom. Ensure the sensor sends ASCII data. ``bash sudo cat /dev/ttyS0 ` If strange characters appear, adjust the baud rate. For more controlled reading, install minicom: `bash sudo apt install minicom minicom -D /dev/ttyS0 ``
- Read Sensor Data
While serial ports are the highlight, if you use GPIO extensions via M.2 modules or adapters, check access via sysfs or libgpiod. For integrated serial ports, access is direct via /dev/ttySx. Ensure your user is in the dialout group. ``bash sudo usermod -aG dialout $USER `` Restart your session to apply changes.
- GPIO Permission Management (if applicable)
Verification
Run dmesg | tail after connecting the sensor to check for driver errors. Launch minicom and observe received data. If data is unreadable, verify the matching serial parameters (baud rate, parity) between the sensor and the stty configuration. Successful communication displays readable character strings corresponding to sensor measurements.
Going Further
Explore using Python with the pyserial library to automate reading and processing data. You can also configure ports in RS485 (half-duplex) mode for wider industrial networks, using RTS/CTS control lines if your hardware supports it. Test robustness in industrial environments thanks to the MS-U320's -20°C to +50°C temperature range.