Commit Graph

89 Commits

Author SHA1 Message Date
David Sidrane 98394afcc7 board common:Define default CONTROL_STATUS LED mapping
This commit is the groundwork to fix the power LED
   blinking on V5

   Background:
   ----------
   Early boards only had an AMBER LED that was used to
   indicate a High Load condition.

   This change defines the new logical inteface
   the LED_<color> should not be used in application
   code moving forward, only the minipulator macros
   should be used.

       Logical usage             Legacy default
      ------------------------+-------------
       BOARD_OVERLOAD_LED     | LED_RED

   Later boards defined BOARD_HAS_CONTROL_STATUS_LEDS
   and added the use of a BLUE and GREEN LED that were
   used as follows:

   Logical usage             Legacy default
      ------------------------+-------------
       BOARD_ARMED_LED        | LED_BLUE
       BOARD_ARMED_STATE_LED  | LED_GREEN

   With this PR a board may now define _only_ a subset
   the leds and map them at the board level to the
   color LED it wants to use.

       Logical usage             Legacy default
      ------------------------+-------------
       BOARD_OVERLOAD_LED     | LED_RED
    when BOARD_HAS_CONTROL_STATUS_LEDS is defined
       BOARD_ARMED_LED        | LED_BLUE
       BOARD_ARMED_STATE_LED  | LED_GREEN

   If any of the BOARD_{OVERLOAD|ARMED|ARMED_STATE}_LED are not
   defined. The code output generates a null action for that
   LED.
2018-11-19 14:32:47 -05:00
David Sidrane 74695f3cfb stm32:add stm32 and stm32f7 board_hardfault_init 2018-10-25 07:52:37 +02:00
David Sidrane 2f6a297f3d board_common:Add API for hardfault init 2018-10-25 07:52:37 +02:00
Simone Guscetti 0f47272628 board_common: fix typo 2018-10-05 07:54:44 -07:00
Beat Küng 6c34407d57 version: rebase fixes & add bbblue 2018-10-03 10:30:10 +02:00
Beat Küng 703a5376bb bebop board config: add a separate SOC_ARCH_ID 2018-10-03 10:30:10 +02:00
Beat Küng b9a99969a7 board_get_uuid: fix alignment issues
board_get_px4_guid() called board_get_uuid() with a 2 bytes offset into an
uint8_t array. This gives no guarantees on alignment, and board_get_uuid()
casts it to an uint32_t array, leading to potentially unaligned accesses.
2018-10-03 10:30:10 +02:00
David Sidrane a934d6e3f2 samv7:Fixed incorrect index populating px4_guid 2018-10-03 10:30:10 +02:00
David Sidrane 03948c1ad3 kinetis:Fixed incorrect index populating px4_guid 2018-10-03 10:30:10 +02:00
Beat Küng daf05b3854 board_common: add PX4_SOC_ARCH_ID_UNUSED = 0 to PX4_SOC_ARCH_ID_t
Just to make sure we never have an UUID == 0
2018-10-03 10:30:10 +02:00
David Sidrane bdaff018b7 samv7:Add PX4 GUID API 2018-10-03 10:30:10 +02:00
David Sidrane 43f6c4df77 kinetis:Add PX4 GUID API 2018-10-03 10:30:10 +02:00
David Sidrane dc59e19bbb Moved PX4_SOC_ARCH_ID from px4_micro_hal to board_common 2018-10-03 10:30:10 +02:00
David Sidrane 695a7f6839 board_common:Added missing END_DECLS from rebase 2018-10-03 10:30:10 +02:00
David Sidrane 594da6247b board_common:Make board indenty API required. 2018-10-03 10:30:10 +02:00
David Sidrane ed9223edaf board_identity:Added common no-arch specific board_identity API
This common code can be used byt posix based boars to provide
   the board_identity API.
2018-10-03 10:30:10 +02:00
David Sidrane 1ac54f977e board_common:Documentation clean up 2018-10-03 10:30:10 +02:00
David Sidrane 7050657a6e board_identity:Add stm32 board_get_px4_guid and board_get_px4_guid_formated API 2018-10-03 10:30:10 +02:00
David Sidrane 1c2f8bd4c4 board_identity:Fix potential buffer over flow 2018-10-03 10:30:10 +02:00
David Sidrane f24a052355 board_common:Add PX4 GUID, deprecate other UUID API
The form of the PX4  GUID is as follows:
   offset:0         1         2         -           17
      <ARCH MSD><ARCH LSD><MSD CPU UUID>...<LSD CPU UUID>

   Where <ARCH MSD><ARCH LSD> are a monotonic ordinal number assigned by
   PX4 to a chip architecture (PX4_SOC_ARCH_ID). The 2 bytes are used to
   create a globally unique ID when prepended to a padded CPU ID.

   In the case where the CPU's UUID is shorter than 16 bytes it will be
   padded with 0's starting at offset [2] until
   PX4_CPU_MFGUID_BYTE_LENGTH-PX4_CPU_UUID_BYTE_LENGTH -1
   I.E. For the STM32
   offset:0         1     2  3  4  5  6             -            17
     <ARCH MSD><ARCH LSD>[0][0][0][0]<MSD CPU UUID>...<LSD CPU UUID>

   I.E. For as CPU with a 16 byte UUID
   offset:0         1         2         -           17
     <ARCH MSD><ARCH LSD><MSD CPU UUID>...<LSD CPU UUID>
2018-10-03 10:30:10 +02:00
David Sidrane b721b6a54a kinetis:Fixed hard fault when called with nullptr for errata
Logger was hard faulting on start due to a write to
  null pointer dereferece of errata
2018-08-23 14:26:32 -07:00
David Sidrane d466a09708 kinetis:Add MCU version decoding 2018-08-14 09:38:15 -04:00
David Sidrane 35960fb012 NXPHlite-V3:Add reset to bootloader detection
On the K66 we use the first word of the Battery backed up RAM
   as the bootloader - app communication location.
2018-08-14 09:38:15 -04:00
David Sidrane f2cb7b0ade board_common:Add underpinning for board manifest query 2018-07-20 18:29:58 +02:00
David Sidrane 6f665aee55 board_common:Update description to include paramater. 2018-07-17 08:53:29 +02:00
David Sidrane ab49b42f1c board_common:Extend board_supports_single_wire API to use UxART_BASE 2018-07-17 08:53:29 +02:00
David Sidrane c57928343c Create INVERT_RC_INPUT default usages 2018-07-17 08:53:29 +02:00
David Sidrane d986c14591 board_common:add board_supports_single_wire API 2018-07-17 08:53:29 +02:00
nathan f754d092f8 Initial omnibusf4sd target support
Flight tested: ekf2 w/ mag and compass by @nathantsoi: https://logs.px4.io/plot_app?log=79b81031-cf1e-41f0-890b-d6cd7d559766

NOTE: external I2C devices need a pullup. I have tested with a 3.3v 2.2k pullup.

Working:
 - mpu6000, bench tested and verified via nsh
 - fmu
 - all 6 ch output bench tested w/ pwm and oneshot via nsh
 - ppm input bench tested
 - dsm input bench tested
 - bmp280, bench tested and verified via nsh
 - hmc5883, bench tested and verified via nsh, but requires an external i2c pullup
 - gps on uart6
 - startuplog, nsh, mavlink on uart4, but params are not sent for some reason. RSSI pin is TX, MOTOR 5 is RX (normal mode, 57600 baud)
 - rgbled over i2c, bench tested and workingp
 - sbus via the shared sbus/ppm pin (which includes an inverter to the mcu SBUS in pin), remove the solder bridge or jumper to the ppm pin before use

Not yet implemented:
  - ADC
  - OSD: passthrough video is untested, use at your own risk until a basic driver is implemented.
2018-05-20 11:54:17 +02:00
Daniel Agar 8404889098 delete unused ADCSIM
- set BOARD_NUMBER_BRICKS to 0 for boards without analog power bricks
2018-04-29 21:48:54 -04:00
Daniel Agar ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
Simone Guscetti 20905ce478 stm32: board_reset, keep legacy definition for old chips 2018-03-19 09:46:58 +01:00
Simone Guscetti 2b81331f8a stm32: board_reset, change backup register
Change to be coherent with the change on NuttX upstream, in the future
STM32_BKP_BASE will be removed. This is using the definition over stm32_rtc.h interface.
2018-03-19 09:46:58 +01:00
Daniel Agar 53595bac0e board support add px4_i2c_bus_external/px4_spi_bus_external 2017-11-20 23:44:31 +01:00
David Sidrane 7ae999ecb3 HW Rev & Ver:0 for no value, -1 for not supported 2017-09-29 10:13:51 -04:00
David Sidrane 13c4a6cced HW Rev & Ver:0 for no value, -1 for not supported 2017-09-29 10:13:51 -04:00
David Sidrane 8451cb324e board_common: Add BOARD_HAS_HW_VERSIONING control 2017-09-29 10:13:51 -04:00
David Sidrane 04f7a7a47a stm32:Add board Revision and version API for FMUv5 HW detection 2017-09-29 10:13:51 -04:00
David Sidrane f3e925497d board_common:Break into internal and public api.
Internal functions are public functions that should realy only
   be called by the board config.
2017-09-29 10:13:51 -04:00
David Sidrane 9cc7148211 board_common:Documentation clean up merged 2017-09-29 10:13:51 -04:00
David Sidrane 7dc8f215f6 samv7 board identity:fix sign-compare 2017-09-29 10:13:51 -04:00
David Sidrane 83d870900c kinetis board identity:fix sign-compare 2017-09-29 10:13:51 -04:00
David Sidrane 5018723eb2 board_common:Define defaults for Open circuit max and UV min
BOARD_ADC_OPEN_CIRCUIT_V is the voltage present on an ADC due
   to the bias current on the terminition resistor.

   BOARD_VALID_UV is the under voltage min set by resistors on a
   board's Power selector.

   A battery is considered connected when the Voltage measures is
   greater than BOARD_ADC_OPEN_CIRCUIT_V.

   In the case where BOARD_ADC_OPEN_CIRCUIT_V is greater then
   BOARD_VALID_UV we can use the HW to qualify connected.
2017-09-29 10:13:51 -04:00
Daniel Agar 474f216a0a UAVCAN bootloaders split into separate repository (#7878) 2017-09-29 10:13:51 -04:00
Daniel Agar 01b3e6fd25 NuttX upgrade cmake wrapper (#7873)
* NuttX cmake

* px4_macros:Pass the stringified predicate as second arg to static assert

   CC_ASSERT mapes to the c++ static_assert or provides the same
   funtionality for c via the other macros. The c++ static assert
   takes 2 argumants the prdicate and a message. This fixes the
   lacking second argument.

* Updated nuttx and apps submodule to upstream nuttx 7.21+==master

   This is the latest uptake of upstream nuttx and apps.

* ROMFS generate with xxd instead of objcopy

* delete nuttx-patches

* NuttX update submodules to latest px4_nuttx-master

* fix nuttx apps and board dependency

* docker_run update to latest container 2017-08-29

* cmake ROMFS portable sed usage

* NuttX update submodules to latest px4_nuttx-master
2017-09-29 10:13:51 -04:00
David Sidrane f04ddf4368 Inital Commit of px4-same70xplained-v1 2017-09-29 10:13:51 -04:00
David Sidrane f5ed7586bf boards common:Fix formating 2017-09-29 10:13:51 -04:00
David Sidrane b4a9c1578b board common:spi_dev_e is now uint32_t in NuttX
Using new type of uint32_t for spi device and macros
   that define a PX4 device on a given BUS and Chip Select
   Refactored to pack the PX4 format in the new NuttX format
2017-09-29 10:13:51 -04:00
David Sidrane 7a4c5c3475 Added board_read_VBUS_state to board_common API 2017-09-29 10:13:51 -04:00
David Sidrane c168bd248f Use Proper ponter conversion
When PX4_CPU_UUID_BYTE_FORMAT_ORDER is not defined properly
 cast the arument for calling board_get_uuid_raw
2017-09-29 10:13:51 -04:00