Skip to content

๐Ÿš€ Short Manual for Installing & Configuring HIL Test Server on Raspberry Pi

Detailed video instruction can be found here: ๐Ÿ“บ https://www.youtube.com/@MyEmbeddedWay/playlists


1. ๐Ÿงฉ Install Raspberry Pi OS Lite on SD Card

Recommended software for flashing the SD card: https://www.raspberrypi.com/software/


2. ๐Ÿ”„ Update System

sudo apt update && sudo apt upgrade -y

3. ๐Ÿ›  Install Additional Tools

sudo apt install git cmake make gcc g++ libusb-1.0-0-dev pkg-config -y

git clone https://github.com/stlink-org/stlink.git
cd stlink

๐Ÿ— Build from source

sudo make release
sudo make install

๐Ÿ” Update shared-library cache

sudo ldconfig

๐Ÿงช Check version

st-info --version
st-info --probe

5. ๐Ÿ Install pip

sudo apt install python3-pip -y

6. โš™ Install py-micro-hil

sudo pip install py-micro-hil --break-system-packages

โœ” Verify installation

hiltest -h

7. ๐Ÿ’ก Install lighttpd (Web Server)

sudo apt install lighttpd -y

๐Ÿ“Š Check current status

systemctl status lighttpd

โ–ถ Control the service

Start:

sudo systemctl start lighttpd

Stop:

sudo systemctl stop lighttpd

Restart:

sudo systemctl restart lighttpd

๐Ÿ” Check if lighttpd autostarts

systemctl is-enabled lighttpd

โš™ Enable autostart

sudo systemctl enable lighttpd

8. ๐Ÿ“ Fix Web Directory Permissions

sudo chown -R $USER:$USER /var/www/html

9. ๐Ÿ‘ค Add User to Peripheral Access Groups

sudo usermod -aG gpio,i2c,spi,dialout $USER

(Re-login or reboot required.)


10. ๐Ÿ›  Enable Hardware Interfaces

Open Raspberry Pi configuration tool:

sudo raspi-config

Then enable:

  • Interface Options โ†’ SPI โ†’ Enable
  • Interface Options โ†’ I2C โ†’ Enable
  • Interface Options โ†’ Serial Port โ†’ Enable

  • Disable login shell โ†’ Yes

  • Enable serial port hardware โ†’ Yes

11. ๐Ÿ”„ Reboot the System

sudo reboot

๐ŸŽ‰ Your Raspberry Pi HIL test server is now fully configured!