1. How to compile your first (unusable) firmware - GrumpyMeow/XiaomiXiaofangFirmware GitHub Wiki

Locate the VirtualBox appliance file "SN986-buildenv-x86.ova"

Install VirtualBox

Import the appliance file

Modify the settings of the imported virtual machine

Start the VM

Login

  1. login as dev (or root), password "devel"

Modify the keyboard layout (if needed)

  1. Click "Applications Menu" > "Administration" > "Keyboard"
  2. Change keyboard layout to "US International"

Disable the screen saver

  1. Click "Applications Menu" > "Settings" > "Screen saver"
  2. Disable the screen saver.

Make a firmware using the already present SDK

  1. execute: "cd SN986_1.50_037a_20151022_1049"
  2. execute: "cd snx_sdk"
  3. execute: "cd buildscript"
  4. execute: "make sn98660_402mhz_sf_defconfig"
  5. execute: "make" This will result in an error "isp3: No such file or directory.". This is caused by that the isp3 folder is missing at: "/home/dev/SN986_1.50_037a_20151022_1049/snx_sdk/driver/video/ko/isp3". The fix is to modify: /home/dev/SN986_1.50_037a_20151022_1049/snx_sdk/driver/video/ko/Makefile Line 10: "ISP2 = isp3" > "ISP2 = isp2" Do this also for: /home/dev/SN986_1.50_037a_20151022_1049/snx_sdk/driver/video/ko_rescue/Makefile Do this also for: /home/dev/SN986_1.50_037a_20151022_1049/snx_sdk/driver/iq/ko/Makefile Do this also for: /home/dev/SN986_1.50_037a_20151022_1049/snx_sdk/driver/iq/ko_rescue/Makefile
  6. re-execute: "make"
  7. execute: "make install"

Result

In the folder /snx_sdk/image there should now be some file which can be used to flash the compiled firmware. Be aware though: this firmware is not compatible with the Xiaomi Xiaofang camera! The reason is that the Xiaofang uses a SmartSens SC2135 optical sensor. Unfortunatly this driver is not present in this VM. Also there seems no sourcecode available for this sensor.