24min

Wi-Fi module

The Flipper Zero Wi-Fi Module is both a debugger and a programmer for Flipper Zero. It is based on the ESP32-S2 module and an open-source tool called Black Magic Probe. It can flash and debug various microprocessors and microcontrollers (including the one used in the Flipper Zero) via Wi-Fi or USB. This module can also act as a USB-UART adapter.

Document image

Terminology

STA - mode in which the Wi-Fi module connects to an existing network AP - mode in which the Wi-Fi module creates its own network SSID - the Wi-Fi network's name SWD - protocol used for flashing and debugging JTAG - protocol used for flashing and debugging GDB - debugger program, usually consisting of a server and a client. In our case, the Wi-Fi board acts as a server UART - data transfer protocol USB - data transfer protocol

Connecting

via Wi-Fi

  1. Power on the module by connecting it to a power source using the USB port or by plugging it into Flipper Zero
  2. Connect to blackmagic Wi-Fi network using iamwitcher as the default password
  3. Navigate to 192.168.4.1
  4. Input your Wi-Fi network credentials. Choose the STA mode and set the correct SSID and password in the STA section of the settings menu. You can press the + button to quickly select an SSID of a nearby network
  5. Save the settings and reboot the module
  6. Now the device should be accessible in your network with the address blackmagic.local if your OS supports the mDNS protocol. If it doesn't, you'll have to figure the module's IP address on your own.
Example settings for connecting the debugger to an existing network my_home_net with the password qwerty1234
Example settings for connecting the debugger to an existing network my_home_net with the password qwerty1234

via USB

  1. Connect the module to your computer with a USB cable
  2. The first port that appears is used for communicating with the GDB server
  3. The second port that appears is used for UART

Debugging using the module

via Wi-Fi

BLACKMAGIC=BMP_IP_ADDRESS:2345 make blackmagic

  • Where BMP_IP_ADDRESS is your module's IP address

via USB

BLACKMAGIC=/dev/BMP_SERIAL make blackmagic

  • Where /dev/BMP_SERIAL is the port being announced by the module
  • On MacOS you should use the cu(calling unit) port, for example /dev/cu.usbmodemblackmagic1

Reading logs using the module

MacOS

Install minicom, connect to the board's second calling unit port and set the speed to 230400. minicom -D /dev/cu.usbmodemblackmagic3 -b 230400

Linux

Install minicom, connect to the board's second serial port and set the speed to 230400. minicom -D /dev/ttyUSB4 -b 230400

Windows

Install Putty, connect to the board's second COM port and set the speed to 230400.

Document image

Updating the module's firmware

  1. Download the desired firmware version from the update server
  2. Install Python 3
  3. Install PIP python3 -m ensurepip --upgrade python3 -m pip install --upgrade pip
  4. Install ESPTool pip3 install esptool
  5. Connect the module via the USB port
  6. Press and hold the BOOT button on the module, press and release the RESET button, release the BOOT button. Your PC should detect a COM port that is used for flashing
  7. Run the command from the flash.command file (bundled with the firmware), substituting the (PORT) with the COM port that appeared in the previous step. An example command is provided below. The port should be in the COMXXX form for Windows, /dev/ttyXXXX for Linux and /dev/cu.XXX for MacOS
  8. Reboot the board after flashing
esptool.py -p COM12 -b 460800 --before default_reset --after hard_reset --chip esp32s2 write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader.bin 0x10000 blackmagic.bin 0x8000 partition-table.bin





Updated 04 May 2022
Did this page help?
Yes
No