/tiny-blackbox

Tiny Blackbox for Micro Drones

Primary LanguageCGNU General Public License v3.0GPL-3.0

Tiny Blackbox

Tiny Blackbox - open source ultra-light external logger for micro drones.

  • Size: 8 x 13 mm
  • Weight: 0.32 g
  • Logging rate: up to 8 kHz
  • Data rate: 1.5 Mbit/s
  • Current consumption: < 30 mA
  • Flash memory: 16 MB, W25Q128JVPIQ
    > 3 min at 4 kHz, full log
    > 45 min at 1 kHz, gyro-only log (all other fields disabled)
  • MCU: STM32G031G8U6

For previous version with F042 chip go to this page

Setup

  1. Connect the device to any free UART port on your flight controller (RX->TX, TX->RX).
    Signal wires must be tightly twisted to prevent interference.

  1. Setup blackbox in Betaflight Configurator:
  • Ports tab: Peripherals -> Blackbox logging, speed 1500000.
  • Modes tab: Blackbox -> assign to any available AUX switch.
  • Blackbox tab: Logging device -> Serial Port.
Screenshots
Warning! Betaflight 4.3.1 has a bug in USB code, so logs might be corrupted when downloaded to PC.
Please use Tiny Blackbox with Betaflight 4.4.x, 4.3.0, 4.3.2+ or 4.2.x.

Notice: You can disable any blackbox fields in Betaflight when you don't need them.
This will significantly reduce log size and eliminate lost frames.
For example, set blackbox_disable_pids = ON or set blackbox_disable_motors = ON.
Type get blackbox_disable in CLI to see all the available options.

Operating modes

Read recorded logs

  1. Download application on Releases page: "exe" for Windows, "app" for macOS.
  2. Connect flight controller to PC.
  3. Hold hardware button for 1 second to switch into Read mode (double blinks).
  4. Open application, configure connection parameters and press "Connect".
  5. Save logs to file and open them with Betaflight Blackbox Explorer.

Also, you can connect Logger directly to PC with FTDI/CP2102 adapter, without flight controller.
Select "Serial-USB adapter" instead of "Betaflight passthrough".

Notice: Tiny-blackbox GUI may trigger antivirus alerts sometimes. This happens because binaries were built using "PyInstaller". You can add Tiny-blackbox executable to antivirus exception list or else run directly the source code.

Optional: Run the source code
  1. Get the latest version of Python.
    Set "Add Python to PATH" checkbox while installing.
  2. Install additional modules.
    Open "cmd.exe" (Windows) or "Terminal" (macOS) and enter:
    pip3 install pyserial
    pip3 install PyQt5==5.15
  3. Download and run GUI Python script: tinybb_gui.py.
Optional: Command line interface

CLI Python script for downloading logs is also available.
Install Python and pyserial as described in section above.
Run CLI script: tinybb_cli.py

For developers and enthusiasts

  • Use EasyEDA online editor to modify the board.
  • PCB thickness 0.6 mm is optimum for weight/reliability.
  • X5R/X7R capacitors are recommended.
  • Edit and build firmware using STM32CubeIDE.
  • Flash pre-built HEX-firmware with STM32CubeProgrammer or STLink toolset.
    Use following commands to flash with STLink tool:
    st-flash erase
    st-flash --format ihex write "Blackbox.hex"
    st-flash reset
  • Connect ST-Link programmer to SWDIO and SWCLK pins:

Contacts

Feel free to contact me in Telegram: @AlexeyStn