1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00
Commit Graph

4761 Commits

Author SHA1 Message Date
Stacey Sheldon
e7053c77f0 usb config: remove unused macro for number of endpoints
This is no longer referenced and is confusing.
2011-12-31 13:02:43 -05:00
Stacey Sheldon
5c0921e92c fault: add optional fault insertion module
This module and its associated settings uavo can be used
to test various fault conditions during initialization.

To enable the module, add the TEST_FAULTS=YES to your make
command line:
  make fw_coptercontrol TEST_FAULTS=YES

Once this module is part of your firmware load, you can
enable it in the hwsettings uavo and then select the
type of fault to insert by editing the faultsettings uavo.
On the next reset, the configured fault will be inserted
into the init sequence to allow you to test the boot fault
recovery code.

With a fault inserted, you should see 3 failed boot attempts
followed by a successful (recovery) boot.  You will see the
BootFault alarm set to Critical, and the RAM version of your
hwsettings will be reset to defaults.  Since the defaults have
all optional modules disabled, the fault module will be out of
the way during the recovery boot.

You can then "Load" the flash version of the hwsettings uavo
in the object browser, disable the Fault module and then "Save"
the hwsettings module back to the board.  The next reset will
boot normally without the fault inserted.
2011-12-30 23:05:39 -05:00
Stacey Sheldon
f4f0dab764 fixup make combridge an optional module 2011-12-30 23:05:39 -05:00
Stacey Sheldon
f886af186d bootfault: add support for recovery from init failures
After 3 failed warm start attempts, the init sequence
will force the RAM version of the HWSettings object
to its defaults.  This should allow a user to regain
connectivity to a board that is continually faulting
during init.

This is accomplished by:
 - Incrementing a boot counter that is stored in the
   STM32 BKP registers.  These registers survive a
   warm start but are cleared on a cold start (ie. powerup).
 - On multiple failures, force hwsettings to defaults
   and raise the (new) BootFault alarm to prevent arming.
 - Resetting the boot counter whenever the system manages
   to successfully run the System Module task.

NOTE: This does not actually change the hwsettings object in
      flash.  That's up to the user.

This is intended to catch ONLY faults during early initialization.
It should not be used to recover from faults after the application
is up and running.
2011-12-30 23:05:38 -05:00
Stacey Sheldon
b91f40eb94 iap: extend API to support read/write of boot counter
Also clean up unused/obsolete definitions.
2011-12-30 23:05:38 -05:00
Stacey Sheldon
1543a6dbd3 hwsettings: allow disabling of USB telemetry entirely
The GCS hwsettings config widget now disallows any
configuration that disables both HID and VCP telemetry
over the USB port.

The firmware will allow it if the UAVObj is set manually.

This allows a mechanism to reduce RAM usage by another
500 more bytes if USB telemetry can be sacrificed in
certain configurations.
2011-12-30 23:05:38 -05:00
Stacey Sheldon
45615b5812 com: reduce buffer sizes on com interfaces on CC
Now that the COM layer fragments to the underlying
buffer sizes, the COM layer buffers can shrink below
single message sizes.
2011-12-30 23:05:38 -05:00
Stacey Sheldon
e980bb863f uavobj browser: add object size to tree display 2011-12-30 23:05:38 -05:00
Stacey Sheldon
bd9f3569db gcs uavtalk: Add full state-level debug logs
These logs are disabled by default, and can be
turned on at compile time by defining:
  UAVTALK_DEBUG
at the top of uavtalk.cpp.

These logs proved very helpful in diagnosing a
serial comms issue.
2011-12-30 23:05:37 -05:00
Stacey Sheldon
fa9702db97 gcs serial: fix broken baud rate selection
The difference between 56000 and 57600 baud is very
important.

When using a USB to serial adapter that is capable
of synthesizing arbitrary baud rates, these errors
resulted in a completely mismatched/unusable serial
link.
2011-12-30 23:05:37 -05:00
Stacey Sheldon
2cf1fe93c6 com: don't block forever waiting for a transmitter
Not all transmitters will continue to run when disconnected.
USB is one example of this.  When the USB cable was disconnected,
any transmitter blocked here would wait forever.

This was particularly noticeable when the telemetry Tx task
blocked forever on USB disconnect.  This also resulted in
the telemetry Rx task blocking forever waiting on the UAVTalk
connection lock.

We now block for a max of 5s waiting for space in the transmit
buffer.
2011-12-30 23:05:37 -05:00
Stacey Sheldon
7c03875013 diag-tasks: make taskinfo diagnostics a separate enable
This allows task stack analysis without turning on all
of the other diagnostics.
2011-12-30 23:05:37 -05:00
Stacey Sheldon
ad793f0b81 hwsettings: add HID and VCP config to hwsettings gui 2011-12-30 23:05:37 -05:00
Stacey Sheldon
56c4ff8f40 com-bridge: add support for bridging to flexiport 2011-12-30 23:05:37 -05:00
Stacey Sheldon
60969b57d8 usb-hid: split apart hwsettings for HID and VCP ports
This allows the HID and VCP functions to be configured
separately so that additional functions can be more easily
bound to the VCP port.

This change also provides a safety net that forces either
the HID or VCP to be configured for USB Telemetry.  This
safety net may vanish in the future once the GCS can check
it.  Disabling USB Telemetry entirely would save more than
400 bytes of RAM.
2011-12-30 23:05:37 -05:00
Stacey Sheldon
87be56eff7 hwsettings: add support for com-bridge to hwsettings config gui 2011-12-30 23:05:36 -05:00
Stacey Sheldon
ab135aa00b com-bridge: Make com-bridge an optional (and configurable) module 2011-12-30 23:05:36 -05:00
Stacey Sheldon
5b3227d1ff com: reduce buffer sizes for com layer
This saves a few hundred bytes of RAM in a typical
configuration.
2011-12-30 23:05:36 -05:00
Stacey Sheldon
785a7ccd88 uavtalk: convert tx to use blocking send routines
The uavtalk layer was previously implementing a poor
version of packet fragmentation based on a hard-coded
max packet size.  Since this was hard-coded, there was
no guarantee that it would match the underlying devices.

Now that the COM layer sending routines support fragmentation,
remove fragmentation and use the COM layer directly.

This will support future buffer size reductions in the COM
layer.
2011-12-30 23:05:36 -05:00
Stacey Sheldon
16619584e4 usb cdc: return valid data in response to SetLineCoding 2011-12-30 23:05:36 -05:00
Stacey Sheldon
a68f5a4fc9 com-bridge: detect lost characters on transmit 2011-12-30 23:05:36 -05:00
Stacey Sheldon
80e0be3cec com: fragment transmitted buffers to match underlying device
PIOS_COM_SendBufferNonBlocking() will now fragment its buffer
to match the max size of the underlying device.

This allows the buffer size of the underlying device to shrink
below the maximum message size, thus allowing us to use smaller
buffers on memory-constrained platforms.
2011-12-30 23:05:36 -05:00
Stacey Sheldon
407bec0c95 usb cdc: track oversized rx buffers 2011-12-30 23:05:35 -05:00
Stacey Sheldon
b858cf387e com: track dropped bytes on rx for usart and usb com 2011-12-30 23:05:35 -05:00
Stacey Sheldon
2040645171 com: Use all bytes in Tx buffer
Code would previously fail Tx if we happen to send data
that happened to be exactly the size of the available space
in the tx buffer.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
34af9ac92d usb_com: NAK rather than STALL on buffer full
STALL should only be used to indicate an error has occurred.
NAK is the correct mechanism to provide backpressure.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
e2bb7140fe usb cdc: allow use of entire rx buffer
Previously, the code only allowed n-1 bytes of the
available space to be used.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
86aead52ce usb cdc: only pass valid bytes from USB rx up to com layer
Previously, up to 63 random bytes would be passed to the COM
layer and would be delivered to the application as though
the far end had sent them.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
f54c0552ce com: make sure we know when a higher prio task is woken 2011-12-30 23:05:34 -05:00
Stacey Sheldon
202b1bd428 com: Always kick rx_start if we got zero bytes
This will ensure that we kick rx_start at least once every
time that a user tries to receive bytes from the underlying
device.
2011-12-30 23:05:34 -05:00
Stacey Sheldon
64f498e48a com-bridge: add usart to usb vcp bridge 2011-12-30 23:05:34 -05:00
Stacey Sheldon
504cf3417f init: collapse usart definitions for generic usage
Telemetry and GPS usarts are generic users of the uart
devices.  This collapses the duplicated usart configuration
structs into a single generic one.
2011-12-30 23:05:34 -05:00
Stacey Sheldon
eebdda6276 usb cdc: make HID/CDC configurable in hwsettings 2011-12-30 23:05:34 -05:00
Stacey Sheldon
e6ead85857 usb cdc: fix device descriptor to work on Mac
Apple is very particular about requiring the bDeviceClass
to be set to 2 (Commmunication Device) even for composite
devices which seems wrong.

Device is enumerated without error on Mac now.  Not sure if it
works though.
2011-12-30 23:05:34 -05:00
Stacey Sheldon
617a30c07c usb cdc: attach telemetry to CDC rather than HID 2011-12-30 23:05:34 -05:00
Stacey Sheldon
59cb489e01 usb: clean up pios hooks into stm32 usb_core
Reduced scope of many variables since they were being
exposed unnecessarily.

Renamed pios_usb_hid_prop code to pios_usbhook to reflect
the fact that it implements all of the callout functions
that are hooked into the stm32 usb library.
2011-12-30 23:05:33 -05:00
Stacey Sheldon
c0259dc616 usb cdc: USB composite device with HID + VCP 2011-12-30 23:05:33 -05:00
Stacey Sheldon
458d3467ab gcs: properly label ttyACM devices in gcs pull-down selector 2011-12-30 23:05:33 -05:00
Stacey Sheldon
b8af44bf61 Merge remote-tracking branch 'origin/naiiawah/deb_package_build' into next 2011-12-30 23:02:02 -05:00
naiiawah
f136f3d956 Updated Vid/Pids for Revo, CC3D and some minor comment cleanup in the UDev rules file. 2011-12-30 17:47:22 -07:00
dankers
7892f9699d Add minus for notify as requested 2011-12-29 22:25:17 +11:00
James Cotton
25dfb5463e Add option to switch to using the MPU6000 accel instead of BMA180. Disabled by
default.
2011-12-29 02:08:13 -06:00
James Cotton
c080080810 Add ability to change the SPI bus runs at 2011-12-29 00:09:53 -06:00
James Cotton
bf98630851 Add streaming the sensor data out of the serial port 2011-12-26 17:52:45 -06:00
James Cotton
fdec2019e6 Merge branch 'trim_flight_rebase' into next 2011-12-25 22:14:41 -06:00
naiiawah
405bde5c28 Merge remote branch 'origin/next' into deb_package_build 2011-12-24 21:12:24 -07:00
naiiawah
5da31269a6 Changed the top level menu to OpenPilot. 2011-12-24 20:38:04 -07:00
James Cotton
e34f618d89 Accel fields shouldn't be capitalized in the scope config 2011-12-24 16:15:13 -06:00
James Cotton
902a2baef7 Fix the sign of the bias terms 2011-12-24 16:14:53 -06:00
James Cotton
9bf06bbd3e Force the loading of the sensor gains and biases at the beginning 2011-12-24 16:14:28 -06:00