Skip to content

AniMB/hardware_in-loop-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardware-in-loop

Hardware in loop allows remote code uploading onto STM32 boards without physical presence near the boards.

Mission

This project uses a Raspberry Pi as a hub to remotely pull code from Git Hub and upload code to the STM32 board. The aim is to facilitate the rapid development of code.

Requirements

  1. An STM32 board When setting up a new project, remember to enable external builder and generate make files automatically in STM32CUBE IDE. You can do this by right-clicking project → Properties → C/C++ Build and checking the two boxes.

(VERY IMPORTANT BUILD WONT WORK ON RPI WITHOUT THIS)

  1. A Raspberry Pi
  2. Github Actions Runner This can be set up by going to the settings -> actions -> runner and setting up a Linux runner. Follow all the commands '''except the last command''' which executes the run.sh shell script.
  3. Libraries
  • Setting up printf and scanf using this website
  • Run this sudo command to ensure your system's package list is up to date:
    sudo apt update
    sudo apt-get update
    
    • Install stlink and its dependencies:
    sudo apt-get install stlink-tools
    
    • Install libtool and its dependencies:
    sudo apt install libtool
    
    • Install the ARM GCC toolchain:
    sudo apt install gcc-arm-none-eabi
    
    • OpenOCD requires jimtcl & other build dependencies on RpiOS, install them first:
      • do sudo nano /etc/apt/sources.list and uncomment the apt-get sources (last three links)
      • run sudo apt-get update
      • now sudo apt-get build-dep openocd
  • Installing OpenOCD using the code below
        git clone git://git.code.sf.net/p/openocd/code
        cd code/
        ./bootstrap
        ./configure
        make
        sudo make install
        cd ..
        rm -rf code/
        sudo nano /etc/udev/rules.d/stlink.rules
    
    Now paste this at the end of the file
    KERNEL=="tty[A-Z]*[0-9]", MODE="0666"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", MODE="0666"
    

Execution

The worklfow on the yaml file starts when a push is made to main. Add the file paths to the YAML file. These file paths are labelled in the env section of the YAML file. To execute this project to the location of the self hosted runner loaction and execute ./run/sh.

Precautions

In case the runner is deleted, please go ahead and reinstall the runner at the same location (which by default shall be actions-runner). To do this, skip the first command (*mkdir.....*) . If you get an error while configuring, execute

ls -a
rm -f .runnner
rm -f config.sh

About

This repo uploads code to a STM32 board from github. It utilises self hosted runners.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages