Flipper Zero UART Debug

It’s possible to use a USB-to-UART adapter such as the SH-U09C USB to TTL Adapter or a Raspberry Pi Debug Probe to receive debug messages while the Flipper Zero is running.

The adapter must be configured for 3.3v communication to avoid damaging the Flipper Zero.

Set up the Flipper Zero

Navigate to Settings > System and scroll down to Log Level, Log Device, Log Baud Rate, and Debug. Set them to:

  • Log Level: Debug
  • Log Device: USART
  • Log Baud Rate: 230400
  • Debug: ON

Log Level and Log Baud Rate can be set differently, but these are preferred for now.

Connect the Adapter

The adapter must be configured for 3.3v communication to avoid damaging the Flipper Zero.

  • TX <–> RX (Flipper Pin 14)
  • RX <–> TX (Flipper Pin 13)
  • GND <–> GND (Flipper Pin 18)
Flipper Zero GPIO Pinout
Raspberry Pi Debug Probe Connected to Flipper Zero and Communicating

Once everything is connected, next step is to open a serial communication on the computer using a program such as Minicom or PuTTY. In this example, the Debug Probe is connected via COM22. The Speed is set to 230400 which is the same as on the Flipper Zero. The Speed, or Baud, can be any number of options, but they must match.

Once connected, navigating around the main menu on the Flipper should result in messages being printed to the terminal e.g.:

16683445 [D][BrowserWorker] Enter folder: /ext/infrared/remote items: 0 idx: -1
16683449 [D][BrowserWorker] Load offset: 0 cnt: 50
16684138 [D][BleGap] Start: 4
16684139 [D][BleGap] set_non_discoverable success
16684143 [D][BtSrv] call 0, lock 0x00000000, result 0x00000000
16687410 [D][BrowserWorker] End
16687419 [I][ir_remote] exit
16687423 [W][ViewPort] ViewPort lockup: see applications/services/gui/view_port.c:143
16687438 [I][Loader] App returned: 255
16687441 [I][Loader] Application stopped. Free heap: 125776
16687444 [I][Loader] Launch queue empty
16687450 [D][BrowserWorker] Start

In the preceding snippet, [D] are Debug messages, [I] are Info messages, [W] are Warning messages, and so forth. Here’s how to write such a message.

#include <furi.h>
FURI_LOG_I("gpio_scene_start.c", "on_exit() called.");

This will cause the following:

17096140 [I][gpio_scene_start.c] on_exit() called.

Note that the I in FURI_LOG_I referts to Info. FURI_LOG_D will write Debug messages, FURI_LOG_W will write Warning messages, etc.

But Why?

While there are several guides which describe using the Flipper Zero as a dedicated UART bridge to communicate with other devices, I couldn’t find any guide which demonstrated that this particular approach works.

True, plugging in the Flipper Zero directly to the computer and connecting to it via Minicom or PuTTY accomplishes the same thing, but such a connection prevents building and uploading programs in development through uFBT. The connection has to be closed first before uploading then reopened to read debug messages.

One solution is the use the WiFi Devboard as a UART bridge, but custom firmware for the devboard may not support this feature, and it’s a pain to keep flashing the devboard back and forth.