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

1761 Commits

Author SHA1 Message Date
Mathieu Rondonneau
612a439199 OP-423: simplify the MODULE_INITCALL macro and remove the ordering loops 2011-07-12 20:44:32 -07:00
James Cotton
0aec3b592c Changing stabilization so that the PIDs are zeroed when not armed, but NOT when
the throttle is < 0.  This will make things like axis-lock work while armed
without throttle.  HOWEVER don't hold your stick in the arming position for a
long time or you can wind up the integrals now.
2011-07-12 14:35:32 -05:00
James Cotton
2c7cfe435f Somehow this task runs quite a few times at the beginning so dT was going to
zero and making the attitude get NaN.  Wrote recovery code for that condition
(should never occur) and also force minimum dT to 1 ms (also shouldn't occur)
2011-07-12 14:18:19 -05:00
James Cotton
53ca934b2b Merge branch 'heli_stabilization'
Conflicts:
	flight/CopterControl/System/inc/pios_config.h
	flight/Modules/Attitude/attitude.c
	flight/Modules/ManualControl/manualcontrol.c
	flight/Modules/Stabilization/stabilization.c
2011-07-12 13:28:20 -05:00
James Cotton
9e94f9fee9 Fix typo from SISE to SIZE 2011-07-12 12:48:06 -05:00
James Cotton
2fe7ee40b1 Merge branch 'OP-423_Mathieu_Change_Init_To_Reduce_Memory_Footprint' 2011-07-12 12:44:59 -05:00
James Cotton
c33d3057cc Dos2unix evendispatcher file 2011-07-12 12:36:20 -05:00
James Cotton
15a2b85729 For OpenPilot use the minimal stack size (512 words) for eventdispatcher as
this is necessary for object saving.  Creating a new define to override this
for CopterControl down to 96.
2011-07-12 12:34:40 -05:00
James Cotton
557771d3ef Change to OP MB code to make it work with input changes. Previously tried to
register every possible input channel.  Slipped through review because
"obviously correct" change fixed previous bug masking this.  Woohoo testing :)
2011-07-12 11:41:21 -05:00
James Cotton
59798701a2 Merge branch 'master' into bugfix-flight
Conflicts:
	flight/CopterControl/System/inc/pios_config.h
2011-07-12 11:40:47 -05:00
James Cotton
3b3b76aa46 Revert "Drop 8 bytes per PID of unecessary information. Also trying to compute"
This reverts commit 9c1e523260.
2011-07-12 11:37:36 -05:00
Mathieu Rondonneau
d38f6167e3 OP-423:
Also reduce heap has it does not fit in SRAM anymore (not with current compiler).
(that's ok since if there is more space available, it will be reclaimed).

Merge branch 'master' into OP-423_Mathieu_Change_Init_To_Reduce_Memory_Footprint

Conflicts:
	flight/CopterControl/System/inc/pios_config.h
	flight/Modules/ManualControl/manualcontrol.c
2011-07-08 06:29:34 -07:00
Stacey Sheldon
b86ef4de82 bootcfg: fix incorrect bounds checking on rcvr registration
This was preventing any receivers from registering their
channels.
2011-07-07 23:59:12 -04:00
Stacey Sheldon
2e8d3a9be3 clean up cut/paste cruft 2011-07-07 23:02:09 -04:00
Stacey Sheldon
1f004ee896 ppm: port PPM driver onto new CC driver layers
This is a port of a work-in-progress by Sambas onto
the new driver infrastructure needed for boot-time
configuration.

PPM and PWM still don't coexist in a build but this
is closer.
2011-07-07 22:27:57 -04:00
Stacey Sheldon
226f095a2e bootcfg: remove baudrate #defines for USARTs
The initial baud rates of each interface are now forced in the
board init code.

Any modules using USARTs should have fields added to
their settings object to allow the user to change the
baud rate from the default by using the COM layer APIs.

Developers requiring custom baud rates before the settings
objects are in place should locally edit the cfg structs
to specify the desired baud rates.
2011-07-06 23:03:54 -04:00
Stacey Sheldon
a8787ee015 bootcfg: Add support for selecting S.Bus receivers in inputtype 2011-07-06 22:38:23 -04:00
Stacey Sheldon
bf39ab7a22 remove left-over comment about compile time configs
No functional changes.
2011-07-06 22:36:15 -04:00
Stacey Sheldon
e82539c654 bootcfg: additional validation during board init 2011-07-06 22:34:59 -04:00
Mathieu Rondonneau
36f28f8037 OP-423: Fixing heap2 (puting back bytes from the post heap stack (used during init) back into the free list).
Tested this heap2 at runtime with CC and new compiler since old one (current) triggers strict alliasing error.
That's ok since strict aliasing is disabled on OP, and CC only use heap1.
2011-07-05 21:45:39 -07:00
James Cotton
2d995dc2f7 OP-539: Don't call the gyro setting callback during init because it clears the
gyro bias estimation.
2011-07-05 22:27:03 -05:00
Mathieu Rondonneau
9b9b5a1367 OP-423: remove ';' at the end of macro 2011-07-05 19:44:54 -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
6415fc84a5 rtc: allow registration of callbacks on RTC tick
This separates the RTC device and interrupt handling
from the devices that rely on the tick notifications.

Drivers can now register tick notification functions
that will be called on each RTC tick event.
2011-07-05 22:03:25 -04:00
Stacey Sheldon
740b5f1584 rcvr: convert PWM, PPM, SBUS and Spektrum to use PIOS_RCVR
All receivers now fall under the same driver API provided
by pios_rcvr.c.

This is part of a larger sequence of commits that will
switch the receiver selection over to boot time dynamic
configuration via UAVObjects.
2011-07-05 22:03:25 -04:00
Stacey Sheldon
e77795dc28 rcvr: add generic driver API for receivers
Will be used to collapse PWM, PPM, Spektrum and SBUS so we
can choose between them at boot time instead of at compile time.
2011-07-05 22:02:47 -04:00
Stacey Sheldon
0c4facac46 heap: reduce stack size on IDLE and Event tasks
The FreeRTOS IDLE task was using 512 bytes of stack.
The UAVObject Event task was also using 512 bytes of stack.

Both have been reduced, recovering 400+ bytes of heap.
2011-07-05 20:13:00 -04:00
James Cotton
010f0255a4 OP-543: When the magic header on file system is bad at init, read multiple
times.  It's not written as cleanly as I'd like but works for wiping when magic
value changes.  Testing will reveal if this stops the lost settings.
2011-07-04 21:44:41 -05:00
James Cotton
ad8876c62a OP-193: Weak leveling variant on rate mode. Slowly will return to level. 2011-07-04 20:44:55 -05:00
Mathieu Rondonneau
f864d723dd OP-423: Cleanup and remove recently added *_BL.S startup file. 2011-07-03 18:45:02 -07:00
Mathieu Rondonneau
2daa36aad9 OP-423: Remove *_BL.S 2011-07-03 13:14:42 -07:00
Mathieu Rondonneau
b3740ec025 OP-423: Clean startup and add weak function call for stack swap. 2011-07-03 12:43:38 -07:00
James Cotton
46ae7eb17b Merge remote-tracking branch 'origin/bugfix-ground' into heli_stabilization 2011-06-30 19:40:22 -05:00
James Cotton
39e646ae1d Make the rates all work properly in axis lock 2011-06-30 19:38:52 -05:00
zedamota
567e3ffcad OP-542 Board resets with new Uploader
IAP module now checks magic value
2011-06-30 12:17:27 +01:00
James Cotton
a7206361d2 Slightly different way to respond to sticks in axis lock that is much more
responsive and avoids overshoot.
2011-06-26 21:59:54 -05:00
Mathieu Rondonneau
fbf0b021c7 OP-423: Replace hardcoded value and get value from memory section (change from code review) 2011-06-25 20:06:33 -07:00
Corvus Corax
fc62f6e522 Module initialisation rework ported to PiOS.posix 2011-06-26 00:25:06 +02:00
Mathieu Rondonneau
6683ce8570 OP-423: Make it more obvious that MODULE_TASKCREATE_ALL and MODULE_INITIALIZE_ALL are macro (for now):
- remove the ;
  - also encapsulate the macro by {} in his own scope.
2011-06-25 11:40:01 -07:00
James Cotton
4c0245281d Now we store the gyro bias avoid quashing the initialization correction. 2011-06-25 12:32:06 -05:00
Mathieu Rondonneau
de55c56427 OP-423: Change capital on macro to be uppercase for consistency. 2011-06-24 22:03:03 -07:00
James Cotton
dedbcbfceb Correct nasty bug on range checking for max rate and use the axis lock rate
desired when in that mode.
2011-06-24 11:30:28 -05:00
James Cotton
e6ad21d881 Make gyro bias in deg/s * 100 to calibrate more precisely. 2011-06-24 10:51:07 -05:00
James Cotton
5127d1e7ba Change actuator memory to 900 bytes since it uses less now. 2011-06-24 10:49:36 -05:00
James Cotton
038f955cb1 OP-410 OP-333: Axis lock (heading hold) implemented 2011-06-24 10:38:26 -05:00
James Cotton
ab7ff56d96 Compute initial gyro bias while calibrating to speed up convergence 2011-06-24 10:38:26 -05:00
James Cotton
c0eff41dc6 OP-410 OP-333: Created an Axis-lock setting for stabilization 2011-06-24 10:38:26 -05:00
James Cotton
0a4bbcc12e Added a field for initial gyro bias to speed up initialization. 2011-06-24 10:38:26 -05:00
James Cotton
28501842c3 Expose the rate D term which in simulations seems to help damp oscillations for
high RateKp terms.  However it might be sensitive to gyro noise (vibrations).
In addition it is mathematically similar to lead shapign so probably only use
one or the other.
2011-06-24 10:38:25 -05:00
James Cotton
a09642675c Tweak the integral calculation so it is scaled in ms internally. This avoids a
loss of precision on the accumulation.
2011-06-24 10:38:25 -05:00
James Cotton
373689207a Add a 1-tap IIR filter into the gyros in the feedback path. This will make the
stabilization output a bit more resilient to the high frequency noise from
gyros.  However this value shouldn't be too high as it will increase the phase
delay of the feedback loop and decrease stability.  Default is 5 ms.

Note: this resests the stabilizationsettings object.  Sorry guys.
2011-06-24 10:38:25 -05:00
Stacey Sheldon
d1104d3fdc alarms: lower heap warning and critical thresholds for CC
Free heap on CC is currently 160 bytes so the current thresholds
were causing a continual alarm condition, thus preventing arming.
2011-06-24 10:38:25 -05:00
Mathieu Rondonneau
dcd2774103 OP-423 Fix some comment from code review:
- update example module
- use module init macro for POSIX and WIN to make code cleaner.
2011-06-24 06:59:51 -07:00
Corvus Corax
f52f6d30c6 VTalk (flight): Buffers allocated dynamically with size calculated by UAVObjGenerator. Support for tx packet sizes < object size.i 2011-06-24 02:08:20 +02:00
James Cotton
f6312c7798 OP-410 OP-333: Created an Axis-lock setting for stabilization 2011-06-23 14:51:18 -05:00
James Cotton
9aba787b02 OP-193: Check for instance read success was backwards 2011-06-23 03:01:37 -05:00
James Cotton
368d5b649a OP-193: Output mixer should read from up to 6 accessory channels (may add more
in future).
2011-06-23 01:47:55 -05:00
James Cotton
493fcaef2a OP-193 OP-511: Add settings to scale the camera input output range 2011-06-23 00:47:27 -05:00
Mathieu Rondonneau
703919daf4 OP-423 Reduce IRQ stack limits (CC onlyt) 2011-06-22 06:32:27 -07:00
Mathieu Rondonneau
0ff5e9a46f Merge branch 'master' into OP-423_Mathieu_Change_Init_To_Reduce_Memory_Footprint 2011-06-21 22:02:13 -07:00
James Cotton
9c1e523260 Drop 8 bytes per PID of unecessary information. Also trying to compute
integral in ms instead of seconds to avoid rounding errors.
2011-06-21 17:54:03 -05:00
James Cotton
8976d22fad Merge remote-tracking branch 'origin/OP-159_os_sbus' 2011-06-21 17:51:22 -05:00
Oleg Semyonov
fba201c8b3 usart: move default port numbers from pios_config.h to pios_board.c 2011-06-22 01:32:18 +03:00
Mathieu Rondonneau
74e5e2015e Merge branch 'master' into OP-423_Mathieu_Change_Init_To_Reduce_Memory_Footprint 2011-06-20 20:28:12 -07:00
Stacey Sheldon
80709f356f alarms: lower heap warning and critical thresholds for CC
Free heap on CC is currently 160 bytes so the current thresholds
were causing a continual alarm condition, thus preventing arming.
2011-06-20 22:31:05 -04:00
unknown
9e632b532e Fix win32 SiTL by adding PiOS CRC and another missing function. 2011-06-20 15:48:05 -04:00
Mathieu Rondonneau
fc1e3f574c OP-423: Split task create and module init in order to postpone task creation once the full heap is available.
Also implement some ordering (quite ugly still) in the module init and task creation order so we can decide which module to start/init first
and which module to start/init last.
This will be replaced/adapter with the uavobject list later (once it's implemented).
reserving some space for module init and task create parameters to customize module/task creation (this will be usefull once we get the list and customization from customer).

Changes have been made for OP and CC. Tested comped with CC,OP, sim_posix.
Only ran on bench with CC for couple of minutes (code increase expected but no dropping of stack which is good).

This gives task creation at the time wherethe all heap is available.
2011-06-19 22:35:40 -07:00
James Cotton
17fa227d1f Fixed typo, thanks Os 2011-06-19 16:51:54 -05:00
Oleg Semyonov
6272210df7 sbus: some code cleanup (no functional changes) 2011-06-19 14:30:13 +03:00
Mathieu Rondonneau
2b11395a67 OP-423 just move stack from systemmod back to heap (200 bytes) that are not needed anymore. 2011-06-18 17:31:29 -07:00
Mathieu Rondonneau
5e3e7cc4e3 OP-423 Fix issue with init not properly started in the right order endup up object thinking other where not init. 2011-06-18 17:28:37 -07:00
Oleg Semyonov
59da5055cd usart: make USART ports configurable from make command line
For CopterControl the following make options are available:

USE_TELEMETRY=[YES|NO|1|3]    (default is YES, USART1)
USE_GPS=[YES|NO|1|3]          (default is NO, USART3)
USE_SPEKTRUM=[YES|NO|1|3]     (default is NO, USART3)
USE_SBUS=[YES|NO|1]           (default is NO, USART1 only)
2011-06-18 23:54:32 +03:00
Oleg Semyonov
311902f1f2 sbus: implemented S.Bus stream decoding 2011-06-18 23:19:57 +03:00
James Cotton
724016ffb0 When erasing flash at the end start flashing LED to indicate it is done 2011-06-18 14:32:09 -05:00
James Cotton
2218ff6fe9 Change to object template so when they are already registered it doesn't
initialize them a second time (which causes the handle to get lost)
2011-06-18 14:21:14 -05:00
James Cotton
5044ea36de Start initializing objects in the modules that consume them. Shouldn't affect
OP yet but not tested.
2011-06-18 14:20:51 -05:00
Mathieu Rondonneau
b67a38661e OP-423: merge master into that branch, resolve conflicts and test with CC and bl_CC
heap reamining is low (about 500) but stacks can be ajusted (specially the 200 bytes from system) to give the level close to 1Ko if needed.

Merge branch 'master' into OP-423_Mathieu_Change_Init_To_Reduce_Memory_Footprint

Conflicts:
	flight/CopterControl/System/inc/FreeRTOSConfig.h
	flight/CopterControl/System/inc/pios_config.h
2011-06-17 19:04:09 -07:00
James Cotton
9720a8444f Make a few things optional if they are mostly for diagnostics to keep memory
down
2011-06-17 21:00:21 -05:00
Mathieu Rondonneau
693c6bc5b0 OP-423: fix bl and bu, also fix compiler problems encountered with make all 2011-06-17 18:54:25 -07:00
Mathieu Rondonneau
65cf467ca4 OP-423: move the module initialize funtion into a specific section for OP and CC.
- create linker section for those <module>Initialize()
- later this list will incorporate parameters as well. (this probably will be more a OP feature to swap/remove/delete module on the fly.
- this is not done at compile time anymore by Makefile.
- this will allow us to have control on the module start at run-time (not implemented but build the ground for it).
- this simplify the startup (Part of code re-org).
- this change does not affect sim_posix and win32 (since they don't need that)
- ensure it's compiling for PiOS.posix
- port to PiOS.win32 but not tested (not compiled)
- tested on CC
- compile on OP.
- this free ~200 bytes.
- current avalable bytes (is we keep the same remaining bytes on the stack than before) is easily passed the 1.2Ko mark on CC with new gcc (4.5.2)
- this does not include init-reorg for each module (I still think more can be freed)
2011-06-16 22:13:19 -07:00
Corvus Corax
926246b402 UAVTalk: Make UAVTalk object oriented, allowing multiple UAVTalk instances 2011-06-16 16:35:37 +02:00
Oleg Semyonov
aeda61d252 usart: serial telemetry can be disabled to free USART
It was tested being merged with OP-472_CorvusCorax_CopterControl-Guidance_v3
branch, Spektrum on USART3 and GPS on USART1 and seems to work.

Currently defaults mimic original behavior, that is, if USE_SPEKTRUM
is not defined - define USE_PWM and USE_GPS. Thsi should be refactored
later to make it configurable from the Makefile.

Also it was not ported to the OP MB: it currently does not support the
S.Bus hardware and still has original behavior with the patch. But this
is one more step to dynamic configuration of ports.
2011-06-16 15:06:01 +03:00
Mathieu Rondonneau
e8cdf22427 OP-423 Port to OP: Claim (at run-time) the remaining un-used bytes (between heap and end of RAM) that are for data growth (needed at compile time).
CAREFULL: the heap section need to be the last section in RAM to avoid overwritting data...

also move address into linker (CC and OP)
2011-06-15 18:54:35 -07:00
Oleg Semyonov
50e819192b usart: make CC USART ports compile-time configurable
TODO: This should be dynamic in the future.
But for now define any compatile combination of:
   USE_I2C (shared with USART3)
   USE_TELEMETRY
   USE_GPS
   USE_SPEKTRUM
   USE_SBUS (USART1 only, it needs an invertor)
and optionally define PIOS_PORT_* to USART port numbers

Defaults are:

#define PIOS_PORT_TELEMETRY 1
#define PIOS_PORT_GPS       3
#define PIOS_PORT_SPEKTRUM  3
#define PIOS_PORT_SBUS      1

#define USE_TELEMETRY
#define USE_GPS

Telemetry, GPS and PWM input are enabled by default.
2011-06-15 22:37:44 +03:00
Oleg Semyonov
d8201ec45b sbus: provide a stub based on Spektrum driver (for CC only) 2011-06-15 22:35:21 +03:00
James Cotton
7d7d03cfd0 OP-193 OP-511: Basic code for camera stabilization. Currently tune range with
the servo endpoints and neutral.
2011-06-15 11:18:29 -05:00
Mathieu Rondonneau
ab4e15e9aa OP-423 also claim (at run-time) the remaining un-used bytes (between heap and end of RAM) that are for data growth (needed at compile time).
CAREFULL: the heap section need to be the last section in RAM to avoid overwritting data...

Tested with GCC 4.5.2 this gives 1K of free bytes usable in heap right away (including the 200 bytes saved just by using the new gcc).
This does not include any code re-org yet!
2011-06-14 22:13:30 -07:00
Mathieu Rondonneau
3780de8d3e OP-423 port to OP (heap2) the previous changes done in CC (heap1) (see c95b199166)
I managed to test CC with heap2 changes and the init stack claimed back to heap once scheduler starts.

the changes of this commit are OP related (just cleanup on CC side):
Arch specific stuff (in reset vector) to hide this from portable code:
     - switch back to MSP stack before starting the scheduler so that the sheduler can use the IRQ stack (when/if needed).
     - call the C portable function in heap2 to claim some stack back (the number to claim is taken from linker file).
     - start the scheduler from reset vector (I move this here from main because it make sense to not go back to C (so that I don't need to copy the rolled stack in case the sheduler returns). This make it more clean.
     - Also I have added the call to the mem manager if sheduler return. that way, we don't reset indefinitely if memory runs out. We will go to this handler and figure things out (right now, it's just looping but at least not rebooting. Probably trap NMI would be better (later improvement).
2011-06-14 20:10:53 -07:00
James Cotton
144f36dfb7 Merge branch 'bugfix-flight' 2011-06-14 10:02:55 -05:00
Mathieu Rondonneau
c95b199166 OP-423 do the arch specific stuff (in reset vector) to hide this from portable code:
- switch back to MSP stack before starting the scheduler so that the sheduler can use the IRQ stack (when/if needed).
 - call the C portable function in heap1 to claim some stack back (the number to claim is taken from linker file).
 - start the scheduler from reset vector (I move this here from main because it make sense to not go back to C (so that I don't need to copy the rolled stack in case the sheduler returns). This make it more clean.
 - Also I have added the call to the mem manager if sheduler return. that way, we don't reset indefinitely if memory runs out. We will go to this handler and figure things out (right now, it's just looping but at least not rebooting. Probably trap NMI would be better (later improvement).

The part missing for this part is the weak attribute for the function in heap1.c so that we don't have to update everything with empty stub.
I think the weak atrribute for C function called in assembly is arch dependent so I am not sure if this is possible (will look into it, maybe somebody outthere nows).
Right now, it's heap1 dependent and won't work with heap2. I will clean that up the next couple of days.

I did some test and it looks good.
this is without init code re-organization so we don't free as much as we will be it's good starts.

This compile with sim_posix (since it does not affect portable code) so this is really clean.
I only tested this with CC. I will port it for OP when I will work on heap2.
2011-06-13 21:49:17 -07:00
Mathieu Rondonneau
1f54e32ea9 OP-423 also add changes to OP. (I can not test it because I don't have a board so only compile test) 2011-06-13 17:10:14 -07:00
James Cotton
404c026188 Patch from Zippe to use cycle timer for CPU monitoring. 2011-06-13 00:24:30 -05:00
Mathieu Rondonneau
7598e898fa OP-423 Step-1: split system stack and implement water mark for IRQstack:
- use IRQStack for ISRs (at begening of SRAM) (let's call it the irq stack)
- use end of heap for stack needed during initialization (let's call it the init stack).
- the systemStats in GCS indicate the remaining bytes in the IRQ stack (this is realy usefull to monitor our (nested) IRQs.

This is the base ground to provide as much memory as possible available at task creation time.

Next step is to re-organize the initialization in order to move all the init out of the thread's stacks onto the init stack.
This will provide as much memory as possible available at task creation time.
Basically the stack during initialization will be destroyed once the scheduler starts and dynamic alloc are made (since the init stack is at the end of the heap). We will need to make sure we don't clobber the heap during initialization otherwise this will lead to stack corruption.
2011-06-12 20:23:00 -07:00
James Cotton
0f5fe54329 FlashFS: Should clear the 0 sector when wiping flash chip, not 10 bytes in. 2011-06-11 22:31:51 -05:00
Oleg Semyonov
5d0c7fe42e Merge branch 'master' into heli_improvements 2011-06-11 12:19:07 +03:00
Corvus Corax
a7841a523a bugfix: forgot to add header file (pios.posix) 2011-06-10 22:04:54 +02:00
Corvus Corax
47a6643318 PiOS.posix: ported PiOS_CRC to PiOS.posix to fix compilation error on OpenPilot introduced by new dependency 2011-06-10 17:16:15 +02:00
James Cotton
4a59c03b0e OP-493: Unfortuantely have to change stack alarms for this to work :( 2011-06-07 10:31:40 -05:00
James Cotton
bdc9094975 OP-493 OP-505 OP-511: Make up to 6 accessory channels so some can go from
ManualCommand to a camera module and some could go from that camera module to
output (i.e. mixing of inputs to pan tilt with stabilization)
2011-06-06 10:56:31 -05:00
James Cotton
1ecd244aff OP-493 OP-505 OP-511: Fixed bug with the direct mapping where it looked at throttle curve
source instead of directly bypassing
2011-06-06 10:53:55 -05:00
James Cotton
6c6906d61e OP-493: Switch to using Accessory0:2 to match the InstId 2011-06-05 15:38:58 -05:00
James Cotton
99b3a629a8 OP-493: Force three AccessoryDesired objects to always exist. Routing to
Mixing channel now works.  However Accessory desired instances do not show up
in GCS.
2011-06-05 15:38:58 -05:00
James Cotton
a1336e4d03 OP-493: Make sure accessory desired is not a single instance object 2011-06-05 15:38:57 -05:00
James Cotton
8ebd6a83d6 OP-493: Add support to bypass the mixer and route accessory data straight to
outputs.  Warning: This has no failsafes like arming.  We should discuss if
this is appropriate.

In addition accessory objects can be routed throught the mixer for collective
or flaperon.
2011-06-05 15:38:57 -05:00
James Cotton
a1d60cb77d OP-493: Use multiple instances when using multiple accessory channels 2011-06-05 15:38:57 -05:00
James Cotton
1365542103 OP-493: Populate the Accessory Desired from TX 2011-06-05 15:38:57 -05:00
James Cotton
4f47c06547 Merge branch 'saving_crc' into bugfix-flight 2011-06-05 15:37:44 -05:00
James Cotton
624baeda5c Merge branch 'OP-423_Mathieu_GetSet_Uavobjects' into bugfix-flight 2011-06-05 09:48:22 -05:00
James Cotton
0a56129b35 OP-452: Made the CRC calculation run in chunks to balance efficiency and ram
usage, because Stac caught me being lazy :)
2011-06-05 09:05:59 -05:00
James Cotton
56faad594e OP-423: Make sure to unlock semaphore before returning from error condition 2011-06-05 08:41:21 -05:00
James Cotton
599483d5ac OP-152: Save CRC for object and header into flash and only load object if CRC
matches.  Read the flash first bytewise to compute CRC instead of buffering
which is more RAM efficient but very inefficient as it sets up many one byte
SPI transfers.

Also incremented the filesystem magic flag to trigger an automatic flash wipe
on this upgrade.
2011-06-04 18:36:38 -05:00
James Cotton
3e5d02cbaf OP-152: Abstract the CRC code out of uavtalk to allow it to be reused (PT -
feel free to test moving this to the hardware CRC unit)
2011-06-04 18:36:26 -05:00
dankers
3013a092d9 Merge branch 'OP-519_Mathieu_Upgrade_FreeRTOS' into bugfix-flight 2011-06-04 16:42:15 +10:00
Mathieu Rondonneau
7b8d09371b fixing minor compiler error/warnings when compiling OP with DEBUG=NO 2011-06-03 21:47:43 -07:00
Mathieu Rondonneau
31a06a5ae7 OP-423 add set/get uavobjects functions to access objects fields separately. 2011-06-02 21:18:34 -07:00
Mathieu Rondonneau
6e64a546df Remove un-used code 2011-06-02 20:21:26 -07:00
Mathieu Rondonneau
071a684248 OP-519 upgrade to FreeRTOS-7.0.1
- only affect flight/PiOS (no change for posix and win32)
- tested on recent master (some runtime on CC with GCS)
- the new timer feature is not compiled-in since we don't use it yet.
- NO TEST FLIGHT
2011-06-01 21:46:28 -07:00
Oleg Semyonov
f770870af7 Merge branch 'bugfix-flight' 2011-06-01 14:53:31 +03:00
Oleg Semyonov
6e418735cf OP-509: fix for ld symbol reference (also fixes build with 4.5.2 gcc) 2011-06-01 00:31:27 +03:00
James Cotton
efe50012cb Merge branch 'spektrum_rtc_supervisor' 2011-05-29 17:19:48 -05:00
sambas
17fb31a7fa Spektrum rtc supervisor working, tested on CC and all outputs are activated. Needs review and testing before merge. 2011-05-29 14:52:22 +03:00
sambas
86d02e2d34 Merge branch 'master' of ssh://git.openpilot.org/OpenPilot into spektrum_rtc_supervisor 2011-05-29 10:40:17 +03:00
Stacey Sheldon
5be27fda83 coptercontrol: Increase stack size for system module
When running flight software from master (cf74908), my
config was pushing the system module stack usage to within
16 bytes of its limit.  This triggers a stack overflow
alarm which prevents the quad from arming/flying.

This change increases the available stack size such
that there are 72 bytes of stack free (a previously stated
safe margin) when my quad is sitting idle and unarmed on
the bench.
2011-05-29 00:12:26 -04:00
Stacey Sheldon
ac0eb3a5c7 Merge remote branch 'origin/stac_build-opf-image' 2011-05-26 21:29:53 -04:00
James Cotton
66b85acebd Merge branch 'bugfix-flight' 2011-05-26 20:07:58 -05:00
James Cotton
4bc763dafc Extend PiOS DELAY to allow querying the time value in uS 2011-05-26 12:19:04 -05:00
Oleg Semyonov
36d2a467e0 manualcontrol: fix copy/paste error 2011-05-26 00:16:36 +03: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
8bd08e381a build: add support for EE bank on pipx boards
The pipxtreme boards use a sector of the on-board flash
for configuration storage.  Adjust the memory maps to
reflect this.

The board_info_blob is also extended to include the EE
bank definitions.  This should be used by the pipxtreme
firmware rather than determining it based on chip size.
2011-05-24 01:10:40 -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
504fe7a664 dfu: fix typo WRITABLA -> WRITABLE 2011-05-24 00:58:10 -04:00
Stacey Sheldon
96827eecff build: Make all flight sw use pios_board_info_blob
Now that every bootloader build has a board info blob,
make all fw and bl images use it.

The following MACROS are removed:
  BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION,
  START_OF_USER_CODE, HW_TYPE

These values are now ONLY available from the bootloader
flash via the pios_board_info_blob symbol.  These values
must not be #defined or otherwise hard-coded into the
firmware in any way.  The bootloader flash is the only
valid source for this information.

NOTE: To ensure that we have an upgrade path from an
      old bootloader (without board_info_blob) to a
      new bootloader (with board_info_blob), it is
      essential that the bu_* targets do not depend
      on (or validate) the board_info_blob being present
      in the bootloader flash.
2011-05-24 00:58:10 -04:00
Stacey Sheldon
2d47427b05 link: Use alternate declaration of pios_board_info_blob
Make use of a shorter notation to allow the linker to provide
the correct address for pios_board_info_blob.
2011-05-23 18:21:42 -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
James Cotton
460cc1adc9 Merge remote-tracking branch 'origin/stac_add-bootloader-info-blob' 2011-05-19 16:08:58 -05:00
James Cotton
dd1e10a15d PiOS/Spektrum: Start swapping to using RTC and calls to PIOS_Spektrum_Get() to
monitor when call Spektrum watchdog
2011-05-18 01:46:00 -05:00
James Cotton
bdf862a712 PIOS/RTC: Add functions to get the rate. Also changed Start to Init to be more
consistent with pios.
2011-05-18 01:45:21 -05:00
dankers
5f32803763 Changed accelKp = 1; in 3C filter when calibrating bias when arming. Increase default yaw by 0.005 2011-05-17 04:15:28 +10:00
Stacey Sheldon
2044d777e6 coptercontrol: always enable -g debug symbols
This does not affect the size of the image or the RAM
used by the firmware image.  All debugging symbols are
stripped from the elf file during the conversion to a
.bin file.
2011-05-16 08:35:41 -04:00
Stacey Sheldon
575010169a build: add pios_board_info_blob struct to bootloader flash image
The board info blob is stored in the last 128 bytes of the
bootloader's flash bank.  You can access this data from the
application firmware like this:
  #include <pios_board_info.h>

  if (pios_board_info_blob.magic == PIOS_BOARD_INFO_BLOB_MAGIC) {
    /* Check some other fields */
  }

DO NOT link pios_board_info.c into your application firmware.
Only bootloaders should provide the content for the board info
structure.  The application firmware is only a user of the data.
2011-05-16 08:30:30 -04:00
Oleg Semyonov
39d4f23b67 Merge branch 'master' into OP-483_os_release-packaging 2011-05-15 21:32:20 +03:00
James Cotton
ae2759a957 Merge branch 'bugfix-flight' 2011-05-15 12:50:45 -05:00
James Cotton
eb2d094a66 Merge branch 'OP-499_216_Saving' 2011-05-15 10:09:29 -05:00
dankers
71d582495e On arm bias calibration terms now matches boot calibration terms 2011-05-16 00:16:19 +10:00
James Cotton
886f36dca1 Merge branch 'master' into OP-499_216_Saving 2011-05-15 03:58:30 -05:00