|
6 | 6 | - [Additional requirements only for Linux emulator](#additional-requirements-only-for-linux-emulator) |
7 | 7 | - [Tools required for firmware images](#tools-required-for-firmware-images) |
8 | 8 | - [Windows toolchain setup](#windows-toolchain-setup) |
| 9 | + - [MacOS toolchain setup](#macos-toolchain-setup) |
9 | 10 | - [Getting the source code](#getting-the-source-code) |
10 | 11 | - [Compiling for radios](#compiling-for-radios) |
11 | 12 | - [Compiling for Linux](#compiling-for-linux) |
@@ -180,6 +181,50 @@ To verify that radio_tool is in PATH, this should not return an error |
180 | 181 |
|
181 | 182 | --- |
182 | 183 |
|
| 184 | +## MacOS toolchain setup |
| 185 | + |
| 186 | +The MacOS toolchain setup is similar to that for Linux. Currently, neither the Linux emulator or the Zephyr-based tagets can be built on MacOS. The basic tools required to compile OpenRTX from the sources are _git_ and the _meson_ build system. To build the firmware for one of the radio targets, you'll require also the GCC toolchain for the miosix kernel. In this latter case, also _cmake_ and _libusb_ are required for compiling the external tools for flashing the radio. |
| 187 | + |
| 188 | +#### Installing the basic tools |
| 189 | + |
| 190 | +To install the basic tools required to compile both the Linux emulator and the firmware images, you can use [Homebrew](https://brew.sh/). Most developers will already have it installed, otherwise follow the instructions at the link. |
| 191 | + |
| 192 | +You will already have Git and the Xcode tools from the Homebrew installation process. |
| 193 | + |
| 194 | +``` |
| 195 | +brew install pkg-config meson |
| 196 | +``` |
| 197 | + |
| 198 | +#### Tools required for firmware images |
| 199 | + |
| 200 | +To build the firmware images ready to be flashed on the radios, the miosix kernel GCC toolchain is required, as well as some additional tools used to encrypt and flash the binary files obtained at the end of the compilation process. |
| 201 | + |
| 202 | +There is no miosix package in Homebrew, so to install the toolchain, download and run the MacOS installer for your Mac's architecture (Intel or ARM) from https://miosix.org/wiki/index.php?title=Miosix_Toolchain#Latest_Stable_version_of_the_Miosix_Toolchain. |
| 203 | + |
| 204 | +The tool used to encrypt and flash the binary executables is called [radio_tool](https://github.com/v0l/radio_tool). The compilation script will automatically detect if _radio\_tool_ is already installed in the system and, if this is not the case, it will download the sources and compile automatically a local copy of the program. For the compilation process to succeed _cmake_ and _libusb_ must be present in the system. |
| 205 | + |
| 206 | +``` |
| 207 | +brew install cmake libusb |
| 208 | +``` |
| 209 | + |
| 210 | +Finally, if you are targeting the *Module 17* or *CS7000* platform, _dfu-util_ is required to flash the binary image on the microcontroller's flash memory. |
| 211 | + |
| 212 | +``` |
| 213 | +brew install dfu-util |
| 214 | +``` |
| 215 | + |
| 216 | +Once these prerequisites are complete, you should be able to [compile](#compiling-for-radios) and [flash](#flashing-the-firmware-to-a-radio) radio firmware following the instructions below. |
| 217 | + |
| 218 | +#### MacOS Notes |
| 219 | + |
| 220 | +The gd77 and dm1801 targets use `bin2sgl`. In order to run it on Apple Silicon Macs, you may need to install Rosetta 2 with the following command: |
| 221 | + |
| 222 | +``` |
| 223 | +softwareupdate --install-rosetta --agree-to-license |
| 224 | +``` |
| 225 | + |
| 226 | +--- |
| 227 | + |
183 | 228 | ## Getting the source code |
184 | 229 |
|
185 | 230 | To obtain the OpenRTX source code, clone the github repository with the following command: |
|
0 commit comments