Farpatch DVT7

About

You have come into possession of a Farpatch DVT7 board. Congratulations! This is one of 50 boards produced, and is designed to provide final testing before production.

This board has the following features:

Modifying the case

The case requires slightly modification to work with the wifi antenna.

To use the case, use a knife to chip away a bit of the material. This will be used to allow the wifi antenna to escape the case once connected.

Setup

To set up the board, connect the supplied wifi antenna. Note that U.Fl connectors need a lot of force. Make sure you don't bend the metalic shell while connecting it! Once attached, angle the antenna so that it goes out over the USB connector.

Finally, connect Farpatch to a debug target with a standard 10-pin Cortex debug cable. The red LED will turn on, indicating that Farpatch is running.

Connecting to Farpatch

Each Farpatch device has a unique name. This name is derived from the MAC address of the ESP32-C6. When you first connect Farpatch, it will start an access point. This will be named using a format of Farpatch (word1 word2). By default, there is no password.

You can connect to Farpatch by going to http://10.10.0.1, or using mDNS you can go to http://farpatch-word1-word2.local.

Configuring Farpatch

To configure Farpatch, go to its web interface and select "Settings". There is a section titled "Wifi Client", which will contain a list of locally-discovered access points. You can connect to an access point using this list.

Farpatch supports multiple access points. Additionally, it supports acting as both an access point itself, as well as a wifi client. You can improve performance by unchecking the "Enabled" box under "AP Mode". Note that Farpatch will always start an AP if it is unable to connect to an access point.

Using Farpatch

Farpatch starts a GDB server on port 2022. You can start a GDB session by running arm-none-eabi-gdb and connecting to the target with target ext farpatch-word1-word2.local:2022. You can then use this like a standard Black Magic Device.

For example, run mon s to scan for SWD devices, then run att 1 to attach to the first discovered device. Alternately, run mon j to perform a JTAG scan.

Farpatch also supports RTT. An RTT interface is available via the web interface, or you can telnet to port 2123.

Serial Connection

Farpatch supports the Universal Uart standard. This places UART communication signals on pins 7 and 9 of the debug header. If your target has a Universal UART, then you can use Farpatch to communicate with the target over serial.

Developing for Farpatch

The firmware for Farpatch is written using ESP-IDF. To develop for Farpatch, perform the following actions:

  1. Download the esp-idf main branch:
    git clone --recursive https://github.com/espressif/esp-idf.git
  2. Install the dependencies:
    cd esp-idf; ./install.sh
  3. Set up the environment:
    . export.sh
  4. Clone Farpatch:
    git clone --recursive https://github.com/farpatch/farpatch.git
  5. Configure Farpatch and set DVT7 as the hardware:
    cd farpatch; idf.py set-target esp32c6; idf.py menuconfig
  6. Build Farpatch:
    idf.py build

You can then flash build/farpatch.bin using the built-in UI, or via TFTP. The web interface will roll back the update if it fails to stay running for more than a few seconds in order to protect against invalid firmware images.

Alternately, you can plug Farpatch into a USB-C connection and develop that way. For example: idf.py -p /dev/cu.usbmodem* build flash monitor

It is possible to power Farpatch from USB-C or from the target -- it will draw power from whichever has the higher voltage.

A Note about Low Voltages

Farpatch is designed to work down to 1.8 volts, however the nature of wifi means that there are very high current transients. As a result, lower voltage power supplies may not be able to supply enough power for transmitting, particularly at high power.

This is an ongoing area of research. There is an option to enable low power mode and limit the transmit power to 10 dBm. The ESP-IDF function esp_wifi_set_max_tx_power(int8_t power) is potentially useful in determining an acceptable transmit power level, particularly if we measure the voltage droop of the main voltage supply. However, this is a work in progress.