1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00
Commit Graph

77 Commits

Author SHA1 Message Date
Stacey Sheldon
dc4aa07a32 board_hw_defs: factor out board-specific hw config definitions
Board specific HW configuration is now collected in a single .c
file for each board.  This HW configuration is #include'd into
the FW, BL and BU builds for each board.

These new .c files are found in:
  flight/board_hw_defs/<board_name>/board_hw_defs.c

Parts of this information were previously duplicated between
the BL and FW builds.  This commit cleans up the duplication.

Using a #include on a .c file is a bit ugly but it allows us
to ensure that all of the symbols in the board_hw_defs.c file
are *ONLY* used in the PIOS_Board_Init() function for each
software build.
2012-01-22 19:41:41 -05:00
Stacey Sheldon
ee0895aa77 usb hid: remove stale files from pipx
These files are no longer relevent for USB configuration.
2012-01-16 21:31:07 -05:00
Stacey Sheldon
a51bf72bc7 usb: allow runtime selection of USB descriptors via hwsettings 2012-01-14 14:28:15 -05:00
Stacey Sheldon
8d8715c8c1 copyright: add/correct GPL + copyright boilerplate
I missed some of the boilerplate text on some of the
new files I've added recently.  Fixed.
2012-01-02 23:28:53 -05:00
Stacey Sheldon
481a13609e com: remove all references to PIOS_COM_ReceiveBufferUsed()
The PIOS_COM_ReceiveBufferUsed() function call is no longer
necessary since the same semantics can be achieved using calls
to PIOS_COM_ReceiveBuffer().
2012-01-02 14:27:06 -05:00
Stacey Sheldon
b94f4b49a4 usb: major refactoring of USB descriptors, CDC and HID
Summary of changes:
 * USB CDC and HID drivers are completely split apart.
   * This will allow different max buffer sizes for HID and CDC.
 * USB descriptors have been overhauled:
   * Proper structs/macros/enums declared for USB (see pios_usb_defs.h)
   * Two common descriptor definitions.  One for HID+CDC another for HID only.
     See pios_usb_desc_{hid_cdc,hid_only}.c for details.
   * Long standing bugs in OP USB descriptors became much more obvious with the
     new struct definitions.
   * Board specific USB initialization is now in pios_usb_board_data.h in each build target.
   * Definition of USB descriptors is now entirely indpendent of STM32 libs.
     Glue into STM32 libs is provided by pios_usbhook.c.
 * Removed a lot of stale/irrelevant USB #defines throughout the tree.
 * Improved naming consistency throughout USB code:
   * PIOS_USB_HID_* now refers to the HID endpoint code.
   * PIOS_USB_CDC_* now refers to the CDC endpoint code.
   * PIOS_USB_* now refers to the low-level USB code.
   * PIOS_USB_BOARD_* now refers to board-specific USB data
   * PIOS_USBHOOK_* is glue between PIOS and STM32 USB libs.
   * struct usb_* and enum usb_* and USB_* and HID_* are all types from the USB spec.
 * Shrunk the buffer size on the CDC call mgmt endpoint to save some RAM.
 * Made a few more USB related variables static to save some RAM.
2012-01-02 14:27:06 -05:00
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
eebdda6276 usb cdc: make HID/CDC configurable in hwsettings 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
f29b99521e openocd: collapse JTAG rules for STM32F1 and STM32F2 2011-08-27 10:43:02 -04:00
Stacey Sheldon
c2fb0d8b43 com: allow run-time allocation of buffers 2011-07-29 15:33:14 -04:00
Stacey Sheldon
5f8760a55c com: Move buffering out of USART/HID layer and into COM layer
This allows the spektrum and sbus receiver drivers to bind
directly to the usart layer using a properly exported API
rather than overriding the interrupt handler.

Bytes are now pushed directly from the usart layer into the
com layer without any buffering.  The com layer performs all
of the buffering.

A further benefit from this approach is that we can put all
blocking/non-blocking behaviour into the COM layer and not
in the underlying drivers.

Misc related changes:
 - Remove obsolete .handler field from irq configs
 - Adapt all users of PIOS_COM_* functions to new API
 - Fixup callers of PIOS_USB_HID_Init()
2011-07-27 19:45:38 -04:00
Mike Smith
a89092e275 Update to use the delay API to get entropy rather than reading the timer directly. 2011-07-23 13:53:42 -07:00
Stacey Sheldon
dbf7574946 bootcfg: use UAVobj to control boot-time HW config
This should mark an end to the compile-time selection of HW
configurations.

Minor changes in board initialization for all platforms:
 - Most config structs are marked static to prevent badly written
   drivers from directly referring to config data.
 - Adapt to changes in .irq fields in config data.
 - Adapt to changes in USART IRQ handling.

Major changes in board initialization for CC:
 - Use HwSettings UAVObj to decide which drivers to attach to
   the "main" port and the flexi port, and select the appropriate
   device configuration data.
 - HwSettings allows choosing between Disabled, Telemetry, SBUS,
   Spektrum,GPS, and I2C for each of the two ports.
 - Use ManualControlSettings.InputMode to init/configure the
   appropriate receiver module, and register its available rx channels
   with the PIOS_RCVR layer.  Can choose between PWM, Spektrum and PPM
   at board init time.  PPM driver is broken, and SBUS will work once
   it is added to this UAVObj as an option.
 - CC build now includes code for SBUS, Spektrum and PWM receivers in
   every firmware image.

PIOS_USART driver:
 - Now handles its own low-level IRQs internally
 - If NULL upper-level IRQ handler is bound in at board init time
   then rx/tx is satisfied by internal PIOS_USART buffered IO routines
   which are (typically) attached to the COM layer.
 - If an alternate upper-level IRQ handler is bound in at board init
   then that handler is called and expected to clear down the USART
   IRQ sources.  This is used by Spektrum and SBUS drivers.

PIOS_SBUS and PIOS_SPEKTRUM drivers:
 - Improved data/API hiding
 - No longer assume they know where their config data is stored which
   allows for boot-time alternate configurations for the driver.
 - Now registers an upper-level IRQ handlerwith the USART layer to
   decouple the driver from which USART it is actually attached to.
2011-07-05 22:03:25 -04:00
Stacey Sheldon
4da671fc82 build: change firmware files from .opf to .opfw extensions 2011-05-25 00:20:02 -04:00
Oleg Semyonov
66804076b8 build: fix release/Makefile for *.opf files and changed targets 2011-05-24 23:49:51 -04:00
Stacey Sheldon
91cb294730 build: remove redundant PHONY for size target 2011-05-24 01:10:40 -04:00
Stacey Sheldon
0eb92fad91 build: refactor jtag program and add jtag wipe target
Macros for JTAG program and wipe for each target are now
provided in firmware-defs.mk.

The _wipe target for each firmware and bootloader image will
erase either the bootloader (bl_*_wipe) or firmware (fw_*_wipe)
bank.
2011-05-24 01:10:31 -04:00
Stacey Sheldon
9973fda23b build: define bootloader and firmware bank spans
The board-info.mk files now define the start and size
of the bootloader and the firmware banks.
2011-05-24 01:03:01 -04:00
Stacey Sheldon
6e406c0232 build: remove all remaining use of -DUSE_BOOTLOADER
The USE_BOOTLOADER compile flag was only being used
to determine where the ISR vector table was located.

Provide this explicitly from the linker since it knows
exactly where it is putting the ISR vector table.
2011-05-23 18:21:42 -04:00
Stacey Sheldon
0a67730d0f build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
   - BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
   - MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
   - START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
  version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 18:21:42 -04:00
Stacey Sheldon
6ec6425f5e build: build opf images including firmware + version blob 2011-05-22 10:55:13 -04:00
Oleg Semyonov
bac95dae11 OP-483: get rid of -D install switch (doesn't work on Mac) and use mkdir -p instead 2011-05-14 23:17:08 +03:00
Oleg Semyonov
37868a4c10 OP-483: add install target for firmware
make INSTALL_DIR=dir INSTALL_PFX=pfx INSTALL_SFX=sfx install
installs binary file into specified install directory adding
optional prefix and/or suffix.
2011-05-13 11:25:32 +03:00
Stacey Sheldon
29ec2f198b build: convert all app loads to require bootloaders
This change is made up of a number of tightly coupled
changes:
 - Deprecate the use of the USE_BOOTLOADER command-line
   option.  It is now hard-coded in each Makefile.
   Overriding it on the command line is not allowed.
 - Split apart the memory declaration and the section
   declaration in all linker files (*_memory.ld and
   *_sections.ld).
 - Describe the split between bootloader and app sections
   of flash in each board's _memory.ld file.
 - Change program target to selectively erase flash so
   that the installed bootloader is preserved across even
   JTAG programming operations.
 - All elf files are built with debug symbols and are not
   stripped.  This should help debugging with gdb.  The
   images programmed on the boards are all .bin files now
   which do not include symbols.
2011-05-08 12:40:29 -04:00
Stacey Sheldon
7e99419c8a build: Add support for %.bin.o generation
The .bin.o rule places the contents of a raw .bin file
into an .o file wrapped within fixed symbols for start
and end.  This can be used to embed a binary file inside
of an executable.

The symbols for the embedded binary blob are:
 _binary_start
 _binary_end
 _binary_size

NOTE: The way the .bin.o rule is currently written, you
can only embed one binary blob in an executable since the
symbol names will collide if you add multiple blobs.  This
limitation is easily removed later if necessary.
2011-05-07 18:05:50 -04:00
James Cotton
69d03ca101 OP-439: Simplify further. Abstract most of the OOCD flags into the common
firmware include and delete all the extra foss-jtag config files.  There is now
a legacy file for the revA board a second for AHRS that changes the port
2011-04-24 10:19:00 -05:00
Corvus Corax
ee7179bd53 OP-439 unified OpenOCD config for mac os x and Linux, Makefiles adapted accordingly 2011-04-24 12:10:33 +02:00
edouard
3fec8a6d72 OP-339 Update PipXtreme PID too.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3020 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-09 18:07:58 +00:00
pip
f4fef1bfb8 Rewrote PipX's PPM input decoder to do away with supervisor timer/monitor.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3019 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-09 17:36:11 +00:00
edouard
ae32bae5c7 OP-338: Use the new convention on bcdDevice for the PipXtreme. Also use the new PID for the modem. Careful, this breaks the uploader gadget on the GCS for now!
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3011 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-08 23:57:18 +00:00
pip
bfcfb3e88e Fixed problem with board rebooting when changing mode from PPM Rx or PPM Tx to some other mode.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2996 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-07 17:46:39 +00:00
pip
3e67bf19dc PPM generator module now working (the modem can generate a nice precise PPM stream) - not yet done the RF streaming side of PPM though.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2995 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-07 15:00:38 +00:00
pip
b71bc49ce3 Updated USB descriptor to use the BCD values stated on the wiki page http://wiki.openpilot.org/display/Doc/Firmware+USB+descriptors
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2993 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-06 21:08:12 +00:00
pip
88b2d360a3 Various minor changes to do with switch modem mode on the fly but mainly PPM Input decoder (with error/noise detection) is now working
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2992 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-06 18:52:18 +00:00
pip
7317891d39 Slight reorganisation to allow easier continuous data transmission (DATA streaming and PPM streaming) and allow easier total configuration changes on the fly.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2961 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-04 08:34:44 +00:00
pip
eaea8f28cf Starting to add continuous streaming modes (DATA and PPM).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2951 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-03-03 16:32:43 +00:00
pip
7bfb58ce73 clean up
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2903 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-27 13:13:10 +00:00
pip
a2e1e3e7d0 Updated some RF module register settings
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2876 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-25 11:28:39 +00:00
pip
62e510a696 Set unused/unconnected pins as outputs.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2875 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-24 17:31:24 +00:00
pip
d3ea16de99 Updated spectrum scanning code.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2859 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-23 09:30:06 +00:00
stac
ee3d890bfc makefile: convert to unix line-endings
These files were a mix of line endings.  Now
they're all consistent as LF terminators.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2855 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-23 04:18:56 +00:00
stac
6700a74782 makefile: refactor makefiles and clean up output
This significantly reduces the amount of duplication
across the various firmware makefiles.

The new firmware-defs.mk file should contain only
macros/declarations that will apply to all firmware
makefiles.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2854 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-23 04:18:53 +00:00
pip
60e7665aec A bug fixed that caused carrier frequency to go way off when setting the modem to one of the Tx-carrier/Tx-spectrum test modes (and back).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2799 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-16 12:32:44 +00:00
pip
9899c270cb Removed unused code
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2796 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-15 13:10:18 +00:00
pip
ac7cfcc358 Added "Ready-To-Send-Time" parameter adjustment
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2795 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-15 12:57:46 +00:00
stac
967bb9bb9c pipx: COM device ids are now 32bit not 8bit
The COM layer now uses 32bit device ids rather than
8bit.  All code that stores these ids must now use
uint32_t to hold them.

Since these 32bit numbers are really just opaque
pointers, it is (reasonably) safe to assume that
they won't be 0.  The logic around tracking the
*_previous_com_port could probably be cleaned up
to remove that assumption.

Missed this fixup in the recent hwinit changes.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2776 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-13 15:54:26 +00:00
stac
3fda65c5d3 hwinit: Convert SPI drivers to dynamic init
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2772 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-12 22:19:50 +00:00
stac
841b0d3d6d hwinit: Convert COM and USART to dynamic init
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2771 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-02-12 22:19:43 +00:00