> For the complete documentation index, see [llms.txt](https://acolono.gitbook.io/opentrigger/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://acolono.gitbook.io/opentrigger/tutorials/flash-firmware-under-osx.md).

# Flash Firmware under OSX

Contributed by CHRISTIAN MEILINGER/MEICHR

## Introduction

The router firmware and the button firmware are built and flashed each to its Merkur-Board using a Docker container according to the guide referenced on page [opentrigger-board](https://acolono.gitbooks.io/opentrigger/content/buttons/opentrigger-board.html) and a Merkur-Board-Programmer Module V2.

This tutorial describes the installation of the necessary software - programmer driver and Docker - under Mac OSX.

## Driver installation

The Merkur-Board-Programmer Module V2 contains a SILABS’s CP2102 chip for USB-serial conversion.

The CP2102 OSX driver is available on the [SILABS download page](http://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers). Download it under section *Download for Macintosh OSX (v4),* unpack the zip file, double click the dmg image and then the pkg file and follow the steps in the dialog box to install the driver.

After installation, plug the programmer module into a USB port of your Mac. Now, two new devices should be available: /dev/tty.SLAB\_USBtoUART and /dev/cu.SLAB\_USBtoUART. Just for info: the first device is for an incoming connection and the second one works as an outgoing device (cu = calling unit).

## Docker installation

Under OSX, only the legacy *Docker Toolbox* (using VirtualBox) supports flashing of the Merkur-Board, because the newer *Docker for Mac*, which is based on [HyperKit](https://github.com/docker/HyperKit/) for virtualization, doesn't yet support passing-through serial devices provided by the host (OSX) to the guest (docker under *default* vm).

Download and install *Docker Toolbox* according to this [tutorial](https://docs.docker.com/toolbox/toolbox_install_mac/). The VirtualBox application including the *default* vm is automatically installed also.

To enable passing through the serial USB device to the VirtualBox *default* vm, the *VirtualBox Extension Pack* (same version as VirtualBox) needs to be downloaded from the [VirtualBox download page](https://www.virtualbox.org/wiki/Downloads) and installed.

Open VirtualBox from the OSX Launchpad and power off the *default* vm, if running.

Connect the Merkurboard-Programmer to a USB port of your Mac, if not already done so.

Select Settings => Ports => USB, check *Enable USB Controller* and select *USB 2.0* or *3.0*. Under *USB device filters* click on the USB+ icon to the right, select *Silicon Labs CP2102 USB to UART Bridge Controller \[0100]* and make sure its checkbox is checked in the list. Click on the OK button.

For testing the installation, provided that the Merkurboard-Programmer is plugged in, whenever the *default* vm is running, the devices /dev/tty.SLAB\_USBtoUART and /dev/cu.SLAB\_USBtoUART are removed from the OSX host and instead, the device /dev/ttyUSB0 is available in the *default* vm in the docker container.

## Flashing the firmware

Properly connect the Merkurboard-Programmer module to the Router-Merkur-Board or Button-Merkur-Board to be flashed and plug the programmer into a USB port of your Mac.

Start *Docker Quick Terminal* from the OSX Launchpad. This also starts the *default* vm, if not running already.

All further steps shall be done in the docker terminal according to the guide referenced on the [opentrigger-board](https://acolono.gitbooks.io/opentrigger/content/buttons/opentrigger-board.html) page. The device /dev/ttyUSB0 will be available only after the docker command has run.
