This repository has been archived by the owner on May 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Mavic: Reverse Engineering
Kevin Elliott edited this page Nov 30, 2016
·
9 revisions
Component | Purpose | Details | Notes |
---|---|---|---|
Atheros AR6004 | Wifi | Spec Sheet, Data Sheet | Dual-band power-efficient 802.11a/b/g/n WLAN 2.4ghz and 5ghz |
Leadcore LC1860 | Camera, LTE (optional support) | Spec Sheet | Camera processing SoC. Looks to support LTE for optional external LTE transceiver. |
Realtek RTL8723BS | Wifi, Bluetooth | Spec Sheet | Single-band 802.11b/g/n WLAN, Bluetooth 4.0 BLE, FM Radio (SDR?) |
Component | Purpose | Details | Notes |
---|---|---|---|
Android 4.4 | Operating System | Used as a base OS for easy embedded support and low-power | |
Custom Scripts | Feature integration | A variety of in-house scripts are integrating with different components, managing the system, updating components, or otherwise ensuring the system is running correctly |
Command | Purpose |
---|---|
adb_en.sh | Enable Android Debugging over USB. |
aging_temp_monitor.sh | Factory aging test temperature monitor. |
aging_test.sh | Factory aging test. |
antenna_switch.sh | Switch between SDR and WIFI modes. |
athsoftap.sh | Setup the Atheros wifi. |
bmgr | Start Android bmgr. |
camera-AP-308.cts | Show the camera preview at 1920x1088. |
camera_stress.cts | Factory stress test for the camera. |
check_1860_state.sh | Evaluate the state of the Leadcore 1860. |
check_lmi42_state.sh | Evaluate the state of the LMI42. |
dji_log_control.sh | DJI log control management. |
dji_net.sh | Setup LMI42 network. |
dji_vision_log_check.sh | Legacy? |
efuse_dump_check.sh | Compare OTP dump to OTP reference. |
efuse_enck.sh | Check EFUSE encryption. |
efuse_step1.sh | Check OTP. |
efuse_step2.sh | Does nothing now. Legacy. |
factory_out_test.sh | Factory out test. Not used anymore. Legacy. |
get_test_result.sh | Utility for determining if a test passes or not. |
ime | Start Android ime. |
input | Start Android input. (Why?) |
in_whitelist.sh | Check against the whitelist. |
lib_env.sh | Setup some common global variables. |
lib_test.sh | Support routines for tests. |
lib_test_cases.sh | Support routines for tests. |
lib_test_stress.sh | Support routines for tests. |
lib_test_utils.sh | Support routines for tests. |
load_wifi_modules.sh | Load wifi driver kernel modules. |
modem_info.sh | LMI42 modem support functionality. |
monkey | Starts Android monkey. |
nr.cl | OpenCL: Noise reduction algorithm. (TYPOS!) |
otp_flag.sh | OTP flag commands. |
panic_tombstone_check.sh | Panic/tombstone check support. |
parse_logcat.sh | Logging for various services/modules. |
part_check.sh | Check partitions and mounts. |
pm | Start Android power management. |
quit_offline_liveview.sh | Quit the quality test mode for live view. |
recovery_update.sh | Ensure the recovery image is up to date. |
secure_debug.sh | Enable secure debug (DJI backdoor). |
set_country_code.sh | Store the country code. |
set_test_result.sh | Factory test result output. |
set_time.sh | Set the system time. |
setup_usb_serial.sh | Set up Android Debugger USB. |
start_dji_system.sh | Main DJI system startup procedure. |
start_offline_liveview.sh | Start the quality set mode for live view. |
stress_test.sh | Factory stress test. |
svc | Start Android svc. |
test_a9.sh | Diagnostic test: A9. (Android?) |
test_a9_link.sh | Diagnostic test: A9 YUV, SD card, image sensor, etc. |
test_a9_usb.sh | Diagnostic test: Ping computer from device. |
test_boardsn.sh | Diagnostic test: Board serial number. |
test_cam.sh | Diagnostic test: Camera. |
test_cp_reset.sh | Diagnostic test: CP test reset. |
test_cp_uav.sh | Diagnostic test: CP test. |
test_cpld.sh | Diagnostic test: CPLD. (?) |
test_enck.sh | Diagnostic test: Encrypt check. |
test_fc.sh | Diagnostic test: Fly control. |
test_fc_status.sh | Diagnostic test: Fly control status. |
test_fc_usb.sh | Diagnostic test: Support for USB flight control. |
test_flash.sh | Diagnostic test: Flash test. No longer used. Legacy. |
test_get_psk.sh | Diagnostic test: WIFI PSK (not yet implemented). |
test_get_ssid.sh | Diagnostic test: WIFI SSID (not yet implemented). |
test_glass_key.sh | Diagnostic test: Glass key (does not exist; was mentioned in dji_sys binary). |
test_m0.sh | Diagnostic test: M0. (?) |
test_mac_addr.sh | Diagnostic test: WIFI MAC address. |
test_mem.sh | Diagnostic test: Memory. |
test_mp_stage.sh | Diagnostic test: MP stage. (?) |
test_multi_enc.sh | Diagnostic test: Multi-encode. |
test_ota.sh | Diagnostic test: Verify OTA image. |
test_pair_key.sh | Diagnostic test: Pair key test. |
test_productsn.sh | Diagnostic test: Product serial number. |
test_sdr.sh | Diagnostic test: SDR network connection. |
test_switch_gpio.sh | Diagnostic test: GPIO switch. |
test_thermal.sh | Diagnostic test: Temperature of 1860, A9, PA. |
test_uav.scr | Diagnostic test: Network speed tests. |
test_ultra_reset_pin.sh | Diagnostic test: Some kind of GPIO pin reset test. (?) |
test_wifi.sh | Diagnostic test: Wifi. |
test_wifi_antenna.sh | Diagnostic test: Wifi signal strength. |
test_wifi_init.sh | Diagnostic test: Init wifi for test. |
test_wifi_link.sh | Diagnostic test: Wifi link. |
wifi_debug.sh | Capture wifi debugging output. |
wifi_ff_tx.sh | Start wifi fixed frequency transmit. |
wifi_profiled_debug.sh | Capture profiled wifi log. |
wl_link_judge.sh | Determine if board supports WIFI/SDR hardware switch. |
Command | Purpose |
---|---|
test_opencl_nr | Diagnostic test: OpenCL-based noise reduction. |
- Check partitions.
- Set CPU affinity for eMMC.
- Set CPU affinity for DMA.
- Evaluate whether to be in SDR or WIFI mode.
- Set mode for SDR or WIFI based on previous result.
- Examine assert log for size and prune if larger than 32KB.
- Set number of SDRs to 1.
- Set debugging off.
- If engineering version:
- Set debugging on.
- If not engineering version:
- Look for system board in a whitelist and enable debugging if exists.
- If debugging is enabled:
- Turn on ADB (Android Debugger) over USB.
- If debugging is not enabled:
- Set USB to RNDIS, Mass Storage, Bulk, and ACM.
- Enable SDR logging.
- Set the IP address of the USB network interface (usb0).
- Set the IP address of the RNDIS network interface (rndis0).
- Create some directories if they don’t exist yet.
- Clear previous DHCP daemon leases.
- Start DHCP daemon (udhcpd).
- Start FTP server on all interfaces.
- Create some directories if they don’t exist yet.
- Clean up dump files.
- Move previous dumps to an incremented filename.
- Create new dump directory.
- Move the newest dump into place if it exists.
- Start the SDR network to the UAV.
- Start DJI services.
- Enable monitor service.
- Enable HDVT service.
- Enable encoding service.
- Enable system service.
- If there is an SSD:
- Loop for 25 times attempting to mount the SSD.
- Enable vision service.
- Start the debugger daemon.
- Create some directories if they don’t exist yet.
- If the field trail is enabled:
- Enable libc malloc debug.
- Store logical to flash (for tracing issues).
- Set AMT state if it exists.
- Dump system/upgrade log to a special file:
- Remove upgrade log tarball (temporary file).
- Increment log filenames.
- Dump logcat to lowest log filename.
- If AMT state is FACTORY OUT:
- Remove old log.
- Test the FPGA up to 2 times.
- Set AMT state to FACTORY if it passes.
- When AMT state is FACTORY, AGING TEST, or FACTORY OUT:
- Kill encoding service.
- When AMT state is FACTORY:
- Enable writing to bootarea1 (for encoding).
- If filesystem test is enabled:
- Test the filesystem’s write capability.
- If wireless mode is SDR:
- Enable IP forwarding for IPV4.
- Forward packets between GLASS (bird?) and RC (remote control).
- Drop all other packets.
- If SDR testing is enabled:
- Test the SDR.
- If SDR testing is not enabled:
- If wireless mode is WIFI:
- Ensure that SSID is Mavic* not Maverick*.
- Set the PSK if it is configured, otherwise use the default (32ee9aa4).
- Set the MAC address if it is configured.
- Start the network service.
- If the wireless mode is not WIFI:
- Load the wifi modules. (Huh?)
- If wireless mode is WIFI:
- Update the recovery image (recovery.img).
- If AMT state is FACTORY, AGING TEST, or FACTORY OUT:
- Reset the wipe and crash counters.
- If AMT stat is AGING TEST:
- Start the aging test.
- Exit from system startup.
- Log out fatal errors (up to 32MB) to a rotated file.
- Check to see if services are running and hard exit for any failure:
- System service (dji_sys)
- HDVT service (dji_hdvt_uav)
- Vision service (dji_vision)
- Monitor service (dji_monitor)
- Encoding service (dji_encoding)
- Clear the wipe and crash counters.
- Check the Leadcore LC1860 state.
- Check for panics and tombstones.
- Start wifi debug logs if the proper USB is inserted.
- Check to see whether to do an auto OTA upgrade test or not.
- Check to see whether to do an auto reboot test or not.
- Finished.
Switch between SDR and WIFI modes. This occurs in the script antenna_switch.sh.
First, for all modes:
GPIO pins 6, 7, 8 and 9 are exported.
Then, for SDR mode:
GPIO 6 and 8 are set to 0.
GPIO 7 and 9 are set to 1.
Otherwise, for WIFI mode:
GPIO 7 and 9 are set to 0.
GPIO 6 and 8 are set to 1.
Network | Purpose |
---|---|
192.168.1.0/24 | A9 (Android?) |
192.168.2.0/24 | WIFI Mode |
192.168.41.0/24 | LMI42 |
192.168.42.0/24 | RNDIS |
Address | Purpose |
---|---|
192.168.1.1 | |
192.168.1.2 | |
192.168.1.3 | USB on computer |
192.168.1.10 | USB on device |
Address | Purpose |
---|---|
192.168.2.20-254 | Guest devices |
Address | Purpose |
---|---|
192.168.41.1 | UAV over LMI42 |
192.168.41.2 | GND (RC) over LMI42 |
192.168.41.3 | GLASS over LMI42 |
Address | Purpose |
---|---|
? | ? |