About
Some time ago I bought a NAZE32 F3 flight controller for less than 10$ thinking I could use it for a cheap quadcopter build. But when I tried configuring the GPS it didn’t work. At first, I thought I did something wrong or there was a bug, but as it turns out the GPS feature was removed for F3 flight controllers. The frustrating thing is that this isn’t mentioned anywhere. As a result, I spent hours trying to figure out what the problem was until I found out that the feature was removed. Anyway, the solution is to manualy add in the GPS feature yourself and compile your own version of the firmware.
What we will be doing
In this post, we’ll take a look at how to add/remove features from Cleanflight/Beatflight. In this instance, I will be adding the GPS feature back and remove some of the other features to free up enough resources for the GPS. Using the same process you can add/remove any features you want.
Prerequsites
Before we get started I will assume that you already have the development environment set up and know how to compile the firmware. If you don’t you can check out this tutorial on how to compile the firmware and this tutorial on how to set up Ubuntu on Windows.
Hardware used
- #adAmazon LinkF3 Flight Controller
How to do it
mv -r /home/DTPCLX/cleanflight/ /mnt/c/Users/DTPC/Desktop/
Before:
#if (FLASH_SIZE > 128) #define USE_CAMERA_CONTROL #define USE_CMS #define USE_EXTENDED_CMS_MENUS #define USE_DSHOT_DMAR #define USE_GYRO_OVERFLOW_CHECK #define USE_YAW_SPIN_RECOVERY #define USE_HUFFMAN #define USE_MSP_DISPLAYPORT #define USE_MSP_OVER_TELEMETRY #define USE_PINIO #define USE_PINIOBOX #define USE_RCDEVICE #define USE_RTC_TIME #define USE_RX_MSP #define USE_SERIALRX_FPORT // FrSky FPort #define USE_TELEMETRY_CRSF #define USE_TELEMETRY_SRXL #define USE_VIRTUAL_CURRENT_METER #define USE_OSD_ITEM_POSITIONS #define USE_VTX_COMMON #define USE_VTX_CONTROL #define USE_VTX_SMARTAUDIO #define USE_VTX_TRAMP #define USE_GYRO_LPF2 #define USE_ESC_SENSOR #define USE_ESC_SENSOR_INFO #define USE_CRSF_CMS_TELEMETRY #define USE_BOARD_INFO #define USE_SMART_FEEDFORWARD #define USE_THROTTLE_BOOST #define USE_RC_SMOOTHING_FILTER #define USE_ITERM_RELAX #ifdef USE_SERIALRX_SPEKTRUM #define USE_SPEKTRUM_BIND #define USE_SPEKTRUM_BIND_PLUG #define USE_SPEKTRUM_REAL_RSSI #define USE_SPEKTRUM_FAKE_RSSI #define USE_SPEKTRUM_RSSI_PERCENT_CONVERSION #define USE_SPEKTRUM_VTX_CONTROL #define USE_SPEKTRUM_VTX_TELEMETRY #define USE_SPEKTRUM_CMS_TELEMETRY #endif #endif #if (FLASH_SIZE > 256) #define USE_DASHBOARD #define USE_GPS #define USE_GPS_NMEA #define USE_GPS_UBLOX #define USE_GPS_RESCUE #define USE_OSD #define USE_OSD_OVER_MSP_DISPLAYPORT #define USE_OSD_ADJUSTMENTS #define USE_SENSOR_NAMES #define USE_SERIALRX_JETIEXBUS #define USE_TELEMETRY_IBUS #define USE_TELEMETRY_IBUS_EXTENDED #define USE_TELEMETRY_JETIEXBUS #define USE_TELEMETRY_MAVLINK #define USE_UNCOMMON_MIXERS #define USE_SIGNATURE #define USE_ABSOLUTE_CONTROL #endif #define USE_RCSPLIT
After:
#if (FLASH_SIZE > 128) #define USE_CAMERA_CONTROL #define USE_CMS #define USE_EXTENDED_CMS_MENUS #define USE_DSHOT_DMAR #define USE_GYRO_OVERFLOW_CHECK #define USE_YAW_SPIN_RECOVERY #define USE_HUFFMAN #define USE_MSP_DISPLAYPORT #define USE_MSP_OVER_TELEMETRY #define USE_PINIO #define USE_PINIOBOX #define USE_RCDEVICE #define USE_RTC_TIME #define USE_RX_MSP #define USE_SERIALRX_FPORT // FrSky FPort #define USE_TELEMETRY_CRSF #define USE_TELEMETRY_SRXL #define USE_VIRTUAL_CURRENT_METER #define USE_OSD_ITEM_POSITIONS #define USE_VTX_COMMON #define USE_VTX_CONTROL #define USE_VTX_SMARTAUDIO #define USE_VTX_TRAMP #define USE_GYRO_LPF2 #define USE_ESC_SENSOR #define USE_ESC_SENSOR_INFO #define USE_CRSF_CMS_TELEMETRY #define USE_BOARD_INFO #define USE_SMART_FEEDFORWARD #define USE_THROTTLE_BOOST #define USE_RC_SMOOTHING_FILTER #define USE_ITERM_RELAX #define USE_GPS #define USE_GPS_NMEA #define USE_GPS_UBLOX #define USE_GPS_RESCUE #ifdef USE_SERIALRX_SPEKTRUM #define USE_SPEKTRUM_BIND #define USE_SPEKTRUM_BIND_PLUG #define USE_SPEKTRUM_REAL_RSSI #define USE_SPEKTRUM_FAKE_RSSI #define USE_SPEKTRUM_RSSI_PERCENT_CONVERSION #define USE_SPEKTRUM_VTX_CONTROL #define USE_SPEKTRUM_VTX_TELEMETRY #define USE_SPEKTRUM_CMS_TELEMETRY #endif #endif #if (FLASH_SIZE > 256) #define USE_DASHBOARD #define USE_OSD #define USE_OSD_OVER_MSP_DISPLAYPORT #define USE_OSD_ADJUSTMENTS #define USE_SENSOR_NAMES #define USE_SERIALRX_JETIEXBUS #define USE_TELEMETRY_IBUS #define USE_TELEMETRY_IBUS_EXTENDED #define USE_TELEMETRY_JETIEXBUS #define USE_TELEMETRY_MAVLINK #define USE_UNCOMMON_MIXERS #define USE_SIGNATURE #define USE_ABSOLUTE_CONTROL #endif #define USE_RCSPLIT
#define USE_BRUSHED_ESC_AUTODETECT // Detect if brushed motors are connected and set defaults appropriately to avoid motors spinning on boot #define USE_CLI #define USE_GYRO_REGISTER_DUMP // Adds gyroregisters command to cli to dump configured register values #define USE_PPM #define USE_PWM #define USE_SERIAL_RX #define USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol #define USE_SERIALRX_IBUS // FlySky and Turnigy receivers #define USE_SERIALRX_SBUS // Frsky and Futaba receivers #define USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol #define USE_SERIALRX_SUMD // Graupner Hott protocol #define USE_SERIALRX_SUMH // Graupner legacy protocol #define USE_SERIALRX_XBUS // JR
#define USE_BRUSHED_ESC_AUTODETECT // Detect if brushed motors are connected and set defaults appropriately to avoid motors spinning on boot #define USE_CLI #define USE_GYRO_REGISTER_DUMP // Adds gyroregisters command to cli to dump configured register values #define USE_PPM #define USE_PWM #define USE_SERIAL_RX #undefine USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol #undefine USE_SERIALRX_IBUS // FlySky and Turnigy receivers #define USE_SERIALRX_SBUS // Frsky and Futaba receivers #undefine USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol #undefine USE_SERIALRX_SUMD // Graupner Hott protocol #undefine USE_SERIALRX_SUMH // Graupner legacy protocol #undefine USE_SERIALRX_XBUS // JR
cd /mnt/c/Users/DTPC/Desktop/cleanflight/ make TARGET=NAZE
Hi! Because of your awesome instructions here on this blog I was able to successfully make it work to have Cleanflight with GPS for SPF3 Deluxe. Thank you very much for your effort invested into these articles and thank you for keeping them online! Best regards, Jo
I’m glad my post was helpful to you.
Thanks for the heads up, Interesting thing though, most of the F103 chips actually have 128KB flash and make TARGET=CC3D still works on the current source, removing the unused RX stuff produces a HEX that uses 99.something% of 128KB so it’d fit but would need to be flashed with STLink I think?
I’m kinda almost tempted to try and fly it but I’m a n00b quad pilot (Starting out with a really cheap 450 frame, motors etc. to get some experience, seriously impressed with the value from the FlySky TX/iA6B combo) and it’s proving hard enough to get a grip on flying with the stock LibrePilot/CC3D stuff before I star throwing randoms like a modded version of Clean/Betaflight in there.
Wondering if you think there’s significant advantage to buying a couple of F4 controllers as they’re not much more expensive than the CC3Ds I have or if it’s worth jumping straight to F7?
Hi, you should be able to flash your flight controller through the Betaflight/Cleanflight software on your PC. You can load your .hex file by clicking the “Load Firmware[local]” button. See the last part of this post I made: https://eecs.blog/compiling-betaflight-cleanflight-firmware-for-your-multirotor/
You can mod the firmware to include the GPS but keep in mind that if you ever want to update the firmware to the latest version you will always have go through this process of compiling your custom version. If GPS is an important feature to you I suggest you take a look at INav which is a Cleanflight clone with GPS in mind.
I would say that flight controllers like F1s, F2s, and F3s can still be used you just have to make a choice: Do you want a racing oriented quadcopter or not. If so use Beat/Cleanflight if you want GPS use INav. If you want both then consider F4s and F7s.
I don’t know how much difference there is between an F4 and F7 as I currently only own a quad with an F4. But I would recommend getting at least an F4 flight controller as the F3s are kind of outdated.
Hello Tsla
Great tutorial Congratulations. I will try to ask for help to do it, because it exceeds my knowledge.
I would like to use an old FC Flip32 + F1 (naze 32 6dof F1) with GPS and PPM Receiver, as a flight controller in a flying wing
with Cleanflight. I try to navigate waypoints, RTH, hold, etc
Would you be so kind to compile a trial version for me, I thank you in advance
regards
Thanks a lot
Sergio
my FC is flip32 + F1 https://www.dronetrest.com/t/flip-32-naze-32-flight-controller-guide/634
I don’t think this would be possible for F1 flight controllers as they don’t have enough memory. I would recommend you to look at INav which is a “clone” of Celanflight but with GPS navigation in mind. All INav versions have GPS as that is the main focus of INav.
INav: https://github.com/iNavFlight/inav/wiki
Thank you for your response. I will start working with INAV.
best regards
Sergio
Hi Tsla,
I spent 3 hours today trying to get this to work. I did all the prerequisites which was a true learning expierence and I was able to successfully get to the last step and got an error when trying “navigate to the cleanflight folder and compile”.
I don’t know what went wrong but if you could assist or create the file for me It would be greatley appreciated.
I am running a Naze32 on PWM with Turnigy.
Thanks!
https://drive.google.com/file/d/1XTEDGPGf4nH4LfH9vU15tA9Og475zz0I/view?usp=sharing
Whatever I try, I cannot get cleanflight to connect to the board after flashing that file. I believe it may be because of how new v2.5. Could you do v2.2 instead? Maybe its something entirely different? Thank you for your help so far!
https://drive.google.com/file/d/1TBUy6kdIf_T-XLGh5RcTXnc5y9rO-aMJ/view?usp=sharing
That is too bad I was really hoping for this. Thanks a lot for trying for me. I do really appreciate it and I like how the quad community tries to help each other.
Can you compile a GPS version for the SPRACINGF3. With PWM connection. I tried but GPS won’t enable. Can you post it here?
https://drive.google.com/file/d/1Izgs3_RmXvd7JVCwL6y1sjtlzoJLR2rk/view?usp=sharing
hello, i have a cuestion, i have flashed my card with your firmware, now i can enable the gps but now, the gps doesnΒ΄t apears enabled in cleanflight, also in te gps notch, the gps doesnt seems to be working or capting gps signal, iΒ΄ve done all i have to do to enable it, go to uart2, gps, then configurations and enable the gps notch.
y use the ublox op gps
Can you post a screenshot? And have you set up your gps module with the U-Center software?
Thank you updating the firmware. When I install this firmware I can enable the GPS, however, once the GPS is enabled my FRSKY X9D Plus stops working; I can only use switches but joysticks stops working all together. I’m using PWM RX Input (one wire per channel). Also, I noticed when the GPS is enabled the icon on the cleanflight doesn’t appear as Green though. Can you please provide some assistance?
Hi. Did you upload the firmware from the link I posted above? If so what flight controller are you using?
i have this exact same FC and cant get gps to work, I am also unable to follow this guide very well, is there anyway you can send me the file and instructions how to flash without all the editing and coding you did please?
To add in the GPS feature we first have to remove some other features to make enough “space”. In my case, I disabled the support for all the receivers except for the Fr Sky which I use. If you tell me what receiver/protocol (PPM, CPPM, SBUS, …) you are using I can leave that one in and disable all the others. This now leaves us with enough space for the GPS. I could then compile the firmware and send you the file which you have to flash(upload) to your flight controller. See how to do that at end of this post:
https://eecs.blog/compiling-betaflight-cleanflight-firmware-for-your-multirotor/
Open Cleanflight => connect to the board => click “Load Firmware[Local]” => select the firmware file => click the “Flash Firmware” button.
Hi, got same GPS problems:)
Awesome help! – done everything… but have no idea what to undefine – using simple FS-R6B connection by PPM -> SPRACINGF3 V1:)
ouu sorry I forgot – need to release 20584 bytes;)
Did you figure out everything or do still you need some help? π
Hi Tsla
I saw this post today and I am trying to load a GPS version of firmware to my F3 board. I do not know how to code and is there a file to just flash the firmware to my existing board that eliminates the unneeded things and makes room for the new firmware. I use crossfire so i am not sure if that matters.
If you already have a file that I could just upload that would be awesome.
thanks
I forgot to tell you that I use Betaflight not Cleanflight
For the connection between your flight controller and receiver do you use PPM, CPPM or the actual crossfire protocol?
I have a TBS crossfire nano RX on UART 3
I have a crossfire micro module
Sorry but I am having trouble compiling the betaflight firmware. I was only able to do it for cleanflight.
That is too bad I was really hoping for this. Thanks a lot for trying for me. I do really appreciate it and I like how the quad community tries to help each other.