Setup Blackbox in Cleanflight

by Oscar

Blackbox feature in Cleanflight is useful for tuning PID, and diagnose any performance related issue you might have with your multicopter.

This is part of the Cleanflight Setup Guide. Here is a guide on how to tune your PID using blackbox logs. Here is a guide on how to overlay sticks movement and blackbox data onto your FPV video.

Content index:

There are two ways of saving Blackbox data depends on what flight controller you have. For example the Naze32 Full version has 2MB of flash memory you can use for Blackbox, but the Naze32 Acro version has none. Therefore it will require an external data logger and a SD card.

Flight controller internal flash storage is very limited, for 2MB you can only record about 3 or 4 mins of flight (@2500 looptime). Some flight controller has larger memory such as the SPRacing F3 board has 8MB of memory, but still pretty limited. (the cunning thing is, it’s advertised as 64Mb – 64 Mega bit, not Mega Bytes 1Byte = 8 bits :D I got confused the first time!)

I think CC3D has 2MB onboard flash storage as well.

I like using an external data logger, because it’s relatively cheap to setup, and you can record for much longer with an micro SD card.

Cleanflight Documentation is pretty good! Hopefully some of the gaps that were missing can be filled in this tutorial.

Blackbox Example

In this video I tested how PID value changes affects the performance of the quad,

Setting Up OpenLog Device

I got my OpenLog on eBay from China, costed about $9, the cheapest I can find on the internet.
Also get a microSDHC card that has fast write speed. Sandisk Extreme 16GB Class 10 UHS-I microSDHC is recommended on Cleanflight documentation, but i found Sandisk Ultra class 10 16GB also works fine (which I use for my mobius and GoPro).

The advantage of using OpenLog is

  • It’s pretty cheap to setup and running
  • More than enough data storage
  • You can use the same hardware on all of your boards that don’t have onboard flash storage
  • It doesn’t take a long time to export the log file (on my Naze32 Full board, it takes 3 to 4 minutes to export a 40 second flight, which is annoying)

Update OpenLog Firmware

Updating the firmware on OpenLog allows you to record log data with a faster baud rate (default – 115200 to 250000). This is important if you are running looptime below 2500.

The OpenLog custom firmware for blackbox. Instruction is pretty clear.

You can either use a dedicated FTDI programmer, or an Arduino Uno.



Here is how you connect the OpenLog data logger to the Arduino UNO, or Sparkfun FTDI programmer.


Problem: Error when Flashing firmware on OpenLog

I was getting this annoying error when i am uploading the sketch from Arduino IDE! And couldn’t figure out why when updating the firmware.

Error: avrdude: stk500_getsync(): not in sync: resp=0x31

It turns out to be the wrong bootloader! In the documentation, it says to choose “Arduino Uno” in “Tools => Board”. But no, that’s for the latest version of OpenLog, the one I got was the older version which is only compatible with the “Arduino Pro or Pro Mini 5V/16MHz w/ ATmega328”

If you’re not sure, try both, it won’t hurt anything.

Problem: Getting Gibberish in the log files

If you are getting bad log files, make sure you compile the Blackbox sketch for the Atmega328 5v 16Mhz – and not the 8Mhz.

Format your SD card

It’s recommended to format your Micro SD card with this tool.

For 2GB or more, you should use FAT32 format. Smaller cards can use FAT (aka FAT16).

OpenLog Configuration

The openlog’s configuration settings are placed on the SD card. You need to create a config file on the SD card and write config settings in it.

  1. Create a text file in SD card, call it CONFIG.TXT
  2. in the CONFIG.TXT file, put these in

Settings in Cleanflight

To enable blackbox feature check this option.


Alternatively you can do it in CLI command by entering

feature BlackBox

By default external storage device is chosen, i.e.

set blackbox_device = SERIAL

Connection with Naze32

You will only need 4 connections, TX, RX, 5V and GND. I get the 5V and GND from the spare motor pins.

I strongly recommend using Radio pin3 (TX) and pin4 (RX) on the Naze32 board to connect to the OpenLog. These pins are UART2 serial ports, and they are available when you are running PPM on RX.

In fact you only need to connect the TX pin on the Naze32, because the communication is one way, data is only sent from Naze to OpenLog, and no data is required to send back to the FC.


I would not recommend running Openlog with UART1 (TX/RX pins in the middle of the board), because you cannot change Baud rate to 250000 i think in this case. Once you change that baud rate you won’t be able to connect to Cleanflight configurator (correct me if i am wrong!)


Start Recording

Arm your flight controller and it will start recording automatically. The Blue LED on the OpenLog should start blinking very rapidly when it’s recording.

Sampling frequency and Looptime

For example when looptime is 2400, there is 1s / 2400ms ~= 416 iterations of control loop data to record per second. The fastest looptime could jump around 1200 on a Naze32 board, and we have twice as many iterations (833 to be exact). And that’s a lot of data!

If your hardware is not good enough (e.g. low grade SD card), the logging device will struggle with writing speed, you will find missing data in your graphs like this.


If that happens to you and really affects your usage, easiest solution is to lower your sampling frequency, by default the sampling rate parameters are set to:

set blackbox_rate_num = 1
set blackbox_rate_denom = 1

You can halve the sampling rate by setting “rate_denom” to 2.

set blackbox_rate_denom = 2

Using Onboard DataFlash Memory

The advantage of using integrated flash storage is:

  • No need to worry about OpenLog and SD card
  • Doesn’t lose data due to writing error
  • Free up a serial port for something else

Simply enable blackbox in Cleanflight by checking the feature, or type in this command in CLI command.

set blackbox_device = SPIFLASH

After you have recorded some flight data, you can export it by going to DataFlash tab, and press “Save Flash to File”. The below diagram shows only 11 seconds of data on the Full Naze32 board @ 1200 looptime, and that’s 10% of the memory used!


BlackBox Viewer

This is a quick Chrome application that you can use to overlay blackbox data on a MP4 video. There is no rendering wait, so it’s perfect for quick check.

However you can output it as a WEBM file, but cannot output it as a normal video file. WEBM isn’t supported by the majority of video editor, including Gopro Stduio, Adobe Premiere or Windows movie maker.

For rendering proper video, use the following tool.

BlackBox Tools for CSV file Conversion, and Video Render, Overlay

This blackbox convert and render tool only works in command lines, it doesn’t have an interface. Follow the instructions it’s pretty straight-forward.


It basically can convert your log data into a series of PNG pictures, pretty much like time lapse photos. You can then convert these photos in your video editor into a single video that you can overlay on your flight footage.

How I mount Openlog on my mini quad

It’s fitted under the top plate of the frame with zip tie, a layer of Velcro to stop it from sliding. Note that I also put another half-cut zip tie there to prevent the SD card from accidentally popping out in hard landing or crashes.


Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.


chupo_cro 7th September 2019 - 11:39 pm

You mean 416 iterations per second is around 2400 µs, not ms.

Bryan 30th March 2017 - 4:57 pm

Hi Oscar,

I built an open log for blackbox. I want to use it to tune a micro scisky and a qx70 board on qx90 frames. I am new to tuning PID’s and seem to burn out motors (they become stiff to turn by hand) when I get them set to where it feels locked in.

My problem is where to attach them? On the scisky uart 2 (front right) with the connector is on the reciver, front left port is I2C. UART 1 is the msp, sounds like I could share that? Am I correct I would need to bypass the usb? Grab that line off the chip before the usb driver?

On the qx70, I have no idea where to access the other uarts. Do you know where the other uarts are located?

Thank you!

Yann 14th July 2016 - 2:32 pm

I have a naze32 rev5 FC running with a SBUS receiver on UART2. Can I connect the logger on pin3 (UART2 TX) and enable both serial RX (the SBUS receiver on pin4 UART2 RX) and blackbox in UART2 ?
I want to keep UART1 for a Micro minimOSD.
Anybody tried this yet ?

Oscar 17th July 2016 - 3:38 pm

no you can’t… one UART can only be used for one thing…
however you could use PPM while tuning your quad with Blackbox… after that replace PPM with SBUS again maybe?

Peter Kornum 25th May 2016 - 2:54 pm

Can i use black box to tjek for what i think is a defektive ESC? and will it tell me witch one cuts out?
link to video of my problem….

Joshua 4th February 2016 - 5:23 pm

HI Oscar,

You definitely CAN run Blackbox on UART1 at 250 kBaud, with MSP at the default of 115.2 kBaud. I’m doing it, anyway.

Oscar 8th February 2016 - 12:16 am

thanks Joshua :)
UART1 is shared by USB connection on the Naze32, by changing baud rate of UART1, does that not disable your connection to the configurator?

Peter 3rd February 2016 - 8:35 am


I got the OpenLog serial data logger you suggest from banggood:

But not the Sparkfun FTDI Programmer you suggested. I instead got it from banggood (cheaper and has a 3.3 / 5v switch instead of a soldering point):

I hope it works (I’m pretty new to this). I’ll let you know when I receive it in a couple of weeks.

Thanks for the tutorial.

Bryce 15th January 2016 - 2:07 pm

Hello Oscar,

I burnt up my Naze32 and all I have is a spare CC3D board to use at the moment. I have flashed the CC3D with Cleanflight, version 1.9 I believe. I’m trying to setup blackbox for use with the 2mb onboard flash memory.

My problem is, whenever I input: “set blackbox_device = SPIFLASH” the CLI prompt returns: “blackbox_device set to 0”. I even tried to input “set blackbox_device = SERIAL” just for fun and the prompt returns the same thing. Do you possibly know how to fix this? Thanks!

Oscar 20th January 2016 - 11:02 am

Flash it with cleanflight 1.10 :) (or just latest version)

Andrei 4th January 2016 - 7:04 am

Hi Oscar,

Trying to upload the OpenLog custom firmware by following your instructions, but I’m a bit over my depth here. I am using a generic FTDI programmer and OpenLog I ordered recently from Banggood. I connected the 6 wires from the programmer to the OpenLog, 2 crossed over exactly as in your diagram. Chose the following options in the Arduino “Tools” menu:

Board: Arduino/Genuino Uno
Port: dev/cu.usbserial-BLAHBLAH
Programmer: USBasp (you don’t mention this one. Does this matter?)

When I click the “Upload” button, it compiles, but with 3 similar warnings in red, which include the text:
warning: ‘__progmem__’ attribute ignored [-Wattributes]

Then it gives some information about memory usage. Then it tries 10 times to sync something and gives a similar error to the one you mentioned above, that you fixed by choosing “Arduino Pro or Pro Mini”.

If I try to change the board like you did, I get all the same errors, plus more that complain that Arduino can’t connect to my board.

Any ideas as to what’s wrong? Does it matter what I choose for “Programmer”? Thanks for any help you can give!

Andrei 19th January 2016 - 3:13 am

Hi Oscar,

I bought an Arduino Uno starter kit (was wanting one anyway) and tried to do it that way. I connected Tx to Tx and Rx to Rx as your diagram shows – seems weird but nobody has corrected that so I went with it.

I had to remove the Tx/Rx connections to get the sketch to upload without error (as I remember reading was necessary elsewhere). Then I plugged them back in and reset the board. I assume it then tried to upload the custom firmware to the OpenLog.

The CONFIG.TXT file on the SD card now has these contents:


There are also several log files with names like LOG00119.TXT that look like gibberish.

Does that mean the update succeeded?

(Should we be asking these things in your new forum instead?)

Andrei 21st January 2016 - 9:23 am

Hi Oscar, sorry to spam up your post with these annoying problems. You can delete them if you wish. Having said that… 


Arduino Uno worked without a hitch and I have recorded my first logs, synced the video and exported combined video. It is awesome. I discovered that my quad is moderately noisy, D term is quite active with the default PIDs on 2Khz mode, and I might have an oscillation on P, but the graphs look pretty good overall. So great to finally see what is happening. Thanks for your guide!

Oscar 25th January 2016 - 8:07 pm

thanks for letting me now…
In future i would really appreciate it if you could post your questions on the forum: … I only check my blog comments once a week, but I use the forum everyday!

Sammy 3rd January 2016 - 10:22 pm

Can I use the logger when I’m already running a SBUS receiver in UART2 (pin4)? Can I just hook up the logger in pin3 and enable both serial RX(the SBUS receiver) and blackbox in UART2? Or should I switch the SBUS to UART1?

Still waiting for mine to arrive, meanwhile but trying to figure out how this should work.

Oscar 6th January 2016 - 12:58 pm

yea if you have a F3 FC, you can use UART3 for Blackbox :)

Sammy 18th January 2016 - 9:17 pm

But on a Naze it’s a no go? I gotta switch to a PPM RX for it to work?

Russell Holt 6th June 2016 - 4:24 am

i thought UART3 only supplied 3vdc? I also thought that SBUS uses UART3 and therefore OpenLog could not be hooked up to it?
I’m very interested to know. i have GPS, OSD & OpenLog hooked up, but I seem to be having to use PPM, giving me only 8 channels with my FrSky XSR Receiver. i’d rather be using SBUS and have the 16 channels available.

Russ from Coral Springs, FL.

Oscar 13th June 2016 - 2:44 pm

where did you get the 3V idea from? it should be 5V…

Shamsher Razzak 21st November 2015 - 11:18 am

Hey Oscar,

I love your blog, your articles have been of so much help in building and setting up my quad, thanks for all the work you put in!

i have a problem with my flip32+ v2.6, its supposed to have onboard flash 2mb, but my cleanflight configurator v1 says “your flight controller does not have a compatible dataflash chip available”. how can i identify if i have this chip or not?

Oscar 24th November 2015 - 5:44 pm

can you find a 8-legged chip on board? i just looked up flip32 v2.5 and there isn’t one.

Colby 17th November 2015 - 1:43 am

Hey Oscar,

Thanks for this great article! I tried using the blackbox on my dodo flight controller, but it doesn’t seem to be storing any more than a couple seconds of flight time. I tried wiping the data and that did not help. Have you encountered this?

Oscar 17th November 2015 - 10:27 am

HI Colby
sorry i don’t have a Dodo… sounds like a hardware fault?

Ernie 28th December 2015 - 5:33 am

The DODO only has a 2mb onboard memory for the blackbox recording.

You can try this though if you are not running and external blackbox.

Go into CLI and enter

set blackbox_rate_denom = 8

That will drop the rate of data collection and should help get you some more time. Using Betaflight with a looptime of 900 I had to do this on my external blackbox to get clean data.

Oscar 6th January 2016 - 10:54 am

you need highest resolution recording to get to see all the noise in your PID and gyro traces :)

mike 31st October 2015 - 9:12 am

Sorry, but this sentence is wrong. The ports should be reversed. Otherwise, great write up. thanks

I strongly recommend using Radio pin3 (RX) and pin4 (TX) on the Naze32 board to connect to the OpenLog.

mike 31st October 2015 - 9:14 am

Ooops, should have put the Rev3 Naze32 manual extract too:

When GPS feature is enabled, channels 3 and 4 are are used for 3.3V GPS connection.
(3:TX, 4:RX). with CPPM receiver, these are normally unused, with standard receiver,
connect AIL to 1, ELE to 2, THR to 5, RUD to 6, and AUX1/2 to channels 7 and 8.

Zac 11th October 2015 - 4:16 pm

Hi Oscar

Was the sync issue the only problem you had while uploading?
Ive been getting ‘avrdude: verification error; content mismatch’ all day and can’t seem to figure it out.
Ive tried pretty much everything, including switching boards, but can’t get past this point.

Oscar 12th October 2015 - 11:39 am

Hi Zac, i didn’t have this error.. and tried on both Arduino UNO and an dedicated FTDI programmer, both worked fine…
Not sure what Arduino IDE you are using, maybe tried the 1.0.5 version? (which was what I am using)
also try a different FTDI programmer?


SmoothFPV 9th October 2015 - 4:41 am

Hi Oscar. Always great to read your blog. For the Naze connection, you only really need 3 connections, RX, 5V and GND. There’s no bidirectional data flows because OpenLog only accepts data. Hence the config file on the SD card. There’s no reason for the OpenLog to talk back to the Naze (like a bad step-child) so you can omit the TX out from the logger.

Oscar 9th October 2015 - 11:13 am

Yes good point ! :)
I haven’t tried just 1 wire yet, when i tested it and confirm it’s working i will update the post.

Kevin 8th October 2015 - 12:48 am

Hi Oscar,

Whats the best way to get more data when using the onboard flash memory on the Naze Full?

Oscar 9th October 2015 - 11:05 am

Kevin, what do you mean by “more data”?
By default “blackbox_rate_denom” is 1, so you get full resolution of the flight data.

Geggog 14th September 2015 - 1:50 pm

Great article Oscar, especially so the point of selecting the Arduino Pro Mini for uploading the sketch – this had me truly stumped.

I’ve now got this up and running, albeit with one small issue. I can see that the data is being logged to the OpenLog correctly (I can eject the card and read it on my laptop via an SD card adapter), but for some reason when I attempt to read the data via CleanFlight configurator (Dataflash screen) I’m told that “Your flight controller does not have a compatible dataflash chip available.”

Should I be able to read the data off the MicroSD card via the Dataflash screen? Or is this only available when using storage on-board the flight computer? Any assistance you could provide would be much appreciated.

FWIW, I have wired up the OpenLog to pins 3/4 with UART2 configured to 255000 baud as you’ve recommended.

Oscar 14th September 2015 - 5:28 pm

HI Geggog,
if you are using OpenLog and SD card, you can only read the data by taking out the SD card, and read it with a SD card adpater.
You cannot read it via Cleanflight configurator, that’s only for onboard Dataflash memory which is only available on Naze32 full, or CC3D…

Geggog 15th September 2015 - 10:00 am

Ahhh right, I suspect this may be the case – I appreciate the prompt response!

Ricardo Smits 5th September 2015 - 8:32 pm

Hi Oscar,

I was wondering, Is it possible to run both the micro minim osd and the black box at the same time?

Thanks for the post btw, helps a lot!

Oscar 7th September 2015 - 12:37 pm

Hi Ricardo, yes it is, that’s what i am running on my Evo250, MinimOSD on UART1, and Blackbox on UART2.
but you need to unplug minimOSD TX/RX from FC when connecting to cleanflight, when the quad is powered on.

Ricardo Smits 14th September 2015 - 9:45 pm

Hi Oscar,

Got everything working today although I have a new question: Why do you have the baud rate at 250k in the settings at Cleanflight? I saw that the baud rate was 115k in the .txt file from the blackbox and it is working fine. Any particular reason you did that?

Now off to tuning. Quad flies ok out of the box with standard settings but has a big wobble with throttle puch outs. Wish me luck haha.

Oscar 16th September 2015 - 3:35 pm

for looptime lower than 2500, 250k baud rate is recommended to avoid missing data (explained in the post)

Kevin Yang 3rd September 2015 - 10:50 am

So I cannot use sbus because I have to use uart2 serial for rx.
Do I change my reciver to cppm?
Thank you.

Oscar 3rd September 2015 - 5:08 pm

yea you can do that, you can go back to SBUS on UART2 after you tune your quad with blackbox.

Kevin Yang 4th September 2015 - 2:19 am

Thank you for your help!
BTW I got compile error in firmware.(It works Epprom clean)
I will check the arduino book. maybe check the library but I cannot find in mac :-)
Thank you again

Kevin Yang 4th September 2015 - 5:16 am

Forget it about compile. I just did compile all safely. Thank you for your info.

Kevin Yang 4th September 2015 - 9:41 am

Thank you very much Oscar!

Nicholas 29th August 2015 - 6:14 pm

I hope u can come with tutorial how to read the blackbox data.

Oscar 30th August 2015 - 5:40 pm

Yes that’s coming soon!

Ian 22nd August 2015 - 6:24 am

Hi Oscar,
The photo showing the connections from Arduino One board to OpenLog board shows Tx connected to Tx and Rx to Rx? Shouldn’t it be Tx to Rx and Rx to Tx? When run the Serial port HEllo World it works the latter way.

I’m having zero success getting it to program from Aurduino board. When I compile and upload the new firmware, it just logs it as garbage to a new log file. It’s not modifying the firmware, even with Reset pin connected..

Oscar 24th August 2015 - 10:52 am

1. did you flash the openlog firmware for blackbox?
2. you have chosen the correct board in Arduino IDE as I pointed out?
3. have you specified a baud rate in the config file on the SD card? are you using the correct baud rate in Cleanflight?

blackmennewstyle 19th August 2015 - 5:50 pm

Hi Oscar,

So bore this windows guys, they are so lazy :p If you were using GNU/Linux you could transform easily your WEBM file to MP4 file or whatever you want with FFmpeg or Avconv :p Maybe FFmpeg is available now for windows…

Very nice tutorial by the way :)
Thanks for sharing!

Oscar 20th August 2015 - 10:05 am

haha yes they are, but they are doing it for free so can’t blame them!
I will look into FFMpeg! thanks! It would make life so much easier :)