{"id":19195424,"url":"https://github.com/ardupilot/fwload","last_synced_at":"2026-03-03T23:03:01.994Z","repository":{"id":142048279,"uuid":"63850648","full_name":"ArduPilot/FWLoad","owner":"ArduPilot","description":"Factory load tool for Pixhawk2","archived":false,"fork":false,"pushed_at":"2016-11-30T01:08:00.000Z","size":164,"stargazers_count":2,"open_issues_count":0,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-08T23:02:28.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArduPilot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-07-21T08:18:55.000Z","updated_at":"2025-01-10T21:47:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc92d75e-46ba-406c-ab43-eb30ffcb4ba5","html_url":"https://github.com/ArduPilot/FWLoad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArduPilot/FWLoad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2FFWLoad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2FFWLoad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2FFWLoad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2FFWLoad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArduPilot","download_url":"https://codeload.github.com/ArduPilot/FWLoad/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArduPilot%2FFWLoad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30064793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T12:09:54.065Z","updated_at":"2026-03-03T23:03:01.989Z","avatar_url":"https://github.com/ArduPilot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firmware Loader\n\nThis is a firmware loader and factory test tool. It is designed to load firmware \non a Pixhawk2 in a factory, and test sensors and other peripherals for correct operation.\n\n## Hardware Environment\n\nThe system assumes it has two Pixhawks in the test jig. One is the\n'reference' Pixhawk and the other is the 'test' Pixhawk. The reference\nPixhawk may be a bare board without any isolated IMUs. The reference\nPixhawk should have no microSD.\n\n### Test Jig\n\nThe test jig is assumed to have two servos in a gimbal\narrangement. The gimbal is assumed to be a (3,2) setup, so that the\nservo closest to the Pixhawk is a body-yaw servo.  \n\nThe rotation rates, reversals and set-points of the servos are set in\nconfig.py. The servos are assumed to be attached to the first two\nIO channels of the reference board.\n\n### USB Devices\n\nThe scripts assume the following USB devices, configured in config.py:\n\n * two black magic probes. Serial numbers must be in config.py. \n * nsh console debug port on test Pixhawk is assumed to be attached to\n   the FMU black magic probe\n * one FTDI adapter. The RTS pin on that adapter is used for power\n   control to the jig. Active high.\n * USB ports for the two Pixhawks\n\n### Environment\n\nAll tools should be run from the home directory, running from FWLoad\ndirectory like this:\n\n\u003e FWLoad/some_script.py\n\nThe FW/ directory contains the firmwares which will be loaded. The key\nfirmwares are:\n\n* FW/px4io.elf - the px4io firmware\n* FW/px4io_bl.elf - the IO bootloader\n* FW/px4fmuv2_bl.elf - the bootloader for the FMU\n* FW/firmware-test.elf - the firmware to be loaded onto test boards\n\n## Tools\n\nThe FWLoad package consists of a set of python scripts. The main\nscript is factoryload.py, and that is what is run for continuous\nfactory operation. The other tools are for setup and diagnostics.\n\n### factoryload.py\n\nThe FWLoad/factoryload.py script takes the following commands:\n\n  -h, --help         show this help message and exit\n  --test             run in test loop\n  --once             run one install only\n  --nofw             don't reload firmware\n  --erase            erase firmware and parameters\n  --monitor MONITOR  monitor address\n\nNormal operation is to run factoryload.py with no arguments. That will\ndo the following:\n\n * wait for power on, by watching for the appearance of the black\n   magic probes and the FTDI adapter on the bus. Power on should be\n   triggered by a microswitch in the lid of the device\n\n * 4 firmwares (two bootloaders, IO firmware and FMU firmware) are\n   loaded using scripted gdb over jtag on the black magic probes\n\n * MAVLink connections are made to both the reference and test boards\n\n * the gyros are monitored to wait for any startup movement to stop\n\n * the accelerometers on the test board are calibrated, by starting\n   accelcal on the test board while moving the servos on the reference\n   board\n\n * the AHRS trim values are set by comparing the accelerometers of the\n   reference and test boards\n\n * a series of sensor tests are run, including internal magnetometer,\n   barometer, analog voltages and serial-loopback tests\n\n * if everything passed then the system is powered off via the FTDI\n   cable, ready for the next board\n\nThe command line opttions can be used to run in different modes.\n\n * the --test option puts the system into a mode where it doesn't wait\n   for the operator to use the lid. The FTDI power control is used to\n   simulate the power-on/power-off of the operator. The screen is also\n   not cleared between runs. This mode is very useful for continuous\n   unattended operation to validate a test jig.\n\n * the --once option makes the script do a single run instead of\n   looping. \n\n * the --nofw option skips the firmware load step\n\n * the --erase option forces an erase of the firmwares and FRAM\n   parameters\n\n * the --monitor option allows for a remote MAVLink monitoring system\n   to be specified. This should be a IPv4 address of a system\n   listening on UDP ports 16550 and 16551 (for reference and test\n   boards). This can be used to remotely monitor the factory load\n   process\n\n### power_control.py\n\nThe power_control.py tool can be used to power cycle the system via\nFTDI. Just run:\n\n\u003e FWLoad/power_control.py\n\nby default the power is cut for 4 seconds then re-applied\n\n### jtag.py\n\nThe FWLoad/jtag.py script is the gdb script for loading firmwares. You\ncan run it standalone to test that part of the process.\n\nYou can optionally give a --erase option to erase all firmwares on the\nboard, like this:\n\n\u003e FWLoad/jtag.py --erase\n\n### rotate.py\n\nThe FWLoad/rotate.py script allows for testing the rotation code, to\nensure the servo set points are correct. The setpoints are in\nconfig.py.\n\nYou can specify a rotation on the command line. For example:\n\n\u003e FWLoad/rotate.py left\n\nwill rotate into the left orientation.\n\n### accelcal.py\n\nThe FWLoad/accelcal.py script runs just the accel calibration part of\nthe scripts, skipping the firmware load. This is useful for debugging.\n\n### mav_reference.py and mav_test.py\n\nThe FWLoad/mav_reference.py and FWLoad/mav_test.py scripts can be used\nto attach to the reference or test boards with MAVProxy, which can be\nuseful for diagnostics.\n\n### connection.py\n\nThe FWLoad/connection.py script can be used to test the complete\nconnection logic for connecting to the two boards.\n\n## Logging\n\nThe system keeps logs of all interactions with each board in the logs\ndirectory. With a subdirectory per day and per run.\n\n## Loading reference firmware\n\nPut the reference board in the test slot in the jig, then use the\njtag.py tool to load the reference firmwares:\n\n\u003e FWLoad/jtag.py --fmu --firmware FW/px4fmuv2_bl_REFERENCE.elf\n\n\u003e FWLoad/jtag.py --fmu --firmware FW/firmware-REFERENCE.elf\n\n\u003e FWLoad/jtag.py --io --firmware FW/px4io_bl.elf\n\n\u003e FWLoad/jtag.py --io --firmware FW/px4io.elf\n\nAfter each command use \"load\" to load the firmware\n\n## Calibrating reference board\n\nThe reference board needs to have its accelerometers calibrated before\nbeing used. Use this command:\n\n\u003e FWLoad/accelcal.py --reference\n\nthe reference board can be in either slot while being calibrated. It\nwill rotate the board while doing accel calibration. The calibration\nassumes the accelerometer is correctly aligned with the board.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardupilot%2Ffwload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardupilot%2Ffwload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardupilot%2Ffwload/lists"}