Commit Graph
100 Commits
Author SHA1 Message Date
Andrew Tridgell c9e795156f makefiles: make it easier to use ccache for build on windows 2014-12-31 11:43:32 +01:00
Andrew Tridgell 6bc6739676 makefiles: removed stray spaces 2014-12-31 11:43:21 +01:00
Andrew Tridgell 4724c05047 airspeed: use _retries=2 for I2C retries once initialised
airspeed sensors often need to be on longer cables due to having to be
outside the prop wash.
2014-11-26 07:35:32 +01:00
Andrew Tridgell 8e932cec10 systemcmds: added reflect command for USB testing 2014-11-26 07:35:06 +01:00
Andrew Tridgell c906c21238 px4io: prevent use of uninitialised memory in io_set_arming_state()
the vehicle may not have setup a control_mode. We need to check the
return of orb_copy() to ensure we are getting initialised values
2014-11-26 11:39:41 +11:00
Andrew Tridgell c0b47d6a74 px4io: only check SAFETY_OFF for allowing RC config changes and reboot
If we check OUTPUTS_ARMED then we can't update trim values and scaling
in flight, as there is no way to clear OUTPUTS_ARMED.

If safety is on then it should be perfectly safe to update the mixer
and RC config or reboot for fw update
2014-11-26 11:39:41 +11:00
Andrew Tridgell 29f000dc31 px4io: fixed error returns to be negative
follow standard conventions
2014-11-26 11:39:41 +11:00
Andrew Tridgell 809500cfcd px4io: fixed RC_CONFIG channel limit check
number of channels is the right test, not number of actuators
2014-11-26 11:39:41 +11:00
Andrew Tridgell 7ae4f6d97e uavcan: added add_poll_fd() helper function
this makes the code clearer and avoids repeated code
2014-11-26 08:41:32 +11:00
Andrew Tridgell a7a68c88a2 uavcan: show ESC output values in uavcan status, and add arm/disarm
this makes "uavcan status" show the current output values, which is
useful for debugging. It also adds "uavcan arm" and "uavcan disarm"
commands, which are very useful for re-arming after a motor test.
2014-11-26 08:32:47 +11:00
Andrew Tridgell 724ec0ec8b uavcan: handle all ESC output in one place
moving all the ESC output handling to one place allows the limits on
actuator values to apply to all types of inputs, and will make it
easier to expand "uavcan status" to show actuator values
2014-11-26 08:32:47 +11:00
Andrew Tridgell 8e44ec2e3b uavcan: prevent crash in ESC driver
passing in more than 8 actuators would crash the ESC driver. We need
to check again the array size of the _esc_status.esc, which is
CONNECTED_ESC_MAX
2014-11-26 08:32:47 +11:00
Andrew Tridgell ead0458e97 uavcan: don't force motors to keep spinning at zero throttle
Forcing motors to keep spinning when armed should be a policy decision
up at the vehicle type level, not hard coded down in the ESC
driver. It isn't appropriate for fixed wing or ground vehicles for
example.

We could add an ioctl to enable "spin when armed" if just setting a
small value in the vehicle code is inconvenient
2014-11-26 08:32:47 +11:00
Andrew Tridgell ecc7a3cbb4 motor_test: prevent use of uninitialised test_motor orb handle
stack variables are not initialised to zero
2014-11-26 08:32:47 +11:00
Andrew Tridgell b830137ec8 uavcan: added support for actuator_direct ORB topic
this watches the actuator_direct topic and uses it to allow for direct
output of actuator values, bypassing the mixer
2014-11-26 08:32:46 +11:00
Andrew Tridgell f6b0a3e07f uORB: added actuator_direct topic
this topic will be used to allow direct output of actuator values for
uavcan, bypassing the mixer.
2014-11-26 08:32:46 +11:00
Andrew Tridgell 2dae1bc542 uavcan: break the link between poll fd indexes and controls
this linkage was fragile and makes it harder to add new orb
subscriptions to the uavcan code
2014-11-26 08:32:46 +11:00
Andrew Tridgell f533c36251 px4io: added RC_CONFIG, SET_OVERRIDE_OK and CLEAR_OVERRIDE_OK ioctls
this allows for full setup of RC override without needing param_get()
to PX4 specific parameters

Conflicts:
	src/drivers/drv_pwm_output.h
2014-11-16 21:09:19 +01:00
Andrew Tridgell ba81125453 px4io: added OVERRIDE_IMMEDIATE arming flag
this allows the flight code to choose whether FMU failure gives
immediate manual pilot control, or waits for the mode switch to go
past the override threshold
2014-11-16 21:02:14 +01:00
Andrew Tridgell 6406e235d6 px4io: publish pwm values when STATUS_FLAGS_FMU_OK is not set
this allows testing of FMU failure behaviour in px4io by monitoring
the reported PWM output when the vehicle code stops sending
updates. Otherwise testing needs to be done with "px4io status" which
is very tedious.

With this change a GCS can monitor the PWM outputs from the failsafe
mixer using normal mavlink messages
2014-11-16 21:01:00 +01:00
Andrew Tridgell 88bae21ce5 px4io: added RC_CONFIG, SET_OVERRIDE_OK and CLEAR_OVERRIDE_OK ioctls
this allows for full setup of RC override without needing param_get()
to PX4 specific parameters
2014-11-16 21:00:01 +01:00
Andrew Tridgell 3f3353f2c4 mixer: fixed stream handle leakage 2014-11-07 11:43:59 +11:00
Andrew Tridgell a82f4881c7 sdlog2_dump: Fixing incorrect tabbing to allow for CSV generation 2014-10-29 23:17:14 +01:00
Andrew Tridgell c396a67746 mpu6000: added logging of good transfers
this helps tracking down a startup issue
2014-10-30 08:47:03 +11:00
Andrew Tridgell dd23d0acbc drivers: allow forcing the safety switch on
This allows forcing the safety switch to the on position from software
which stops the pwm outputs
2014-10-30 08:44:00 +11:00
Andrew Tridgell ae29d04ff5 px4flow: try a 22 byte transfer in probe()
this allows us to distinguish between a ll40ls and px4flow on I2C
address 0x42
2014-10-28 21:05:57 +11:00
Andrew Tridgell 6c75ee4ff9 ll40ls: start a measurement after a probe
this ensures register 0 also works
2014-10-28 21:03:59 +11:00
Andrew Tridgell cb79ef4df3 ll40ls: auto-detect ll40ls on either 0x42 or 0x62 I2C address 2014-10-28 21:03:55 +11:00
Andrew Tridgell c6ada17f68 ll40ls: support either internal or external I2C bus 2014-10-20 07:11:26 +11:00
Andrew Tridgell 99bfbb6dc3 ll40ls: add last distance in "ll40ls info" output 2014-10-20 07:11:24 +11:00
Andrew Tridgell 94574f1a58 lsm303d: don't use DRDY when not on internal SPI bus
external SPI bus does not have accel DRDY connected

Conflicts:
	mavlink/include/mavlink/v1.0
2014-10-08 10:38:27 +02:00
Andrew Tridgell 005dd206d1 hmc5883: periodically check the config and range registers
this copes with I2C comms errors causing the range or config registers
to become corrupted, leading to bad reading. This is easily
reproducible with a 1.3m I2C cable in the same run of cable as a GPS
UART cable. The error happens every half hour or so.

Conflicts:
	mavlink/include/mavlink/v1.0
	src/drivers/hmc5883/hmc5883.cpp
2014-07-12 19:04:25 +02:00
Andrew Tridgell 8a3a87331d mpu6000: fixed internal/external mixup in pointers
Thanks to Emile for spotting this!

Conflicts:
	mavlink/include/mavlink/v1.0
2014-07-12 16:27:39 +02:00
Andrew Tridgell 20cd5026d8 device: use bitfields to keep DeviceStructure small
this keeps it small enough to fit in a float, which makes it possible
to see the full value in a MAVLink tlog

Conflicts:
	mavlink/include/mavlink/v1.0
2014-07-12 16:27:19 +02:00
Andrew Tridgell 6cffa948fe device: pass CDev::ioctl() to superclass
this allows DEVIOCGDEVICEID to work.
2014-07-12 16:26:21 +02:00
Andrew Tridgell c6b0dc1ee8 lsm303d: setup device type 2014-07-12 16:26:12 +02:00
Andrew Tridgell 30a6a3d0b6 hmc5883: setup device type 2014-07-12 16:25:57 +02:00
Andrew Tridgell a2739707bb drv_mag: added devtypes for magnetometers 2014-07-12 16:25:50 +02:00
Andrew Tridgell 93d444d1aa device: added a _device_id to all drivers
this device ID identifies a specific device via the tuple of (bus, bus
type, address, devtype). This allows device specific configuration
data to be stored along with a device ID, so the code can know when
the user has changed device configuration (such as removing an
external compass), and either invalidate the device configuration or
force the user to re-calibrate
2014-07-12 16:25:43 +02:00
Andrew Tridgell ee92334512 build: fixed running build from external directory 2014-07-08 15:34:47 +02:00
Andrew Tridgell bc06d839ea Tools: skip check_submodules.sh when GIT_SUBMODULES_ARE_EVIL is set
this avoids using submodules when a specific NuttX tree is specified
2014-07-08 15:01:48 +02:00
Andrew Tridgell ac8f179f2d Tools: skip check_submodules.sh when NUTTX_SRC is set
this avoids using submodules when a specific NuttX tree is specified
2014-07-08 13:56:02 +02:00
Andrew Tridgell 4271634585 l3gd20: fixed a build warning 2014-07-08 12:03:09 +02:00
Andrew Tridgell 1c6ea06790 hmc5883: fixed build warnings 2014-07-08 12:03:02 +02:00
Andrew Tridgell dfee93f3b1 hmc5883: fixed driver startup when trying both buses 2014-07-08 12:02:53 +02:00
Andrew Tridgell 5e62ae7a9e hmc5883: added -C option to calibrate on startup
Conflicts:
	src/drivers/hmc5883/hmc5883.cpp
2014-07-08 12:01:50 +02:00
Andrew Tridgell d952e81ab7 added support for two instances of hmc5883 driver 2014-07-08 12:00:20 +02:00
Andrew Tridgell d2487e7718 hmc5883: added support for -R rotation option 2014-07-08 11:57:02 +02:00
Andrew Tridgell a049f0841d Merged L3GD20 orientation flag while keeping original bus speed 2014-07-08 11:56:45 +02:00
Andrew Tridgell 1dfc7bad7b Merged lsm303d update, keeping default frequency 2014-07-08 11:51:46 +02:00
Andrew Tridgell c681d6621d mpu6000: added -R rotation option 2014-07-08 11:46:47 +02:00
Andrew Tridgell f56724f7df lib/conversion: added rotate_3f()
will be used for user specified rotations in sensor drivers
2014-07-08 11:46:40 +02:00
Andrew Tridgell e4e152a85b FMUv2: added define for PX4_I2C_BUS_ONBOARD
needed for hmc5883 on main bus (for FMUv3)
2014-07-08 11:45:11 +02:00
Andrew Tridgell 19dbbf17e8 mpu6000: allow for two mpu6000 instances, one internal, one external
split g_dev into g_dev_int and g_dev_ext
2014-07-08 11:44:58 +02:00
Andrew Tridgell ab90fe7832 ms5611: added -X option for external SPI bus 2014-07-08 11:44:32 +02:00
Andrew Tridgell 541dc1825c mpu6000: added -X option for external bus 2014-07-08 11:44:22 +02:00
Andrew Tridgell e0dbc82d84 lsm303d: added -X option for external bus 2014-07-08 11:44:13 +02:00
Andrew Tridgell e7360f4016 l3gd20: added -X switch for external bus 2014-07-08 11:44:06 +02:00
Andrew Tridgell fea4845ed9 SPI: make _bus protected
this allows runtime use of internal/external bus to determine if DRDY
should be used on the L3GD20
2014-07-08 11:43:58 +02:00
Andrew Tridgell 644d4bb3dc FMUv2: added defines for FMUv3 sensors
this enables EXT0 to EXT3 on external SPI bus, and gives correct names
for FMUv3 board
2014-07-08 11:43:37 +02:00
Andrew Tridgell db304480d9 lsm303d: disable check_extremes code
this could trigger with a bungee launch, and could cause higher
latency due to SD card writes
2014-07-08 11:43:01 +02:00
Andrew Tridgell 0785512026 px_uploader: added ModemManager warning 2014-07-08 11:41:04 +02:00
Andrew Tridgell ef79d03276 mpu6000: allow disabling of on-sensor low pass filter
used for vibration testing
2014-07-08 11:40:54 +02:00
Andrew Tridgell 37b4cdfce2 board_serial: use a uint8_t buffer
we should not be using 'char' for binary APIs, as the C standard does
not specify if it is signed or unsigned, so results may not be
consistent
2014-07-08 11:39:40 +02:00
Andrew Tridgell c945693054 ets airspeed: Support raw field 2014-05-20 07:32:31 +02:00
Andrew Tridgell ab1939c6a3 pwm: added PWM_SERVO_SET_FORCE_SAFETY_OFF ioctl
this allows the safety switch on px4io to be forced off
2014-04-28 11:45:45 +02:00
Andrew Tridgell ac52111085 px4io: support PX4IO_P_SETUP_FORCE_SAFETY_OFF
this allows the FMU to force the safety off on the IO board. Useful in
two cases:

 1) vehicles where the safety switch is impractical or not useful
 (eg. HAB planes or internal combustion motors)

 2) doing ESC calibration on multi-copters
2014-04-28 11:45:20 +02:00
Andrew Tridgell f1258da610 Debug: fixes for gdb extension macros 2014-04-28 11:43:09 +02:00
Andrew Tridgell e9c94fa581 Debug: fixes for Nuttx.py debug gdb add-ons
also fixed preceding mask calculation in show heaps
2014-04-28 11:42:59 +02:00
Andrew Tridgell cdec5e1d05 Included raw differential pressure field 2014-04-05 13:17:39 +02:00
Andrew Tridgell 9719af623d Merged voltage compensation 2014-04-05 13:14:43 +02:00
Andrew Tridgell 00c82f0836 Merged airspeed changes 2014-04-05 13:10:35 +02:00
Andrew Tridgell 30d1ce3a51 hmc5883: properly reset mag to normal state on calibration fail
and add current output in "hmc5883 info"
2014-04-05 12:11:52 +02:00
Andrew Tridgell 6ea22c8c07 adc: publish system_power ORB topic from ADC 2014-04-05 12:11:07 +02:00
Andrew Tridgell ea5279389f uORB: added an ORB topic for system_power
holds power supply state and 5V rail voltage on FMUv2
2014-04-05 12:10:47 +02:00
Andrew Tridgell ec2197fd1b uploader: ignore bad character encodings for older bootloaders
this prevents the uploader from throwing an exception with older
bootloaders
2014-04-05 12:07:27 +02:00
Andrew Tridgell 9817922bf9 FMUv2: switch debug console and 2nd GPS
this allows a normal GPS cable to be used for the 2nd GPS, making
dual-GPS setups easier
2014-03-04 19:33:16 +01:00
Andrew Tridgell a7012a5418 tests: added "tests file2" filesystem test
this is useful for testing for filesystem corruption on cluster
boundaries
2014-03-04 09:01:30 +01:00
Andrew Tridgell b0c60296f5 FMUv2: fixed UART3 flow control pins 2014-02-10 10:08:50 +01:00
Andrew Tridgell 0dc7f223ea FMUv2: fixed UART3 flow control pins 2014-02-10 10:08:19 +01:00
Andrew Tridgell e7e3e132ad FMUv2: push SPI2 GPIO speed up to 50MHz as well 2014-01-29 13:17:37 +01:00
Andrew Tridgell 6b709e21d3 FMUv2: set SPI GPIO pins on bus 1 to 50MHz
this solves the ms5611 issue related to temperature. We now need to
test if it is OK with all sensors
2014-01-29 13:17:24 +01:00
Andrew Tridgell d8c1131f1e px4io: improved reliability of forceupdate re-starting px4io
this adds a 0.1s delay after update to give px4io time to boot. It
removes the need for the user to reboot after an IO update
2014-01-24 12:35:19 +01:00
Andrew Tridgell 4524fe3e48 px4fmu: added PWM_SERVO_SET_COUNT API
this allows the balance between PWM channels and GPIOs to be changed
after the main flight code has started, which makes it possible to
change the balance with a parameter in APM
2014-01-23 21:41:07 +01:00
Andrew Tridgell dda50c62bf hmc5883: much faster calibration code with bug fixes
this fixes two bugs in "hmc5883 calibrate" and also makes it much
faster, so it can be run on every boot. It now uses the correct 2.5Ga
range when calibrating, and fixes the expected values for X/Y/Z axes

The basic calibration approach is similar to the APM2 driver, waiting
for 10 good samples after discarding some initial samples. That allows
the calibration to run fast enough that it can be done on every boot
without causing too much boot delay.
2014-01-23 21:40:29 +01:00
Andrew Tridgell e5ad3c31e0 mtd: added "mtd readtest" and "mtd rwtest"
this allows for verification of MTD operation on startup
2014-01-16 07:58:45 +01:00
Andrew Tridgell ff59aa9a0f mtd: use new MTDIOC_SETSPEED ioctl
set SPI speed to 10MHz
2014-01-16 07:57:32 +01:00
Andrew Tridgell 778cbcb5cc mtd: fixed creation and erase of a single partition 2014-01-15 09:33:58 +01:00
Andrew Tridgell f30ae8c9f3 Added MTD erase command 2014-01-14 07:32:34 +01:00
Andrew Tridgell 94b539dfdd px4io: enable power on Spektrum connector on init 2014-01-07 09:36:33 +01:00
Andrew Tridgell d6088efd34 ms5611: report P and T in ms5611 info 2014-01-07 09:34:32 +01:00
Andrew Tridgell 3be1a5182d FMUv1: use larger CDCACM buffer size for faster log transfer on FMUv1 2014-01-07 09:33:39 +01:00
Andrew Tridgell 1f564a95ee meas_airspeed: avoid trivial dependency on math lib
including the math lib adds a huge amount to flash usage
2014-01-07 09:33:10 +01:00
Andrew Tridgell d4d2571161 FMUv2: enable RXDMA on 2nd GPS port and debug console
This should reduce the chance of lost data on these ports due to high
interrupt latency
2014-01-07 09:32:49 +01:00
Andrew Tridgell c4fc730aca FMUv2: make all UARTs use 512 byte buffer, 2048 for CDCACM output
this is important when using UARTs for things like secondary GPS
modules, which may produce large enough transfers that 128 bytes is
not enough.

The 2048 buffer for CDCACM transmit makes mavlink log and parameter
transfer faster
2014-01-07 09:32:23 +01:00
Andrew Tridgell 1a13e66aab px4iofirmware: make forceupdate more reliable
this schedules a reboot rather than rebooting immediately, which means
the FMU gets an ACK for its reboot operation, preventing it from
timing out waiting for the ACK. That makes the timing of the reboot
more consistent, which makes it more reliable for forceupdate
2014-01-07 09:30:56 +01:00
Andrew Tridgell bccf65cc28 mpu6000: disable interrupts during initial reset
this seems to avoid a problem where the mpu6000 doesn't startup
correctly if other devices are transferring at the same time.
2013-12-16 15:06:45 +01:00
Andrew Tridgell c46bd8b041 Enabled DMA on both telemetry ports and GPS 2013-12-13 11:26:16 +01:00
Andrew Tridgell 5b7d1af5d8 Merged crccheck command 2013-12-13 11:22:14 +01:00
Andrew Tridgell 6016fbe55d Merged PX4IO crc checks and force update 2013-12-13 11:21:00 +01:00