Commit Graph
624 Commits
Author SHA1 Message Date
David Sidrane 90fd7734bb px4fmu-v5:Define UI LEDs per the FMUv5 Spec 2017-07-17 21:02:50 -10:00
David Sidrane a254b0dca5 px4fmu-v5:Define the FMU_CAP[1:3] per FMUv5 Spec 2017-07-17 21:02:50 -10:00
David Sidrane 14ce28b1f3 px4fmu-v5:GPIO Clean up per FMUv5 Spec.
Added comments to ADC defines with Pin numbers.
  Added the GPIO_HW_{REV:VER}_DRIVE signals
  Define the GPIO_nPOWER_IN_{A:C] and assign them to
  BRICK1, BRICK2 and USB Valid.
  Regroupped power signals and defined true logic Power Control macros
  in the arch agnostic form.
  Defined the same IOCTL defines for FMU GPIO IOCTL
  Use the power Control macros on board_app_initialize
2017-07-17 21:02:50 -10:00
David Sidrane d33b945db6 px4fmu-v5:SPI chip selects per FMUv5 Spec 2017-07-17 21:02:50 -10:00
David Sidrane 8607b72805 px4fmu-v5:Removed unused LED alias defines. 2017-07-17 21:02:50 -10:00
David Sidrane 892ae1436c px4fmu-v4pro::Insure the discharge of the PWM pins on rest.
As done on fmuV4 on resets invoked from system (not boot) insure
  we establish a low output state (discharge the pins) on PWM pins
  before they become inputs as a result of the pending reset.

  We also delay the reset by 400 MS to insure the 3.1 Ms pulse is
  not too close to the last PWM pulse.
2017-07-17 21:02:50 -10:00
David Sidrane b23e6fc87c px4fmu-v4pro:Define GPIO xxx_VALIDs and initalize them.
The LTC4417 provides a valid signals for brick1, brick 2 and USB
  This change  configures the GIOP and provides 1) a MACRO to read
  the pin and 2) the IOCTL defines to read it from the FMU.

  The macro's result is true logic: It is true when the signal is active.
  (Active low on the the LTC4417). The IOCTL read would be the actual
  pin state.
2017-07-17 21:02:50 -10:00
David Sidrane 258faeee03 px4fmu-v4:Define GPIO GPIO_VDD_USB_VALID and initalize it.
The V4 HW replaced the LTC4417 provided valid signal for USB.
  with an active high, version. This commit configures the GIOP
  and provides 1) a MACRO to read the pin and the IOCTL defines
  to read it from the FMU. The macro result true logic: true
  when the signal is high. The IOCTL read would be the actual
  pin state.
2017-07-17 21:02:50 -10:00
David Sidrane f7cc78bffe px4fmu-v2:Define GPIO GPIO_VDD_USB_VALID and initalize it.
The LTC4417 provides a valid signal for USB. This change
   configures the GIOP and provides 1) True logic macro to
   read the pin and the IOCTL defines to read it from the FMU.
   The macro will return true when the signal is active (low
   on the LTC4417). The IOCTL will read be the actual pin state.
2017-07-17 21:02:50 -10:00
David Sidrane 4188c4d0d5 px4fmu-v5:Turn On SD card 2017-07-17 21:02:50 -10:00
David Sidrane a09bc63747 px4fmu-v5:Use PX4_ERR in board init, spi init and sdio init 2017-07-17 21:02:50 -10:00
David Sidrane 229c5d482f px4fmu-v5:More GPIO_VDD_3V3V_SD_CARD_EN -> GPIO_VDD_3V3_SD_CARD_EN 2017-07-17 21:02:50 -10:00
David Sidrane 46daebfb6c px4fmu-v5:Removed a SPI 5 reeady signal from board_spi_reset
board_spi_reset is used to reset the internal SPI bus.
   therefore GPIO_SPI5_DRDY7_EXTERNAL1 should not have been
   minipulated, as it is on SPI5
2017-07-17 21:02:50 -10:00
David Sidrane 59d020fba3 px4fmu-v5:Added comment block to board_spi_reset 2017-07-17 21:02:50 -10:00
David Sidrane 85b6986079 px4fmu-v5:Fix board_peripheral_reset to use correct polarity
GPIO_nVDD_5V_PERIPH_EN is Active low. board_peripheral_reset
   need to tune it OFF then ON
2017-07-17 21:02:50 -10:00
David Sidrane ebc8b47fad px4fmu-v5:Added board_on_reset api to reset PWM 2017-07-17 21:02:50 -10:00
David Sidrane 54bd0a9f2a px4fmu-v5:Using arch agnostic gpio init
Define the GPIO pin list use the board_gpio_init
2017-07-17 21:02:50 -10:00
David Sidrane 044b845c40 px4fmu-v5:Match GPIO_VDD_3V3_SD_CARD_EN and polarity to FMUv5 Pin Spec RC01
Removed extra V GPIO_VDD_3V3[V]_SD_CARD_EN and it is active High
2017-07-17 21:02:50 -10:00
David Sidrane 82dc6de19f px4fmu-v5:Define the BOARD_NUMBER_BRICKS for future enumeration
When BOARD_NUMBER_BRICKS exists it will enable multiple
   power source testing and reporting.
2017-07-17 21:02:50 -10:00
David Sidrane b9f43068af px4fmu-v5:Define the existance of the UI PWM LED and it's polarity
Per https://docs.google.com/spreadsheets/d/1-n0__BYDedQrc_2NHqBenG1DNepAgnHpSGglke-QQwY/edit#gid=730959725
  Usage of the PWM UI led is optional and if used it's polaity may
  be set ot Active low or high.
2017-07-17 21:02:50 -10:00
David Sidrane 33cd8c7093 px4fmu-v5:Fixed comment 8 PWM 2017-07-17 21:02:50 -10:00
David Sidrane e20d685f40 px4fmu-v5:Add Timer and Channel to comment for HEATER 2017-07-17 21:02:50 -10:00
David Sidrane c1eac11823 px4fmu-v5:Match signals names to FMUv5 Pin Spec RC01 2017-07-17 21:02:50 -10:00
David Sidrane 5669434585 px4fmu-v5:Define ADC GPIO and Channels clearly
Moving forward we want all the board configs to drive the
   configuration. This is just cleanup to give a clear
   example of how ADC should be defined by a simple list,
   based on ADC pin number as related to the GPIO and
   channel number. Then the xxx_CHANNEL bit are
   used to form the ADC_CHANNELS (mask). The GPIO
   will are used to for a list for initalization.
2017-07-17 21:02:50 -10:00
David Sidrane 5ba02d740c px4fmu-v5:Group SPI signals by bus 2017-07-17 21:02:50 -10:00
David Sidrane 88c1521b5e px4fmu-v5:Status LED's are driven open drain
Allows Anaode of LEDs to be tied to V5 or V3.3
2017-07-17 21:02:50 -10:00
David Sidrane 68e5764dbc board common:Add arch agnostic gpio init 2017-07-17 21:02:50 -10:00
Simone Guscetti ada48571d7 fmu-v5: fix timer config 2017-07-17 21:02:50 -10:00
Simone Guscetti a00441ecf4 fmu-v5 timer_config: timer io channels for FMU_CH7/8 2017-07-17 21:02:50 -10:00
Simone Guscetti a4d8bf56cc fmu-v5 timer_config: set up the timers for v5 board
FMU_CH7/8 use timer 12 ch1/2
FMU_CAP use timer 2
Buzzer use timer 9
2017-07-17 21:02:50 -10:00
Simone Guscetti bc793d15cf fmu-v5 board_config: add FMU_CH7 and FMU_CH8 2017-07-17 21:02:50 -10:00
Simone Guscetti db9bef352a fmu-v5 board_config: config SPI5 sync and reset pins 2017-07-17 21:02:50 -10:00
Simone Guscetti 1e86f24cf9 fmu-v5 board_config: set up external spi 2017-07-17 21:02:50 -10:00
Simone Guscetti 74dfa8805f fmu-v5 board_config: power A is the brick voltage sensing 2017-07-17 21:02:50 -10:00
Simone Guscetti 518383ada8 fmu-v5: update board config to the newest pin assigment 2017-07-17 21:02:50 -10:00
Simone Guscetti 308295f648 fmu-v5: fix compiling errors 2017-07-17 21:02:50 -10:00
Simone Guscetti 30f9c61e67 fmu-v5: started updating board config to newest specs 2017-07-17 21:02:50 -10:00
Julien Lecoeur abcb920df4 Fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7.1.0
BMP280: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

gnss: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

fmu: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

timer.c: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

px4cannode_led: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

Fix -Werror=implicit-fallthrough on gcc7
2017-07-18 08:24:37 +02:00
Julien Lecoeur d477b1f0f4 Fix -Werror=stringop-overflow on gcc 7
This prevents the compiler from optimising pdump. The error was:
Firmware/src/drivers/boards/common/board_crashdump.c:41:2: error: 'memset' writing 3240 bytes into a region of size 4 overflows the destination [-Werror=stringop-overflow=]
  memset(pdump, 0, sizeof(fullcontext_s));
2017-07-18 08:24:37 +02:00
Beat Küng bf11362dae i2c_posix: fix use of wrong device path
previously, get_devname() was used as the I2C device path, but on NuttX,
get_devname() is the device file which the driver creates. This patch
changes it, so the sematics are the same as on NuttX: both now use _bus
to decide to which I2C bus device to talk to.

I did not see any other use-cases than the led on ocpoc.
2017-07-13 16:53:28 +02:00
Beat Küng 2cf88156a9 cmake: remove -Os from COMPILE_FLAGS in px4_add_module()
This is already added to the global list, and we already removed this
flag previously, but some of them sneaked back in.
2017-07-13 16:53:28 +02:00
David Sidrane 22d0ea15de px4fmu-v3:Add ICM20608 aliased to the PX4_SPIDEV_ACCEL_MAG to the v3 build
The Pixkhawk mini was not chip selecting the ICM20608 as it did
   not define PX4_SPIDEV_ICM_20608. This allow the fmu V2 rc code
   to init the ICM20608.
2017-07-11 09:49:22 +02:00
David Sidrane 195468bf06 px4fmuv4pro:Init GPIO_VDD_3V3_SENSORS_EN off at reset
Insure a 0.0 voltage initial condition on VDD_3V3_SENSORS
  By starting the GPIO_VDD_3V3_SENSORS_EN, low and deferring
  the GPIO init of the slave selects and drdy signals until
  board_app_initialize. We get ~ 180 ms of power off time
  with 0.00 voltage applied to the sensors.
2017-07-11 08:34:26 +02:00
David Sidrane 6eff7deb7e Extend the delay ensure post reset pulse delayed.
Given the original poster's comment that "It happens very consistently for us." I suspect the motor spin observed in https://github.com/PX4/Firmware/issues/7457 is not caused by the original issue of slow decay on the PWM pins at reset, but the post reset pulse of 3.1 Ms arriving in a window that the ESC considers it valid.

The results from testing, indicated that the if the PWM pins were clamped low for > 300 Ms, prior to reset the motors did not spin. This would delay the the post reset pulse of 3.1 Ms out by > 300 Ms. 

This change delays the reset and therefore the pulse by at least 400 Ms.
2017-07-08 10:51:43 +02:00
David Sidrane 65d8b5c9cd px4fmu-v4:Insure the discharge of the pins PWM pins on rest.
On resets invoked from system (not boot) insure we establish a low
  output state (discharge the pins) on PWM pins before they become
  inputs.
2017-07-08 10:51:43 +02:00
David Sidrane fc25213811 auav-x21:Delete PX4_I2C_BUS_ONBOARD 2017-06-29 07:59:56 +05:30
Beat Küng 410e822775 px4fmu-v4pro board_config: swap BRICK1 with BRICK2
problem: previously when connecting power to Power 1, commander refused
to arm (no power source error), and when connecting to Power 2, arming
works, but power consumption was not measured (& shown in QGC).
Swapping Brick1 with Brick2 makes sure both works when connecting to
power 1.

Ideally we will have support for both power sources (including fail-over)
2017-06-19 16:52:41 +02:00
davidaroyer 8e0b8314c6 drivers: move board specific device path to board_config.h 2017-06-04 04:24:50 +08:00
davidaroyer 0510cd5992 drivers: add support for Aerotenna OcPoC-Zynq hardware 2017-06-04 04:24:50 +08:00
Kevin Lopez Alvarez cdf941e78b Fix code style 2017-05-20 10:23:28 +02:00