User Tools

Site Tools

Translations of this page:

howto:fc_patcher_tool

FC Patcher Tool

orig content here: https://github.com/o-gs/DJI_FC_Patcher credit to the og's and all contributors

This guide explains how to use the FC patcher tool for Windows. The tool / process allows you to modify flight controller parameters on the the LATEST DJI firmware for the DJI Mavic Pro and Platinum, Phantom 4/Pro/Adv, Inspire 2 and Spark. This does NOT work on the Mavic 2.

Insert disclaimer here ..

Toolset

Make sure to review this GitHub with more info: https://github.com/o-gs/dji-firmware-tools

  1. Download image.py
  2. Download Python 2
  3. Download Python 3
  4. Download an app to allow running .SH files on Windows; i used github as my app
  5. Download CYGWIN to allow running .sh on Windows Cygwin
  6. Download and install a file extraction app like winrar or winzip
  7. Download pcrypto by running this from a command line python -m pip install pycryptodome

Put ALL of the files and the firmware bin file in same folder, such as C:\fcpatcher. This how to will refer to c:\fcpatcher folder. Also Unzip the zipped files and put their respective folder under C:\fcpatcher

Install any/all apps you may be missing. This includes python 2 and 3, Android SDK, Github (or other app), winrar and pcrypto. Make sure to SET PATH for Python. If you don't know what this means, google it.

Detailed Steps

1. Install that toolset

Get the tool set noted above all setup, downloaded and installed. Without, this doc is worthless.

2. Extract the firmware file

  1. Open Winrar/Winzip
  2. Open the firmware file you downloaded, such as V01.04.0300_Mavic_dji_system.bin
  3. Extract the .CFG.SIG, the 305 and 306 files to the c:\fcpatcher folder

3. Extract / unsig the .cfg file

  • Open a command prompt and type
  cd\fcpatcher <Enter>
  image.py wm220.cfg.sig
  move wm220.cfg_0000.bin wm220.cfg.ori
  • The file is now extracted.

4. Unsig the 0306 file

There are two ways to unsig the 306 file:

  • Use the dji_imah_fwsig.py tool
  • Copy the 306 file to the aircraft and use djiverify
Use the dji_imah_fwsig.py tool

Download the tool from here https://github.com/o-gs/dji-firmware-tools/raw/master/dji_imah_fwsig.py Open a command line and run the tool Example: python dji_imah_fwsig.py -vv -u -i wm335_0306_v03.03.04.10_20180429.pro.fw.sig

You are done, goto step #5

Copy the 306 file to the AC

Now we will unsig the 306 file, which contains the flight controller parameters. You will need to power on your aircraft and connect to PC via USB. Once you have ..

  • Open a command prompt start→run→cmd
  • Type the following commands
  adb shell
  mount -o remount,rw /vendor
  mkdir /vendor/bin
  exit
  • Now, lets copy the flight controller module to the aircraft.
  • Open a command prompt start→run→cmd . Then, type the following commands:
 adb push wm220_0306_v03.02.44.07_20171116.pro.fw.sig /vendor/bin/ 
 ^^^ (replace the filename if different ac)

* Now lets go back to a shell, type

 
 
 adb shell
 cd /vendor/bin/
 /sbin/dji_verify -n 0306 -o 0306.unsig wm220_0306_v03.02.44.07_20171116.pro.fw.sig 
 ^^^ (replace the filename if different ac)
 exit
 
  • Now lets get the updated module. Type
 adb pull /vendor/bin/0306.unsig
  • Now, some housecleaning
 adb shell
 cd /vendor/bin/
 rm 0306.unsig
 rm *.fw.sig
 cd /
 sync
 mount -o remount,ro /vendor
 exit
 

You can now power off your aircraft.

5. decrypt the FC

  • Goto a command prompt and type
 dji_mvfc_fwpak.py dec -i 0306.unsig
 move 0306.decrypted.bin wm220_0306_v03.02.44.07_20171116.pro.fw_0306.decrypted.bin
 ^^ (replace the filename if different ac)

6. Extract flight controller parameters

  • Goto a command prompt and type
 dji_flyc_param_ed.py -vv -x -b 0x420000 -m wm220_0306_v03.02.44.07_20171116.pro.fw_0306.decrypted.bin 
 ^ (replace the filename if different ac)

This will generate a flyc_param_infos file with all the flight parameters that you are able to modify.

7. Modify flight controller parameters

  • Open the flyc_param_infos file in notepad++ or similar editor. Values will look like this:
 {
	"index" : 5,
	"typeID" : 0,
	"size" : 1,
	"attribute" : 43,
	"minValue" : 1,
	"maxValue" : 2,
	"defaultValue" : 1,
	"name" : "g_config.flying_limit.height_limit_enabled"
	"modify" : true
},

You will be modifying the “DefaultValue” value. We will not be changing ANYTHING else. In the example above, we would replace “defaultValue” : 1 with “defaultValue” : 2 (changing 1→2, per the table below). Dont change or edit anything other than the default value.

Parameter Name Value Description
g_config.airport_limit_cfg.cfg_disable_airport_fly_limit1
g_config.airport_limit_cfg.cfg_limit_data20250910
g_config.flying_limit.driver_license_limit_enable 2
g_config.flying_limit.viechle_license_limit_enable2
g_config.flying_limit.height_limit_enabled2
g_config.airport_limit_cfg.cfg_search_radius1
g_config.airport_limit_cfg.cfg_enable[FLY_LIMIT_TYPE_AIRPORT]1
g_config.airport_limit_cfg.cfg_enable[FLY_LIMIT_TYPE_SPECIAL]1
fly_limit_height10000
g_config.mode_normal_cfg.tilt_atti_range33
g_config.mode_normal_cfg.vert_vel_up7
g_config.mode_normal_cfg.vert_vel_down-6
g_config.mode_normal_cfg.vert_acc_up7
g_config.mode_normal_cfg.vert_acc_down-6
g_config.mode_sport_cfg.tilt_atti_range50
g_config.mode_sport_cfg.vert_vel_up8
g_config.mode_sport_cfg.vert_vel_down-8
g_config.mode_sport_cfg.vert_acc_up8
g_config.mode_sport_cfg.vert_acc_down-8
g_config.fw_cfg.max_speed20
g_config.avoid_cfg.avoid_atti_range23
g_config.control.avoid_atti_range50
bat_level_2_action0
bat_cap_v2_prot_type0
g_config.bat_config.level2_smart_battert_land0

Note: This is a draft list as of 9-Aug-19

- I dont believe “g_config.flying_limit.height_limit_enabled” works in FC Patcher. Instead, modify FLY_LIMIT_HEIGHT

- This needs to be broken out NFZ, height, speed, battery #TODO

- need to include Bret883's other parameters in this

- lets create a seperate wiki page for FC Patcher params #TODO

8. Set path

We need to tell the script what folder contains the firmware tools and other files.

You need to edit FC_patch_sequence_for_dummy_verify.sh and you will see the following

if -z "${PATH_TO_TOOLS}"; then echo “Define PATH_TO_TOOLS variable to use this script! eg:” echo “PATH_TO_TOOLS=/tmp/tools/ ./FC_patch_sequence_for_dummy_verify.sh” exit 1

Change the PATH_TO_TOOLS to be wherever you have all the files, such as C:\fcpatcher

9. Run the SH script

  • Goto a command prompt and type
 FC_patch_sequence_for_dummy_verify.sh Mavic 03.02.44.08

You can change Mavic to your Aircraft, such as P4P, Spark, etc. The version number is the NEW version you are setting.

Note: This step requires some tool to enable running sh scripts on windows. I installed Github with bash and it had the SH included to allow running the script.

This should produce a few (uncleaned) tmp files, and a *dummy_verify.bin file which is the one you will be able to flash the aircraft using dumldore

9. Install the dummy_verify.sh script on your bird

Open dumldore Press ENABLE ADB, wait a second. Close dumldore

IF, during this step, adb shell fails, you do not have adb access. GO back to dumldore and press ENABLE ADB.

* Goto a command prompt and type

 cd\fcpatcher
 adb shell
 mount -o remount,rw /vendor
 exit
 adb push dummy_verify.sh /vendor/bin/
 adb shell
 cd /vendor/bin/
 chown root:root dummy_verify.sh
 chmod 755 dummy_verify.sh
 cp /sbin/dji_verify /vendor/bin/original_dji_verify_copy
 sync
 cd /
 mount -o remount,ro /vendor

Turn off the aircraft.

10. Flash the .bin file you made earlier

  • Power the aircraft back on
  • Open a command prompt and type
 adb shell
 mount -o bind /vendor/bin/dummy_verify.sh /sbin/dji_verify

Open dumldore v3, load firmware and flash it. You may need to hold down either ctrl or shift when clicking 'load firmware' to allow it to see this firmware file.

Few notes:

  • The displayed percentage will be wacky, it will go over 100% at some points
  • If you want to view the update you can type
 adb shell
 busybox tail -f /data/dji/log/upgrade00.log
  • You can also view in assistant, use 1.1.2
  • After 10-20 seconds you should see the update go as regular; on Spark the ESC may beep while being updated.
  • The aircraft will reboot in about a minute or so. If you were monitoring via adb, it will lose connection.

Thats it you are done. The mods you modified in the flight parameters file will be in the aircraft. To reset, you will want to reinstall the firwmare using assistant or dumldore.

Note: This mod also allows enabling Galileo GPS but I have not included steps on doing so. Please see Github original for additional help on setting this up.

Remember, with great power comes great responsibility. Please don't use this tool set, guide or info to fly in restricted, dangerous or sensitive areas. Aka, don't be a dumbass when flying.

howto/fc_patcher_tool.txt · Last modified: 2020/01/25 23:09 by digdat0