Install Microvisor App Development Tools on Unsupported Platforms
Microvisor Public Beta
Microvisor is in a pre-release phase and the information contained in this document is subject to change. Some features referenced below may not be fully available until Microvisor’s General Availability (GA) release.
These instructions are not supported. Use at your own risk!
Microvisor development is formally supported only under Ubuntu Linux 20.04. Supported development on other platforms involves running either a virtual machine into which you have installed Ubuntu 20.04, using Docker, or (Windows only) using Windows Subsystem for Linux.
However, it is possible to build apps for Microvisor natively on other platforms, and this page collates the extra information you need to do so.
Windows
1. Install the pre-requisites
Download and run the following tools’ installers. In each case, make sure you accept the offered option to add the tools to the Path:
- Git for Windows
- The ARM toolchain
- CMake for Windows
- Visual Studio Build Tools 2022
When the Visual Studio Installer runs, under the Workload tab select Desktop development with C++. In the Installation Details list at the right of the Window, make sure only MSVC v143 VS 2022 C++ and C++ CMake Tools for Windows are selected from among the options. - Twilio CLI
2. Configure the Twilio CLI
- From the Start menu, select Visual Studio 2022 > Developer Command Prompt for VS 2022.
- Run
twilio login
to configure the tool and create a profile.
3. Build the demo app
Still in the Developer Command Prompt, run these commands:
cd \Users\<YOUR_USER_NAME>
md GitHub
cd GitHub
git clone https://github.com/twilio/twilio-microvisor-freertos
cd twilio-microvisor-freertos
git submodule update --init --recursive
cmake -S . -B build -G "NMake Makefiles"
cmake --build build
twilio microvisor:apps:bundle build\Demo\gpio_toggle_demo.bin build\Demo\gpio_toggle_demo.zip
twilio microvisor:apps:create build\Demo\gpio_toggle_demo.zip
macOS
The easiest way to install the development tools under macOS is to use the Homebrew package manager, and this is the approach taken here. If you do not have Homebrew installed on your Mac, please get it now.
1. Install Rosetta 2 (Apple Silicon Macs only)
Not all of the available tools yet support Apple Silicon, so if you have a Mac based on the M1 or above, please make sure you also install Rosetta 2 to allow you to continue to run tools compiled for x86-64, such as the ARM cross-platform compiler:
softwareupdate --install-rosetta
2. Install the pre-requisites
brew install cmake curl git jq node bash
3. Install the correct ARM GCC cross-compiler
Homebrew can install the ARM GCC cross-compiler using the cask gcc-arm-embedded
. However, the latest version, 12.2.rel1, doesn’t compile Microvisor apps correctly. Instead, you must install an older release, 11.2-2022.02. This involves downloading an older version of the public Homebrew gcc-arm-embedded
installation script:
curl https://raw.githubusercontent.com/Homebrew/homebrew-cask/17d156bba668109dcb6bba337a75fcf41be2d71b/Casks/gcc-arm-embedded.rb \
-o gcc-arm-embedded.rb
brew install --cask gcc-arm-embedded.rb
Important If you subsequently run:
brew upgrade
you will update the ARM GCC cross-compiler to a more recent version that will not compile the Microvisor SDK. To avoid this issue, replace the last command with this one:
brew upgrade $(brew list | grep --invert-match gcc-arm-embedded)
This will upgrade all your installed Homenbrew formulae and casks but not gcc-arm-embedded
.
4. Install the Twilio CLI
brew tap twilio/brew && brew install twilio
5. Remote debugging
Installing the ARM cross-compiler as outlined above also installed a suitable version of the debugger GDB.
To perform remote debugging operations on a Mac, follow the instructions in the remote debugging documentation but use arm-none-eabi-gdb
in place of gdb-multiarch
. For example, to initiate a debugging session for our Remote Debugging Demo, call:
arm-none-eabi-gdb -l 10 ./build/demo/mv-remote-debug-demo.elf
If you’d like to use Visual Studio Code to host remote debugging sessions, you will first need to edit the ./vscode/launch.json
file. Look for the key gdbpath
and set its value to the path to your arm-none-eabi-gdb
installation. The command which arm-none-eabi-gdb
will help you here.
Raspberry Pi OS
Installing Microvisor development tools is straightforward, but requires some extra work to get an up-to-date version of Node.js and to install the Twilio CLI.
1. Install the pre-requisites
This will install an older version of the ARM GCC cross-compiler, but it is sufficient to compile Microvisor apps.
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi \
build-essential libsecret-1-dev cmake curl git jq \
gdb-multiarch
You will also need to install Node.js version 14.0 or higher in order to run the Twilio CLI:
curl -sL https://deb.nodesource.com/setup_19.x | sudo -E bash -
sudo apt install -y nodejs
2. Install the Twilio CLI
Twilio does not recommend installing the Twilio CLI using npm
. However, the recommend method, using apt
, does not yet support either 32- or 64-bit Raspberry Pi OS, so you will have to use npm
. This makes use of the version of Node.js you just installed.
npm install -g twilio-cli
3. Remote debugging
Remote debugging on the Raspberry Pi uses the same gdb-multiarch
tool as used under Ubuntu.