<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://miosix.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Artem.glukhov</id>
	<title>Miosix Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://miosix.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Artem.glukhov"/>
	<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=Special:Contributions/Artem.glukhov"/>
	<updated>2026-05-17T14:37:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=Quick_start&amp;diff=290</id>
		<title>Quick start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=Quick_start&amp;diff=290"/>
		<updated>2020-07-11T10:39:27Z</updated>

		<summary type="html">&lt;p&gt;Artem.glukhov: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To start using Miosix you need a patched version of the GCC compiler called [[Miosix Toolchain]] and git to download the kernel sources. Optionally you can also use an IDE to simplify code development, and an in-circuit debugger to speed up bug fixing.&lt;br /&gt;
&lt;br /&gt;
= Getting started =&lt;br /&gt;
&lt;br /&gt;
This section will guide you through the installation of the minimum requirements to start using Miosix: installing the compiler, and downloading the kernel.&lt;br /&gt;
&lt;br /&gt;
* [[Linux Quick Start|Getting Started on Linux]]&lt;br /&gt;
* [[Windows Quick Start|Getting Started on Windows]]&lt;br /&gt;
* [[MacOS Quick Start|Getting Started on macOS]]&lt;br /&gt;
&lt;br /&gt;
= Miosix and git workflow =&lt;br /&gt;
&lt;br /&gt;
See [[Miosix and git workflow]] to understand how to manage the Miosix git repository.&lt;br /&gt;
&lt;br /&gt;
= Netbeans IDE =&lt;br /&gt;
&lt;br /&gt;
The default IDE to develop for Miosix is [https://netbeans.org/ Netbeans]. However, it does not come with Miosix support out of the box, so you have to configure it first.&lt;br /&gt;
&lt;br /&gt;
* [[Linux Netbeans configuration]]&lt;br /&gt;
* [[Windows Netbeans configuration]]&lt;br /&gt;
* [[OSX Netbeans configuration]]&lt;br /&gt;
&lt;br /&gt;
== In-circuit debugger ==&lt;br /&gt;
&lt;br /&gt;
An in-circuit debugger allows to physically halt the CPU inside a microcontroller, single-step it and view all the variables at any given time. It is a powerful tool to debug software running on a microcontroller. Miosix uses GDB and [http://openocd.sourceforge.net openocd] for in-circuit debugging.&lt;br /&gt;
&lt;br /&gt;
* [[Linux Debugger configuration]]&lt;br /&gt;
* [[Windows Debugger configuration]]&lt;br /&gt;
&lt;br /&gt;
= Other IDEs =&lt;br /&gt;
&lt;br /&gt;
* [[VisualStudio Quick Start|Windows Visual Studio configuration]] using VisualGDB which integrates in-circuit debugging support.&lt;br /&gt;
* [[Linux Eclipse configuration|Eclipse]], which has the added feature to allow in-circuit debugging directly from the IDE.&lt;br /&gt;
* [[Linux QtCreator configuration]]&lt;br /&gt;
* [[Windows QtCreator configuration]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation and Configuration]]&lt;/div&gt;</summary>
		<author><name>Artem.glukhov</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=OSX_Quick_Start&amp;diff=289</id>
		<title>OSX Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=OSX_Quick_Start&amp;diff=289"/>
		<updated>2020-07-11T10:37:54Z</updated>

		<summary type="html">&lt;p&gt;Artem.glukhov: Artem.glukhov moved page OSX Quick Start to MacOS Quick Start: renamed the operating system since 2016&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[MacOS Quick Start]]&lt;/div&gt;</summary>
		<author><name>Artem.glukhov</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=288</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=288"/>
		<updated>2020-07-11T10:37:45Z</updated>

		<summary type="html">&lt;p&gt;Artem.glukhov: Artem.glukhov moved page OSX Quick Start to MacOS Quick Start: renamed the operating system since 2016&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on macOS Catalina 10.15. The Miosix toolchain has been successfully compiled using GCC 9.2.0, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://apps.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode Command Line Tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install the Command Line Tools by running the following command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line Tools were already installed on your system, since the Command Line Tools installation may have been messed up by upgrading to 10.15 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/bin/bash -c &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. Since Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root.&lt;br /&gt;
Also, if you have never opened Xcode before, it will ask you to agree to the license by opening Xcode.app or running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
	sudo xcodebuild -license&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 9.2.0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 9.2.0 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 9.2.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc@9&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 9.2.0 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-9.2 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit $PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 9.2.0 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 9.2.0 (Homebrew GCC 9.2.0_2) &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: LLVM version 11.0.3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install the following dependencies&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make, ncurses, byacc, flex, texinfo, patchutils, unzip, lzip, libelf, perl, expat, wget&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Unfortunately they have to be installed one by one with brew.&lt;br /&gt;
&lt;br /&gt;
GNU make will be installed as gmake, to use it as make, edit the PATH from the bashrc like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
PATH=&amp;quot;/usr/local/opt/make/libexec/gnubin:$PATH&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters. Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To select the development version of the kernel&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout -b testing origin/testing&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that currently, the &#039;&#039;master&#039;&#039; branch contains the stable 2.0 kernel, while the &#039;&#039;testing&#039;&#039; branch contains the current development version. Usually the latter contains the latest updates made, especially support packages for new boards, so its advised to use the code contained in this branch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure to be in a path without spaces, or compiling will fail.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/home/foo/temp                          OK&lt;br /&gt;
/home/foo/directory with spaces/temp    NO!!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
move to the compiler directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you prefer to have the toolchain in a different folder from the kernel tree, move this folder in another directory and then continue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
&lt;br /&gt;
#INSTALL_DIR=/opt/arm-miosix-eabi&lt;br /&gt;
&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc/arm-miosix-eabi&lt;br /&gt;
&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One can decide to install the toolchain globally, in that case uncomment the correct lines and substitute /opt with /usr/local/opt&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh install-script.sh -j&#039;nproc&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
In order to remove temporary and log files run from the terminal:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh cleanup.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script will remove log files and temporary files created during the installation process, but will keep the downloaded files, so that it will be possible to run install-script.sh again without the need for redownloading anything.&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, if you have a brand new board and QSTlink doesn&#039;t work you may take a look at [[ST-LINK utility update|this page]].&lt;/div&gt;</summary>
		<author><name>Artem.glukhov</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=287</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=287"/>
		<updated>2020-07-11T10:36:22Z</updated>

		<summary type="html">&lt;p&gt;Artem.glukhov: Added cleanup script part and&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on macOS Catalina 10.15. The Miosix toolchain has been successfully compiled using GCC 9.2.0, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://apps.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode Command Line Tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install the Command Line Tools by running the following command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line Tools were already installed on your system, since the Command Line Tools installation may have been messed up by upgrading to 10.15 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/bin/bash -c &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. Since Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root.&lt;br /&gt;
Also, if you have never opened Xcode before, it will ask you to agree to the license by opening Xcode.app or running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
	sudo xcodebuild -license&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 9.2.0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 9.2.0 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 9.2.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc@9&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 9.2.0 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-9.2 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit $PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 9.2.0 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 9.2.0 (Homebrew GCC 9.2.0_2) &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: LLVM version 11.0.3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install the following dependencies&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make, ncurses, byacc, flex, texinfo, patchutils, unzip, lzip, libelf, perl, expat, wget&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Unfortunately they have to be installed one by one with brew.&lt;br /&gt;
&lt;br /&gt;
GNU make will be installed as gmake, to use it as make, edit the PATH from the bashrc like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
PATH=&amp;quot;/usr/local/opt/make/libexec/gnubin:$PATH&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters. Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To select the development version of the kernel&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout -b testing origin/testing&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that currently, the &#039;&#039;master&#039;&#039; branch contains the stable 2.0 kernel, while the &#039;&#039;testing&#039;&#039; branch contains the current development version. Usually the latter contains the latest updates made, especially support packages for new boards, so its advised to use the code contained in this branch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure to be in a path without spaces, or compiling will fail.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/home/foo/temp                          OK&lt;br /&gt;
/home/foo/directory with spaces/temp    NO!!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
move to the compiler directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you prefer to have the toolchain in a different folder from the kernel tree, move this folder in another directory and then continue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
&lt;br /&gt;
#INSTALL_DIR=/opt/arm-miosix-eabi&lt;br /&gt;
&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc/arm-miosix-eabi&lt;br /&gt;
&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One can decide to install the toolchain globally, in that case uncomment the correct lines and substitute /opt with /usr/local/opt&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh install-script.sh -j&#039;nproc&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
In order to remove temporary and log files run from the terminal:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh cleanup.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script will remove log files and temporary files created during the installation process, but will keep the downloaded files, so that it will be possible to run install-script.sh again without the need for redownloading anything.&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, if you have a brand new board and QSTlink doesn&#039;t work you may take a look at [[ST-LINK utility update|this page]].&lt;/div&gt;</summary>
		<author><name>Artem.glukhov</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=286</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=286"/>
		<updated>2020-07-11T07:59:28Z</updated>

		<summary type="html">&lt;p&gt;Artem.glukhov: Updated to MacOS 10.15 Catalina, no more support to 32bit binaries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on macOS Catalina 10.15. The Miosix toolchain has been successfully compiled using GCC 9.2.0, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://apps.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode Command Line Tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install the Command Line Tools by running the following command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line Tools were already installed on your system, since the Command Line Tools installation may have been messed up by upgrading to 10.15 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/bin/bash -c &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. Since Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root.&lt;br /&gt;
Also, if you have never opened Xcode before, it will ask you to agree to the license by opening Xcode.app or running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
	sudo xcodebuild -license&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 9.2.0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 9.2.0 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 9.2.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc@9&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 9.2.0 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-9.2 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit $PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 9.2.0 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 9.2.0 (Homebrew GCC 9.2.0_2) &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: LLVM version 11.0.3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install the following dependencies&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make, ncurses, byacc, flex, texinfo, patchutils, unzip, lzip, libelf, perl, expat, wget&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Unfortunately they have to be installed one by one with brew.&lt;br /&gt;
&lt;br /&gt;
GNU make will be installed as gmake, to use it as make, edit the PATH from the bashrc like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
PATH=&amp;quot;/usr/local/opt/make/libexec/gnubin:$PATH&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters. Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To select the development version of the kernel&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout -b testing origin/testing&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that currently, the &#039;&#039;master&#039;&#039; branch contains the stable 2.0 kernel, while the &#039;&#039;testing&#039;&#039; branch contains the current development version. Usually the latter contains the latest updates made, especially support packages for new boards, so its advised to use the code contained in this branch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure to be in a path without spaces, or compiling will fail.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/home/foo/temp                          OK&lt;br /&gt;
/home/foo/directory with spaces/temp    NO!!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
move to the compiler directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
&lt;br /&gt;
#INSTALL_DIR=/opt/arm-miosix-eabi&lt;br /&gt;
&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc/arm-miosix-eabi&lt;br /&gt;
&lt;br /&gt;
SUDO=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh install-script.sh -j&#039;nproc&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc-9.2.0-mp3.1/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, if you have a brand new board and QSTlink doesn&#039;t work you may take a look at [[ST-LINK utility update|this page]].&lt;/div&gt;</summary>
		<author><name>Artem.glukhov</name></author>
	</entry>
</feed>