ArduPilot/FWLoad

Name: FWLoad

Owner: ArduPilot

Description: Factory load tool for Pixhawk2

Created: 2016-07-21 08:18:55.0

Updated: 2016-11-30 01:08:01.0

Pushed: 2016-11-30 01:08:00.0

Homepage: null

Size: 164

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Firmware Loader

This is a firmware loader and factory test tool. It is designed to load firmware on a Pixhawk2 in a factory, and test sensors and other peripherals for correct operation.

Hardware Environment

The system assumes it has two Pixhawks in the test jig. One is the 'reference' Pixhawk and the other is the 'test' Pixhawk. The reference Pixhawk may be a bare board without any isolated IMUs. The reference Pixhawk should have no microSD.

Test Jig

The test jig is assumed to have two servos in a gimbal arrangement. The gimbal is assumed to be a (3,2) setup, so that the servo closest to the Pixhawk is a body-yaw servo.

The rotation rates, reversals and set-points of the servos are set in config.py. The servos are assumed to be attached to the first two IO channels of the reference board.

USB Devices

The scripts assume the following USB devices, configured in config.py:

Environment

All tools should be run from the home directory, running from FWLoad directory like this:

FWLoad/some_script.py

The FW/ directory contains the firmwares which will be loaded. The key firmwares are:

Tools

The FWLoad package consists of a set of python scripts. The main script is factoryload.py, and that is what is run for continuous factory operation. The other tools are for setup and diagnostics.

factoryload.py

The FWLoad/factoryload.py script takes the following commands:

-h, –help show this help message and exit –test run in test loop –once run one install only –nofw don't reload firmware –erase erase firmware and parameters –monitor MONITOR monitor address

Normal operation is to run factoryload.py with no arguments. That will do the following:

The command line opttions can be used to run in different modes.

power_control.py

The power_control.py tool can be used to power cycle the system via FTDI. Just run:

FWLoad/power_control.py

by default the power is cut for 4 seconds then re-applied

jtag.py

The FWLoad/jtag.py script is the gdb script for loading firmwares. You can run it standalone to test that part of the process.

You can optionally give a –erase option to erase all firmwares on the board, like this:

FWLoad/jtag.py –erase

rotate.py

The FWLoad/rotate.py script allows for testing the rotation code, to ensure the servo set points are correct. The setpoints are in config.py.

You can specify a rotation on the command line. For example:

FWLoad/rotate.py left

will rotate into the left orientation.

accelcal.py

The FWLoad/accelcal.py script runs just the accel calibration part of the scripts, skipping the firmware load. This is useful for debugging.

mav_reference.py and mav_test.py

The FWLoad/mav_reference.py and FWLoad/mav_test.py scripts can be used to attach to the reference or test boards with MAVProxy, which can be useful for diagnostics.

connection.py

The FWLoad/connection.py script can be used to test the complete connection logic for connecting to the two boards.

Logging

The system keeps logs of all interactions with each board in the logs directory. With a subdirectory per day and per run.

Loading reference firmware

Put the reference board in the test slot in the jig, then use the jtag.py tool to load the reference firmwares:

FWLoad/jtag.py –fmu –firmware FW/px4fmuv2_bl_REFERENCE.elf

FWLoad/jtag.py –fmu –firmware FW/firmware-REFERENCE.elf

FWLoad/jtag.py –io –firmware FW/px4io_bl.elf

FWLoad/jtag.py –io –firmware FW/px4io.elf

After each command use “load” to load the firmware

Calibrating reference board

The reference board needs to have its accelerometers calibrated before being used. Use this command:

FWLoad/accelcal.py –reference

the reference board can be in either slot while being calibrated. It will rotate the board while doing accel calibration. The calibration assumes the accelerometer is correctly aligned with the board.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.