Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Mihini/Cross Compilation
This page will help you through the process of building your Mihini's installation on your fast and powerful desktop computer for your embbeded architecture.
Contents
Raspbian (RaspberryPi & Debian)
The main files for this platform are already available, so that you will be able to get started quickly ; or it may be used as an example for the others platforms.
Step 1: Get the prerequisites
On a Debian-based system, you will need to:$ sudo apt-get install build-essential cmake git telnet
Step 2: get the toolchain
We are going to use the Linaro toolchain, from the official raspberrypi repository:$ cd $ git clone https://github.com/raspberrypi/tools.git
Step 3: get Mihini
Get the sources$ git clone https://github.com/nim65s/mihini-repo.git
$ cd mihini-repo $ sed -i "s/gsaurel/$(whoami)/" cmake/toolchain.raspberrypi-linaro.cmake
Step 4: build and make
To finish, let's build it:$ ./bin/build.sh -t raspberrypi-linaro $ cd build.raspberrypi-linaro $ make lua luac # Optional, if you want to use Modbus over serial (e.g. to run the Greenhouse sample) $ make modbus_serial $ make package
And Voilà, you have a .deb
or a .tar.gz
ready to be installed on your RPi !
Step 5: use it
If you are not sure of what to do with this .deb
, you can go to the Install Mihini page, skipping the first shell command which downloads a similar .deb
.
Then, you can go back to the main tutorial: Run Mihini on an Open Hardware platform
Configuring your own toolchain
The target you specify to build.sh
(which was «raspberrypi-linaro» in the example above) is used to select the toolchain. You will probably need to copy/paste an existing configuration in cmake/
, naming it toolchain.<your target's name>.cmake
, and changing the lines
SET(CMAKE_C_COMPILER /path/to/gcc) SET(CMAKE_CXX_COMPILER /path/to/g++)
Then, you shall also look at the folder porting/
, where you can make a new directory with the name of your target.