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

96 Commits

Author SHA1 Message Date
Stacey Sheldon
eab923fee0 revo: move fw image into 128KB sectors
This saves the more versatile 16KB and 64KB sectors
for other purposes.
2012-03-28 21:52:43 -04:00
Stacey Sheldon
91cffb1809 f4 usb: don't skip yield from ISR
Function was returning prior to the code that might
need to yield from within the ISR.
2012-03-27 00:18:44 -04:00
Stacey Sheldon
730defb698 f4 flash: fix flash voltage range setting in bl_helper
F4 boards are powered by 3.3V which corresponds to
VoltageRange_3.  Fix this to match actual VDD so we
get faster erase/write times.
2012-03-22 22:37:31 -04:00
Stacey Sheldon
3210bd3f9c f4 usb_dcd: disable FIFO empty IRQ while waiting for tx completion
CPU was being hammered with FIFO empty IRQs if we queued data but
the host wasn't actively draining the FIFO.

This was entirely unexpected so this hack should probably be
removed once we can figure out why this was happening.

This is almost certainly hiding some other issue.
2012-03-07 20:36:37 -05:00
Stacey Sheldon
c4bd286739 f4 usb_hid: track whether we have buffers queued on endpoints
Make sure we don't clobber our endpoint configuration by
double configuring an Rx or Tx buffer against it.  Wait for
the completion of the previous operation before allowing
endpoint configuration again.
2012-03-07 20:36:36 -05:00
Stacey Sheldon
65fc6104e6 f4 usb_hid: ignore upper layers if USB IF not yet enabled
Upper (COM) layer was calling down into the HID layer before
the HID interface had been enabled.  This was leading to
interacting with the endpoint Rx and Tx FIFOs prior to init.
The FIFO config was then being clobbered when we the USB IF
was eventually enabled.
2012-03-07 20:01:35 -05:00
Stacey Sheldon
1f37806eab f4 usb_hid: fix typo in EP IN registration call
Code was using the size of the Rx buffer instead of the Tx
buffer when registering.  Buffers are currently the same
size so wasn't causing any issues.
2012-03-07 20:01:35 -05:00
Stacey Sheldon
bc3ee6209c f4 usbhook: drop in/out bit from EP numbers before using as index
USBHOOK endpoint callback arrays should not be indexed with the
0x80 (in/out) bit set.  Oops.
2012-03-07 20:01:35 -05:00
Stacey Sheldon
6832a62872 f4 bl_helper: clear all flash errors as we unlock the flash
Error flags being set were causing flash erase operations to
fail.  Not sure why these flags were set though so this might
be hiding some other problem.
2012-03-07 19:53:18 -05:00
Stacey Sheldon
4ea1156e7b f4 bl_helper: teach bl_helper about f4 flash sector map 2012-03-07 19:53:17 -05:00
Stacey Sheldon
c854c3f4a4 usbhook: add support in API for deactivating USB 2012-03-07 19:53:17 -05:00
Stacey Sheldon
cb9c3a9b7e usbhook: delete dead code
Remove old code left-over from porting from F1 to F4.
2012-03-07 19:53:17 -05:00
Stacey Sheldon
fdf54ab86c hid: fix response to HID descriptor
HID driver was incorrectly giving back the HID interface
descriptor when asked for the HID descriptor.  This should
let OP boards interact better with generic HID layer drivers
and also gives us nicer output in lsusb once the HID descriptor
is read.
2012-03-07 19:52:54 -05:00
James Cotton
e3df261213 Merge branch 'stac/revo-usb' into revolution
Conflicts:
	flight/Revolution/System/pios_board.c
2012-03-02 13:00:13 -06:00
James Cotton
72a93dbae5 Fix from PT for OSX/Windows F4 USB HID to send the full report size even if not
all used.
2012-03-02 11:11:36 -06:00
James Cotton
d8f0494e57 Merge branch 'revolution' into revolution_overo 2012-02-11 20:02:20 -06:00
Alessio Morale
22b211167c Ported pios_iap.c to F4
restored failed boot count check on pios_board.c for revo
2012-02-11 13:49:32 +01:00
Stacey Sheldon
e2939dae2a revo usb: Add support for USB to Revo 2012-02-07 02:25:31 -05:00
Stacey Sheldon
3c1b1001f9 f4 usb: Allow USB descriptors to be const through ST APIs 2012-02-07 02:25:31 -05:00
Stacey Sheldon
56102013aa f4 usb: correct function prototypes in bsp template
This file is not actually used but it should still be accurate.
2012-02-07 02:25:31 -05:00
Stacey Sheldon
57f9f6e3d1 f4 usb: configure and build ST USB OTG and USB DEV libraries 2012-02-07 02:25:31 -05:00
Stacey Sheldon
1e79ed6d54 f4 usb: fix invalid reference to stm32f4_discovery.h 2012-02-07 02:25:31 -05:00
Stacey Sheldon
04b81f13a7 f4 usb: fix invalid references to stm32f2xx.h 2012-02-07 02:25:31 -05:00
Stacey Sheldon
266b95561f f4 usb: rename device template to real config file 2012-02-07 02:25:30 -05:00
Stacey Sheldon
a4ae844f2b f4 usb: rename otg template to real config file 2012-02-07 02:25:30 -05:00
Stacey Sheldon
58bbe0870d f4 usb: allow device->host data to be const
This allows the application code to pass const
descriptors to the Tx APIs in the STM32 USB
library.
2012-02-07 02:25:30 -05:00
Stacey Sheldon
4b911bb3be f4 usb: remove unused device class examples 2012-02-07 02:25:30 -05:00
Stacey Sheldon
efbe8bbfdd f4 usb: convert all line endings to LF-only
Line ending changes only.  No functional changes.
2012-02-07 02:25:30 -05:00
Stacey Sheldon
6a43d1c7ed f4 usb: Import pristine STM32F4 USB Library v1.1.0
Taken from version STM32F4-Discovery_FW_V1.1.0 of the
library from ST.
2012-02-07 02:25:30 -05:00
Stacey Sheldon
4fafbb13ed makefile: Add EF (Entire Flash) targets for all boards
These new build targets will construct a flash image that
includes both a bootloader as well as a firmware image all
in one.  Examples:
  make ef_coptercontrol
  make ef_revolution

This also adds support for a new target for writing this EF
image to boards that support a DFU interface (only F4-based
boards).  This can be done by running:
  make dfuutil_install
  # Boot board with SBL asserted to activate STM32 DFU ROM
  # Attach USB cable
  make ef_revolution_dfu

Bootloader images are also now padded out to occupy the full
BL flash region.
2012-02-03 00:59:36 -05:00
James Cotton
18a64e261f Going a bit overkill with this - deinit who SPI block between transactions. 2012-02-02 12:32:57 -06:00
James Cotton
03cfb1453a DeInit SPI DMA between transactions. Somehow if this doesn't happen the next
transaction doesn't start at the beginning again.  Something is still not quite
right because first few bytes aren't getting across.  Need logic analyzer.
2012-02-02 11:37:35 -06:00
James Cotton
77a6abb341 For PIOS_SPI F4 do not enable the TX irq. Also do not wait for the
transmission to finish either.
2012-02-02 11:24:14 -06:00
James Cotton
0a71a48c57 Sending all FF finally again 2012-02-02 10:36:09 -06:00
James Cotton
29237f97ae For SPI slave devices we need to handle the interrupt differently since
transactions should already be completed.  Also reset the callback so in the
case of noise on the IRQ line it will not keep firing interrupts.

I suspect we should probably disable interrupts in this handler to prevent
refiring.
2012-02-02 10:13:09 -06:00
Alessio Morale
820e8ac062 Handle different prescaler values for timers on APB1 and APB2.
The PIOS_MASTER_CLOCK has been removed in favor of
PIOS_SYSCLK (the master clock value,168000000 for revolution)
PIOS_PERIPHERAL_APB1_CLOCK and
PIOS_PERIPHERAL_APB2_CLOCK
Look at STM32F4xx_Revolution.h for the list of timer/peripheral and APB them belongs.
2012-01-28 20:04:55 +01:00
James Cotton
fe7b9a909a LED: Update the LEDs on revo 2012-01-26 09:11:27 -06:00
James Cotton
20670d049b Update pios_led for F4 targets to match the new F1 implementation. Also fix
type for F1 in GPIO labels.
2012-01-25 22:50:19 -06:00
James Cotton
7c22215e0b Patch from Sambas to fix F4 on windows 2012-01-24 10:33:07 -06:00
James Cotton
aaf1c5dfdd Update the F1 SPI library to support multiple NSS lines 2012-01-23 23:27:02 -06:00
James Cotton
886d5456ac Update pios_exti for F4 2012-01-23 16:55:54 -06:00
James Cotton
b2a292e9c4 Move all the drivers to the PiOS/Common directory to prepare for refactoring
the EXTI calls they make to the portable version
2012-01-23 10:11:46 -06:00
James Cotton
c84240e485 Merge branch 'next' into revolution3
Conflicts:
	flight/PiOS/STM32F10x/pios_bmp085.c
	flight/PiOS/STM32F10x/pios_exti.c
2012-01-23 06:51:30 -06:00
James Cotton
21ae37b3de Remove BMP085 driver from F4 target 2012-01-23 06:44:25 -06:00
James Cotton
838370b3a4 Fix calls to backup registers on F4 2012-01-21 13:21:37 -06:00
James Cotton
bb0bfe0ae4 Merge branch 'next' into revolution3
Conflicts:
	flight/Bootloaders/CopterControl/Makefile
	flight/Bootloaders/PipXtreme/Makefile
	flight/Bootloaders/Revolution/inc/pios_config.h
	flight/CopterControl/Makefile
	flight/INS/inc/pios_config.h
	flight/Libraries/taskmonitor.c
	flight/Modules/Altitude/altitude.c
	flight/Modules/Attitude/attitude.c
	flight/OpenPilot/Makefile
	flight/OpenPilot/Makefile.posix
	flight/OpenPilot/System/inc/pios_usb_board_data.h
	flight/OpenPilot/System/inc/taskmonitor.h
	flight/OpenPilot/System/pios_board.c
	flight/OpenPilot/System/taskmonitor.c
	flight/PiOS/Boards/STM32F4xx_Revolution.h
	flight/PiOS/STM32F4xx/pios_bmp085.c
	flight/PiOS/STM32F4xx/pios_iap.c
	flight/PiOS/pios.h
	flight/Revolution/System/inc/pios_config.h
	flight/Revolution/System/inc/taskmonitor.h
	flight/Revolution/System/taskmonitor.c
	ground/openpilotgcs/src/plugins/serialconnection/serialplugin.cpp
	shared/uavobjectdefinition/systemalarms.xml
	shared/uavobjectdefinition/taskinfo.xml
2012-01-21 11:27:03 -06:00
James Cotton
5dbbfec8a9 Make the BMA180 driver use the appropriate claim method from the ISR. Also
slow down this bus to 10 MHz.
2012-01-21 09:57:02 -06:00
James Cotton
ff0bd87f4e PIOS SPI: Add a second claim bus method for use in ISR. This has no timeout
and uses an ISR safe queue claiming method.  This avoids deadlocks when ISR
blocks other tasks from freeing the bus.
2012-01-21 09:07:06 -06:00
James Cotton
ec903449cd Remove line that bypassed the BMA180 startup test 2012-01-21 08:46:32 -06:00
James Cotton
7f284596f2 Attempting to get flash and BMA180 to coexist 2012-01-20 13:33:21 -06:00