Commit graph

42249 commits

Author SHA1 Message Date
Laurentiu Palcu
e5dc7ac363 sensor: bmi160: switch to the new logging API
Change-Id: Id370e06e95528c223e09bb4110eeec3dcc2d4aef
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:15 +00:00
Laurentiu Palcu
01d133a201 sensor: bmi160: add trigger tests to the application
Also, lower the clock for the SPI bus in order not to hit the DW
controller CS issue.

Change-Id: I69c4211bfa6efb85117185e2ae813dd7c4915a7a
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:15 +00:00
Laurentiu Palcu
8943f6c5ce sensor: bmi160: add support for triggers
Add support for anymotion and data ready triggers. Also, the user can
choose at configuration time the source of the triggers. For quark, in
particular, since the current driver for ARC does not allow receiving
interrupts from AON GPIO controller, IPM is used: a helper app on x86,
registers a gpio callback and will 'relay' the interrupt, through IPM,
to arc core.

Origin: Original
Change-Id: I170d723425c6280f9aa8c240b66275647723edd9
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu
f71df44204 sensor: bmi160: make some read/write functions global
These will be needed by the trigger implementation.

Change-Id: Ib408ae540571447059301046a3486cedffa735d5
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu
5609ec95ee sensor: bmi160: fix bmi160_reg_field_update function
A mask was not applied on the shifted value, hence allowing one to pass
a val that would change other fields in the register.

Change-Id: I3c7bdb24c7b3a0ce94f664dbba303db35660ce7b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu
77e28d2263 sensor: bmi160: create two wrappers for bmi160_reg_val_to_range
These will be used in the trigger implementation, which is a different
file, and will allow for the arrays to be static.

Change-Id: Ia34ebe9bde7d09abe8e93f3ace9e282cee1169db
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:13 +00:00
Laurentiu Palcu
6330388bf5 sensor: bmi160: move the printing macro to the header
The macro will be used in the upcoming trigger file.

Change-Id: I57a570fde37f31771b3d8bb9c028520fdc41da8f
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:13 +00:00
Laurentiu Palcu
b70278f113 sensor: bmi160: add x86 app for Arduino101
This app is needed for Arduino101 only, or boards using the Curie
module.

BMI160 interrupt pin is connected to AON GPIO controller. The driver
handling the AON GPIO controller runs on x86 core. Even though, the AON
GPIO controller is accesible to ARC core too, the current implementation
for Designware controller driver does not allow it. Hence, this app will
register a gpio callback and signal the ARC core through IPM.

Other boards that use a gpio pin on the regular GPIO controllers don't
need this app.

Origin: Original
Change-Id: I225ca60735e39c7a47693dc53237f48cd9ac2680
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Laurentiu Palcu
8d7f52c2d9 sensor: sensor.h: fix typo
Change-Id: I989cd3de1096848c354b7eb597665849bc37bdb0
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Laurentiu Palcu
559112a6a0 sensor: bmi160: move sample app to arc subdirectory
The movement is needed because on some boards, like Arduino101, the
current GPIO driver implementation does not allow for receiving
interrupts from AON GPIO controller directly on ARC core. Hence, IPM is
needed to relay the interrupts from x86 to arc.

However, other boards that can use a regular GPIO intterupt or users
that connect a BMI160 chip separately, can still use the ARC application
as is.

Change-Id: I58dd77edd45ea2b071db5b99073eb15722847bfe
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Szymon Janc
cef3c59488 Bluetooth: Refactor bt_init
This makes function flow follow common error handling convention
err = foo()
if (err)
  return err

Change-Id: Ifa3f44e3857b50436212cd5ed240795b220f8a15
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-21 14:03:10 +00:00
Grzegorz Kolodziejczyk
0d98a3633e Bluetooth: tester: Add support for seqence gatt database
This patch reorganize tester gatt commands to handle also sequence
builded gatt data base

Change-Id: I5fc89c1c498dd2ecf3999bc93e3caffd14f67cb7
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-21 13:32:42 +00:00
Johan Hedberg
3fbe227cdd Bluetooth: tests: Add DEBUG_DRIVER to automated tests
Change-Id: I9fa76816ceb1f6a49861a1145ae85394b6a64c80
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-21 10:41:48 +03:00
Johan Hedberg
b090d75d62 Bluetooth: drivers/h5: Remove redundant BT_DBG()
Change-Id: I90e7caadfb357c1c2451b0108d11ce57c0dae77a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-21 10:41:48 +03:00
Andrei Emeltchenko
503d01a96c Bluetooth: Fix typo tupe to type
Fixes compilation with debug for drivers h4 and h5

Change-Id: Ia09ce0a5ca3d684a4f9d25fdfe8530e80a46afac
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-21 10:09:30 +03:00
Yannis Damigos
2b8d3626c6 sanitycheck: Add olimexino_stm32 board to sanitycheck
Adds olimexino_stm32 board to sanitycheck.

Change-Id: Icd0e5025bc7a348c7a1a4d18d10d2d1e3a9817bd
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-04-20 22:29:02 +00:00
Yannis Damigos
7a33682a03 doc/board: Add documentation file for olimexino_stm32
Adds documentation file of oliemxino_stm32 to the
supported boards.

Change-Id: Ide6c7767be56d33e8c040a03df13337919a09750
Origin: Original
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-04-20 22:29:02 +00:00
Yannis Damigos
de22f4e55e boards/olimexino_stm32: add new board
Add configuration for OLIMEXINO_STM32 board.
By default, the UART console is forwarded to USART1 available on
UEXT connector. All GPIO ports available on the connecot headers
are enabled.

Change-Id: I60b3ff20ea60b5294a3a6c31f4dba0802794f9d8
Origin: Based on nucleo_f103rb board
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-04-20 22:29:01 +00:00
Anas Nashif
1d93e321e8 samples: ipm: reset kernel binary name to zephyr
Those samples are confusing test suites by not generating
the expected zephyr.bin binary.

Change-Id: I4fb81782bacafb4f259e088df4b2518faa6f47cf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-20 17:20:10 +00:00
Johan Hedberg
560956c54d Bluetooth: Kconfig: Split debug selection into a choice
This prepares for adding other debug types besides the printf-style
logging to the console.

Change-Id: Ic2ed305192491734da991c4f61fdaace03fd60f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-20 17:46:09 +03:00
Johan Hedberg
5cec79e4c8 Bluetooth: Add dedicated bt_send() function
This helps avoid digging out the driver and send callback pointers,
and helps prepare for extended logging support to export the HCI
traffic externally.

Change-Id: I1a9a58a6b47babed41b5bb9349635478905352e1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-20 14:46:48 +03:00
Bogdan Davidoaia
b628aa8a87 sensors: bma280: add support for BMC150 accelerometer
Add support for BMC150 accelerometer which differs from BMA280 only in
id, I2C address and acceleration data width.

Change-Id: Iccf47ecc5de9fdb1b9e45f1561c5dbb54f720806
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-19 18:40:43 +00:00
Bogdan Davidoaia
0eec9492fc sensors: bma280: fix accel data sample calculation
The values from the accel data sample msb and lsb registers need to
be concatenated (using bitwise or) and not added, since together they
represent a single 14-bit value.

Change-Id: I476f05512beb3d6b81bacefd4c52e4b2a541708b
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-19 18:40:43 +00:00
Bogdan Davidoaia
62fca8fcc1 sensors: bma280: compute accel scales based on data width
Compute acceleration data and threshold scales based on data width and
acceleration measurement range instead of defining LSB values for each
measurement range.

Change-Id: I2a15877cef00d49d7a64fd6f6003722bb9f80b92
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-19 18:40:42 +00:00
Arkadiusz Lichwa
bf62dfad70 Bluetooth: BR/EDR: Initiate encryption on link
Adds method to start encrypting the link by local controller. Encryption
implies successful authentication to be done before.

> HCI Event: Auth Complete (0x06) plen 3
	Status: Success (0x00)
	Handle: 11
< HCI Command: Set Connection Encryption (0x01|0x0013) plen 3
	Handle: 11
	Encryption: Enabled (0x01)
> HCI Event: Command Status (0x0f) plen 4
	Set Connection Encryption (0x01|0x0013) ncmd 1
	Status: Success (0x00)
> HCI Event: Encryption Change (0x08) plen 4
	Status: Success (0x00)
	Handle: 11
	Encryption: Enabled with E0 (0x01)

Change-Id: I3bbfc6ca77a6fd088582ab45f14d7c122aec7f05
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:50:31 +00:00
Arkadiusz Lichwa
99483fded6 Bluetooth: BR/EDR: Notify about pairing while JustWorks
In some cases 'justworks' model applied on authentication/pairing process
requires user attention.
BT Core 4.2 says in table 5.7 [Vol 3, Part C, 5.2.2.6] that not always
passkey auto-accept can be applied on both devices involved in SSP
pairing for this authentication association model.

Change-Id: I7cc575ac088bcce7830f22d08e49dab40889f515
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:49:18 +00:00
Arkadiusz Lichwa
9d9e349b31 Bluetooth: BR/EDR: Initiate authentication
Enables initiate authentication using possibility to change security
level on link by calling internal security API. In case of failure
resets pairing state flag to re-enable change security on subsequent
authentication attempts.

To verify the process of authentication run BT shell app from
tests/bluetooth/shell folder and use commands like below:
 >br-connect xx:xx:xx:xx:xx:xx
 [Connected: xx:xx:xx:xx:xx:xx]
 >security 1

HCI log:
> HCI Event: Connect Complete (0x03) plen 11
	Status: Success (0x00)
	Handle: 11
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	Link type: ACL (0x01)
	Encryption: Disabled (0x00)
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
	Handle: 11
> HCI Event: Command Status (0x0f) plen 4
	Authentication Requested (0x01|0x0011) ncmd 1
	Status: Success (0x00)
> HCI Event: Link Key Request (0x17) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: Command Complete (0x0e) plen 10
	Link Key Request Negative Reply (0x01|0x000c) ncmd 1
	Status: Success (0x00)
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: PIN Code Request (0x16) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	PIN length: 4
	PIN code: 0000
> HCI Event: Command Complete (0x0e) plen 10
	PIN Code Request Reply (0x01|0x000d) ncmd 1
	Status: Success (0x00)
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: Link Key Notification (0x18) plen 23
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	Link key: d9ff76c09284c1ed369851f87d7ac623
	Key type: Combination key (0x00)
> HCI Event: Auth Complete (0x06) plen 3
	Status: Success (0x00)
	Handle: 11

Change-Id: I2d383d34e19c04ead3fa254e5514d5c7f352a21e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:48:45 +00:00
Johan Hedberg
d458c616df Bluetooth: Add missing debug log to HCI driver send()
Change-Id: I0842675192cd1fbf3997a8f0d4906f114c0489c1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-19 14:39:55 +03:00
Johan Hedberg
483fc4705f Bluetooth: samples: Add sample Kconfig for nimble based controllers
Add config files to be used on Arduino 101 (or any Curie-based) board
with the MyNewt nimble stack running on the nRF51 and exposing HCI
over UART. These configs contain a stripped-down set of features so
that the resulting image fits e.g. on the Arduino 101.

Change-Id: I7300e9ca4205de6f52aa6ca1bfe4e0b011b6dcbe
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-19 13:19:02 +03:00
Mariusz Skamra
3bea520c6c Bluetooth: tester: Update tester application README
This adds the guidelines for the tester application building usage.

Change-Id: Ibcd31b7bed827f8eee99fdf21d3bb1e8edd24d2e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-04-19 06:58:55 +00:00
Anas Nashif
ef2fc59cab fixed inclusion of limits.h when building with newlib
The -nostdinc flag to GCC makes it not include its own directories when
searching headers, which means they need to be added manually. The same
Makefile line (~657) that adds the -nostdinc is also adding the correct path
for the gcc used to build, using the "-print-file-name=include" switch to get
the correct path for the respective gcc version.

The problem is that including limits.h from newlib will try to include gcc's
version too, which in every toolchain the SDK provides (and at least on my
machine, the same thing applies for the system gcc), limits.h is found under
gcc's "include-fixed" directory, not just include. So another -isystem should
be added with the value from "-print-file-name=include-fixed".

Jira: ZEP-142
Credits: Iván Briano
Change-Id: I33b7d9808d000a7346df4f88df92dc76e31fb2dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-19 01:14:39 +00:00
Anas Nashif
0c8564cacb checkpatch: warn on COMPLEX_MACRO and MULTISTATEMENT_MACRO_USE_DO_WHILE
generates lots of false postives, so make it warn only.

Change-Id: I0b2fedc564c29bff32f7c48702a9ad54a969650b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-19 01:14:39 +00:00
Anas Nashif
d2f1c76686 new SoC naming convention
Use SOC_FAMILY and SOC_SERIES to identify soc families and series
and to point to the correct linker files and files related to a
specific SoC.

Change-Id: I8b1a7339f37d6ea4161d03073d36557a40c0b4a6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:59 +00:00
Anas Nashif
a02c34ef0b soc: introduce SoC families and series
Add additional layers when defining SoCs to allow reuse among SoCs
of the same family and architecture.

The Board is the first location where we search for a linker.cmd file,
if not found we look for the linker file in
arch/<arch>/soc/<family>/<series>

Change-Id: I51d5e9a056220d0bd2ae0fa31474ffe63568e698
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:59 +00:00
Anas Nashif
b85ffc8104 stm32: reorganise soc directory and use family/series
Use SoC family/series and reoganise the structure to follow new
hierarchy.

Change-Id: I8637f1487a8287a6614ce6636cd018cf342fec95
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:59 +00:00
Anas Nashif
65c06afa58 kinetis: reorganise soc directory using soc family
Add Kinetis SoC family and rename fsl_frdm_k64f to mk64f12.
This will allow adding new SoCs of the same family and the reuse of code
among SoCs of the family and series.

Change-Id: Iea1a663aef7ce0487f147bdd36f668bebe80deb5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Anas Nashif
4b411b34a1 stm32: rename SOC_STM32F1X -> SOC_SERIES_STM32F1X
Use SOC_SERIES_* for naming SoCs with similar features and architectures
with the goal of code reuse. The Series in the config variable should avoid
name collisions and clearly denote the relationships within an SoC family.

Change-Id: I7a98542f96b5d5dc3acc23782c4d45f98cceb599
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Anas Nashif
9bf2da7ef4 stm32: rename CONFIG_SOC_STM32 -> CONFIG_SOC_FAMILY_STM32
Use CONFIG_SOC_FAMILY for the top level SoC family. A family
will have different SoCs or different SoC series with multiple
SoCs.
Adding the Family string to the config variable to avoid confusion
between actual SoCs and families and to prevent name collisions.

Change-Id: Ic99a2c1df7850dee3a45641027af82464dd6fadb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Daniel Leung
5250283c33 i2c/quark_se_ss: fix RX request pause conditions
The driver should not request any more bytes if it expects no empty
space in the FIFO. So fix the bail out condition to (<= 0) instead of
(< 0).

Change-Id: Ie16faf1da7df678fc8ab5af7ab33d7c0a2cdba7d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-18 20:27:09 +00:00
Javier B Perez
a508c3739c doc: collaboration: code: gerrit commit message JIRA key
Added line for JIRA key in the commit message and a note about
the JIRA key.

Change-Id: I8b447d42a592a1ba88a1cc476fbb563365a4316f
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-04-18 20:25:40 +00:00
Anas Nashif
6acc6c645a arduino_101: speed up loading of firmware
Using ARC for flashing is faster.

Change-Id: Ic13466781c5974bf29fb5309fcf6c99c7b260dcf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 20:25:20 +00:00
Anas Nashif
4b6cdea524 doc: remove collaboration guides
contribution guide is now a top level document and other guides
are being moved to the wiki.

Change-Id: I1e207e18659f3aa98111cfaa1597478ff29eedef
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 15:35:28 +00:00
Anas Nashif
246d3f27f3 doc: process tinycrypt headers with doxygen
Change-Id: I155819335ac3574a54cd35f161c7659b84634e59
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 15:35:28 +00:00
Johan Hedberg
01e29cf395 Bluetooth: samples/shell: Make more features optional
For memory-constrained platforms (like the Arduino 101) it's desirable
to be able to build a slimmed-down shell app that doesn't contain any
unnecessary features. This patch makes more of them optional.

Change-Id: Ia7f2cc0930dda6dfed5ce020b56913c6e0bc3d6f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-18 13:46:21 +00:00
Johan Hedberg
7c038ef99e Bluetooth: Provide static inline stubs for UUID string helpers
This way when BLUETOOTH_DEBUG has been disabled we don't need to make
extra #ifdefs in application code to make it build without debug
support.

Change-Id: Iceabe0d700d571afae8b85c2c559ba372a883682
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-18 13:45:33 +00:00
Jukka Rissanen
3e12469c38 net: rdc: Debug print missing \n in simplerdc plugin
Change-Id: I44e6f170e2928dc72cd17a71f382d63d7100aac9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 13:42:44 +00:00
Johan Hedberg
72ce7c7dc1 Bluetooth: Add support for waiting for "NOP" Command Complete
Some controllers will emit an initial "NOP" Command Complete event
during initialization and expect the host to only send commands once
this event has been received. This patch adds a new Kconfig option to
be used in the case of such controllers and defaults this to true on
Arduino 101 with the H:4 driver where this behavior is currently
observed.

Change-Id: I440f14a7c07ac27545febf9f85ebcc343e2a4558
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-18 12:58:22 +00:00
Andrei Emeltchenko
2329d54546 arduino: Remove Kconfig warnings rearranging GPIO selection
Remove warnings below:
...
warning: (BLUETOOTH_NRF51_PM) selects GPIO which has unmet direct
dependencies (BOARD_GALILEO || BOARD_QUARK_SE_DEVBOARD &&
NETWORKING_WITH_15_4_TI_CC2520 || SOC_FSL_FRDM_K64F)
...

Change-Id: I15db8cf5f9895e0693e3363974e4cdad533b55a4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-18 12:54:20 +00:00
Jukka Rissanen
54b234634b net: buf: Fix the code indentation in ip_buf_unref()
Change-Id: I75a28b6be648c5ba0a706cacae234e378ba2e4f8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:22 +00:00
Jukka Rissanen
44d6a4c101 net: buf: Add reference count check for IP buf
If the buf ref count is already 0 meaning that it is freed,
then do not continue but return.

Change-Id: I6c7e15d48b988fda34af43971c1638fb386100c4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:21 +00:00