Template for USN BSc intelligent real-time systems course.
Before using this template, the following should be installed:
- vscode from https://code.visualstudio.com/download
- python 3.12.5+ from https://www.python.org/downloads/ make sure to check "Add python.exe to path". Don't use the Windows/App Store version.
- pyocd 0.34.3+ by doing py -m pip install -U pyocd
- github desktop from https://github.com/apps/desktop OR git scm 2.46.0+ from https://git-scm.com/downloads
- alire 2.1.0+ from https://alire.ada.dev/ or from https://github.com/alire-project/alire/releases
Open command prompt and type
alrSay yes to install msys2
alr toolchain --select- Select GNAT_ARM_ELF version 14.1.3+
- Select GPRBUILD version 22.0.1+
-
Windows
- Open powershell as administrator
-
./rundll32.exe sysdm.cpl,EditEnvironmentVariables
- goto system variables > path > new and add
- C:\Users[USERNAME]\AppData\Local\alire\cache\toolchains\gprbuild_[VERSION]\bin
- C:\Users[USERNAME]\AppData\Local\alire\cache\toolchains\gnat_arm_elf_[VERSION]\bin
- C:\Program Files\Alire\bin (if you installed it in default)
- C:\Users[USERNAME]\AppData\Local\Programs\Python[YOUR_PYTHON_VERSION]
- C:\Users[USERNAME]\AppData\Local\Programs\Python[YOUR_PYTHON_VERSION]\Scripts
- Close the environment variables window and reboot computer
-
MacOs
- Open terminal app and create the zsh shell file by doing:
-
nano ~/.zshrc - add lines (make sure to look up which version you installed!). IMPORTANT any mistake in this file will prevent your terminal to run commands. If you notice that you cannont run commands like ls, open finder and go to your username and open the zshrc file to edit it manually. This file is hidden so you need to uses COMMAND + SHIFT + . to enable hidden files in Finder.
- $ export PATH=$PATH:~/.local/share/alire/toolchains/gprbuild_[VERSION]/bin
- $ export PATH=$PATH:~/.local/share/alire/toolchains/gnat_arm_elf_[VERSION]/bin
- Close the terminal.
-
Linux
- Open terminal app
-
nano ~/.zshrc - add lines
- $ export PATH="/home/[USERNAME]/.local/share/alire/cache/toolchains/gprbuild_[VERSION]/bin/:$PATH"
- $ export PATH="/home/[USERNAME]/.local/share/alire/cache/toolchains/gnat_arm_elf_[VERSION]/bin/:$PATH"
- Close the environment variables window and reboot computer
- Make sure that you are logged in to your github.com account
- Click on the green "Use This Template" button and choose "create a new repository". This will create a unique repository under your github username with the contents of this template. Remember To choose a suitable name for your project
- Clone your newly created repositry with submodules by opening a command prompt and typing
git clone --recurse-submodules https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git.You can also first clone the project and then initialize the submodules afterwards using
git submodule update --init --recursiveImportant to open a folder at the workspace level (root of the project or root of the example where a folder .vscode is present) either via command prompt or via open. To build your project press Ctrl+Shift+B. Decline any question of VScode trying to be helpful.
- The above installation should lead to a correct compile flow. However flashing the compiled firmware file to sometimes fails due to previous usage. If Ctrl+Shift+B (to build your project) results in a timeout when flashing the MicroBit, try to Erase the content of the Micro:Bit first using Ctrl+Shift+P to open the command window and type
-
task Erase
- Try Ctrl+Shift+B after the erase. Try removing the USB cable and using another USB port or reboot the computer if the problem persists.
- DependaBot to sync with dependencies (submodules) such as the Ada Driver Library.
- Ada Github action workflow to check if your code compiles and update the badge on top
- Ada language server for VS Code (https://github.com/AdaCore/ada_language_server/blob/master/README.md#vs-code-extension)
- EditorConfig
- Cortex-Debug
- CPPtools
- VScode-Serial-Monitor