|
|
# Windows setup guide
|
|
|
|
|
|
The following guide explains how to setup your computer with all the necessary tools required to develop software for the embedded systems used in Skyward.
|
|
|
|
|
|
To setup the development environment on Windows you will need the following components:
|
|
|
|
|
|
* [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install)
|
|
|
* [ST-Link Utility](https://www.st.com/en/development-tools/stsw-link004.html)
|
|
|
* [Visual Studio Code](https://code.visualstudio.com/)
|
|
|
|
|
|
<span dir="">Windows Subsystem for Linux is a compatibility layer built by Microsoft for running Linux executables natively on Windows</span>. In simplier terms, WSL is a sort of virtual machine. With WSL you can install different Linux distributions and access then through command line interface. Since the Skyward Build System is developd on Unix, WSL is need to compile the code easily.
|
|
|
|
|
|
Vistual Studio Code is a source code editor which features a lot of useful plugins, including one to interface the editor directly to WSL. With the `Remote - WSL` extension you will be able to access files and folders directly inside the Linux environment.
|
|
|
|
|
|
## Windows Subsystem for Linux
|
|
|
|
|
|
To install Windows Subsystem for Linux follow this steps (you can find than on [docs.microsoft.com](https://docs.microsoft.com/en-us/windows/wsl/install)):
|
|
|
|
|
|
* Open an administrator PowerShell by searching "PowerShell" in the Windows's search bar, pressing right click and selecting "Run as Administrator"
|
|
|
* Run <span dir="">`wsl --install`</span> to install
|
|
|
|
|
|
After the installation has finished, search Ubuntu in the Windows's search bar and open it. The setup of Ubuntu should start and you will be asked to provide a username and a password (remember the password!). When Ubuntu is ready you need to install the Miosix compioler and some other packages used by the build system.
|
|
|
|
|
|
To install the Miosix compiler ([here](https://miosix.org/wiki/index.php?title=Linux_Quick_Start) you can find more info) and the other packages just run the following commands:
|
|
|
|
|
|
```shell
|
|
|
wget https://miosix.org/toolchain/MiosixToolchainInstaller.run
|
|
|
sh MiosixToolchainInstaller.run
|
|
|
sudo apt install make cmake ninja-build ccache cppcheck clang-format clang-tidy -y
|
|
|
```
|
|
|
|
|
|
After this packages are installed, WSL is setup.
|
|
|
|
|
|
## ST-Link Utility
|
|
|
|
|
|
To program an STM32 microcontroller you need an ST-Link programmer which interfaces the mcu to your pc and flashes the firmware on to the chip. To allow your computer to talk to the programmer, you need the ST-Link Utility. You can download it from [here](https://drive.google.com/file/d/10yJGrLDT0ujadVVMXsAQOtWV4gvPzP5l/view?usp=sharing) or from [st.com](http://st.com). Then you just need to extract the folder and execute `setup.exe`.
|
|
|
|
|
|
## Visual Studio Code
|
|
|
|
|
|
If you don't have it already, just download VS-Code from [code.visualstudio.com](http://code.visualstudio.com). After the installation has completed and you have open an instance of VS-Code, you need to install the [Remote - WSL](vscode:extension/ms-vscode-remote.remote-wsl) extension. At this point you should be able to select the "Remote explorer" tab on the left side, here you can connect to the Ubuntu virtual machine.
|
|
|
|
|
|
At this point you are ready to start programming!
|
|
|
|
|
|
## Development environment test
|
|
|
|
|
|
To ensure that everything is working you can clone the Boardcore repository and compile the code whit the following commands
|
|
|
|
|
|
```shell
|
|
|
git clone --recursive git@git.skywarder.eu:scs/skyward-boardcore
|
|
|
cd skyward-boardcore
|
|
|
./sbs
|
|
|
```
|
|
|
|
|
|
You can also test the ST-Link Utility by connecting a board to your computer and running `./sbs -f test-serial` |
|
|
\ No newline at end of file |