21796 Commits

Author SHA1 Message Date
David Sidrane
577b4cf2f9 zubaxgnss-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
f550631ecf s2740vc-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
92ca9fa035 px4flow-v2 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
cbdc6dde7d px4esc-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
c7ace100bf px4cannode-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
c8432ae273 esc35-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
78e2a293d2 Fix UAVCAN bootloader builds broken by os calls from stm32_flash
Recent upsteam NuttX changes needed by PX4 added sem_[wait|post]
   in the stm32_flash driver.

   UAVCAN Bootloaders do not use the OS's scheduler etal.
   This commit nops the sem_[wait|post] with linker magic.
   Which precludes the linking the nuttx scheduler in the
   bootloader build.
2017-03-24 16:22:47 +01:00
David Sidrane
5c6264ae35 Backport:stm32_flash changes from upsteam
PX4 contrib from <jose.souza@intel.com>

  1) stm32: Fix erase sector number for microcontrolers with
     more than 11 sectors

     Erase a sector from the second bank cause the bit 4 of SNB being set
     but never unsed, so trying to erase a sector from the first bank
     was acually eraseing a sector from the second bank.
  2) stm32: Make up_progmem thread safe

   Writing to a flash sector while starting the erase of other sector
   have a undefined behavior so lets add a [staticaly initalized]
   semaphore and syncronize access to Flash registers.

  3) Add workaround for flash data cache corruption on
     read-while-write

    This is a know hardware issue on some STM32 see the errata
    of your model and if you make use of both memory banks you
    should enable it.

  4) Greg's cleanup

  5) PX4 clean up

    stm32_flash:Need conditional on non F4 targets
2017-03-24 16:22:47 +01:00
David Sidrane
8810f70fdc Renamed for ordering and classification
Last patch to rename.
2017-03-24 07:27:55 +01:00
David Sidrane
a5fa4e9c02 Restructure patch ordering and dissolve 90000-wip-inflight-to-upstream.patch (#6878)
* Order patch application

   Per discussion with @demarchi this PR adds ordering to the
   patch application.

   This alos add some encoding
   00000      series - is for px4 non up streamable changes
   60000 (bp) series - is for back ports
   90000      series - is for wip that shold make it upstream

* Restore 00010-workarround-for-flash-data-cache-corruption

  Extract this from the 90000-wip-inflight-to-upstream.patch
  and orders it.

* Moved upstreamed 0dbf44e flash fix to bp patch

* Moved upstreamed 5481087 cdcacm fix to bp patch

* Moved upstreamed ec85425 STM32F7 copy paste errors to bp patch

* Moved upstreamed 20e7237 HSI should not be turned off to bp patch

* Moved upstreamed ca895b9 Adding missing CONFIG_ prefix to bp patch

* Moved upstreamed 169b398 STM32: Fixes the bkp reference counter issue to bp patch

* Moved upstreamed 550d259 STM32F7: Fixes the bkp reference counter issue to bp patch

* Moved upstreamed 02825f3 STM32F3X: Add missing STM32_BKP_BASE to bp patch

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Renamed for ordering and classification

* Order Patches by Name
2017-03-23 10:23:16 -10:00
Beat Küng
941d17d74c cmake: make sure params defined in external modules are found 2017-03-23 08:37:48 +01:00
Beat Küng
a4fc7ae95e simplify px_process_params: remove --modules, use a list for --src-path instead 2017-03-23 08:37:48 +01:00
David Sidrane
8cdde42e32 px4io-v2:Fixed GPIO_PPM_IN definition 2017-03-23 08:33:03 +01:00
David Sidrane
0d59e84953 px4io-v1:Fixed GPIO_PPM_IN definition 2017-03-23 08:33:03 +01:00
Lorenz Meier
fd0efac2b5 IO driver: Run attitude control group limited until the device speed gets set 2017-03-23 08:28:15 +01:00
David Sidrane
5abdb8fbe9 Fixed spelling - onshot->oneshot 2017-03-23 08:28:15 +01:00
David Sidrane
e04d43218a Revert "fmu add command line onshot mode"
This reverts commit 22738b1213fff704d288ec84976fa84ff9535aba.

   The command was added due to a lack of my understanding of how the pwm command can be used.

   The command is not needed as the all flag can be used or a proper
   mask WHIHOUT -g

   fmu task mode_pwm
   pwm rate -a -r 50 -d /dev/pwm_output0
   pwm arm
   pwm test -a -p 500

   fmu task mode_pwm
   pwm oneshot -a -d /dev/pwm_output0 is the same as pwm oneshot -m 0xff  -d /dev/pwm_output0
   pwm arm
   pwm test -a -p 500
2017-03-23 08:28:15 +01:00
David Sidrane
2368d94f53 Fixed low on stack waning 2017-03-23 08:28:15 +01:00
David Sidrane
f32f194ad8 fmu add command line onshot mode 2017-03-23 08:28:15 +01:00
David Sidrane
75376b7793 Bugfix:Allow mode switch on a free timer 2017-03-23 08:28:15 +01:00
David Sidrane
11191e54e0 use io_timer_set_PWM_mode not direct reg 2017-03-23 08:28:15 +01:00
David Sidrane
d21c44704d Propgate any errors in setting the rate up.
Since the Onshot<->PWM mode is changed based on rate. The
 this signale the higher layers that the operation is invalid

 test case:
   fmu task mode_pwm2cap2
   pwm oneshot -m 0xf -g 0 -d /dev/pwm_output0

   should fail, because all the channels in the group are
   not in the same mode.
2017-03-23 08:28:15 +01:00
David Sidrane
f5bc3dbc4e drv_io_timer Support OneShot
1) Updated copyright
  2) Defined BOARD overrideable BOARD_PWM_FREQ and BOARD_ONSHOT_FREQ
     Not recogmended but allow experimentation
  3) Solved the support for BOARD_PWM_DRIVE_ACTIVE_LOW using
     the Polarity control bits as apposed to the negation of
     the ARR.
  4) Added a cache for getting a timers channels. This is static
     and benifits from the qucik response.
  5) Added a function to realocate all channes in a given timer
     from one mode to another.
  6) Removed the frequecy table in favor of the intended use of the
     channel mode set. At it is the way to determine the mode of a
     channel. Or in onshot's case a timers's complete set channels.
  7) Added 2 lowlevel mode changing functions:
     io_timer_set_oneshot_mode and io_timer_set_PWM_mode
     that encapsalate the changes in mode to one place
     in the code.
  8) Added io_timer_trigger (the up_pwm_update) with low
     latancy timer to time in updating.
  9) io_timer_set_rate - use sets to enforce all or none
     rules for switching  PWM<->OneShot.
     Onshot is entered using the very approriate rate of 0.
     Only deltas will change the HW state.
2017-03-23 08:28:15 +01:00
David Sidrane
96db91c468 drv_io_timer Add simplified Oneshot API
1) Define IOTimerChanMode_OneShot
   2) Added detailed commnent on .clock_freq and how it is used
   3) Added single additional API point in support of Onshot mode
      io_timer_trigger - That trigger all timer's channels in Oneshot
      mode to fire the oneshots with updated values.
2017-03-23 08:28:15 +01:00
David Sidrane
b01768addc px4iofirmware mixer uses new Oneshot API
As discusssed in https://github.com/PX4/Firmware/pull/6678#discussion_r104177663
   this take the safe approach to only call up_pwm_update on a valid mix
   it does keep intatct the riginal author (OA) had an intent.
2017-03-23 08:28:15 +01:00
David Sidrane
6309642c37 px4iofirmware registers uses new Oneshot API
1) Use up_pwm_retrigger to triger onshot
   2) Updated comment to explain why a rate of zero makes sense
      to set oneshot mode.
   3) Updated copyright
2017-03-23 08:28:15 +01:00
David Sidrane
30c8e6efac drv_pwm_servo provide the simplified interface for OneShot
1) Validate timer paramater before using it.
  2) Allow rate of 0 to enter Oneshot mode
     At first blush this seamed like a hack, but at Mark
     pointed out to me, Onshot PWM does not have a rate
     So this is a realy a clever and beautiful simplification
     on his part!
  3) Exposes up_pwm_update that runs io_timer_trigger
     Which trigger all timer's channels in Oneshot mode to
     fire the oneshots with updated values.
2017-03-23 08:28:15 +01:00
David Sidrane
938824500c Only expose up_pwm_update for onshot
This api will REWORD
2017-03-23 08:28:15 +01:00
David Sidrane
8984b441a0 pwm test uses Onshot API
At at a period greater than the the max Oneshot pulse width
  Trigger all timer's channels in Oneshot mode to fire the
  oneshots with updated values.
2017-03-23 08:28:15 +01:00
David Sidrane
6dc3b1cac6 Revert "add macro PX4FMU_TASK to board_config"
The fmu now support the commandline option to be run as a task
   or off a work queue.
   This reverts the board_config.h changes from commit
   e33af23122f5ee3030bb9745bbbf616b24c2a14a.

Conflicts:
	src/drivers/px4fmu/fmu.cpp
2017-03-23 08:28:15 +01:00
David Sidrane
71c25611b5 fmu warnx->PX4_WARN 2017-03-23 08:28:15 +01:00
David Sidrane
fc099879be fmu can be run as a task or as worker thread
The new optional option is
  fmu [task] ....

  fmu task mode_pwm - start fmu as a task
  fmu  mode_pwm     - start fmu as a worker
2017-03-23 08:28:15 +01:00
David Sidrane
07834e51b7 fmu:Ensure work_stop still called work_cancel 2017-03-23 08:28:15 +01:00
David Sidrane
9227547886 fmu added comments & updated copyright 2017-03-23 08:28:15 +01:00
David Sidrane
0ce854ad55 Support onshot command 2017-03-23 08:28:15 +01:00
David Sidrane
6bc0420137 pwm warnx->PX4_WARN 2017-03-23 08:28:15 +01:00
David Sidrane
cdd961d2b9 pwm remove arch dependancy 2017-03-23 08:28:15 +01:00
David Sidrane
d92cb75b26 pwm use px4_getops 2017-03-23 08:28:15 +01:00
Mark Whitehorn
8b6b4ccee9 add macro PX4FMU_TASK to board_config 2017-03-23 08:28:15 +01:00
Mark Whitehorn
f7f12759cd Revert "add timer validation call"
This reverts commit 30fe2aa4fb8c099028fd5ca4f50940e88eddbb08.
2017-03-23 08:28:15 +01:00
Mark Whitehorn
bbebf980d8 add timer validation call 2017-03-23 08:28:15 +01:00
Mark Whitehorn
b5169b0c7b uncomment FMU servo readback test 2017-03-23 08:28:15 +01:00
Mark Whitehorn
9e3488af46 don't update servos if mixer_mix_threadsafe() failed to run 2017-03-23 08:28:15 +01:00
Mark Whitehorn
dd25366b86 clean up timer_set_rate and add advice on hacking counter frequency 2017-03-23 08:28:15 +01:00
Mark Whitehorn
2d5588ae02 simplify oneshot mode selection; use zero PWM rate as indicator
cleanup and remove unused (new) params
2017-03-23 08:28:15 +01:00
Mark Whitehorn
aa9fbbedd5 add oneshot mode capability
change fmu to task

increase fmu_servo task priority to max and enable true oneshot

use lowest FMU priority which minimizes jitter

constrain oneshot updates to control group 0 events
2017-03-23 08:28:15 +01:00
David Sidrane
eac72051b8 Backport of stm32f7 add DTCM to heap and use it on F7 (#6865)
* Backport:stm32f7: stm32_allocateheap: allow use DTCM memory for heap

   Back port of upstrem contrib by Jussi Kivilinna <jussi.kivilinna@haltian.com>

   stm32f7: stm32_allocateheap: allow use DTCM memory for heap

   STM32F7 has up to 128KiB of DTCM memory that is currently left unused.

   This patch adds DTCM to main heap if CONFIG_STM32F7_DTCMEXCLUDE is not enabled.

* px4fmu-v5_default:Enable inclusion of the DTCM in the heap

  CONFIG_MM_REGIONS=3 adds the DTCM region to the heap.
2017-03-22 13:52:01 -10:00
Dennis Mannhart
be500723cd mc_pos_control: gradual vel fix for slope 2017-03-22 15:21:34 +01:00
Dennis Mannhart
20a47a1a72 mc_pos_control: limit if just xy distance close to target 2017-03-22 15:21:34 +01:00
Dennis Mannhart
f9551c12de mc_pos_control: param fix and gradual vel fix 2017-03-22 15:21:34 +01:00