Commit graph

41120 commits

Author SHA1 Message Date
Johan Hedberg
58ab2526e8 Bluetooth: Make UART draining logic consistent across drivers
There's no need to drain twice if NRF51_PM is enabled, the draining
shouldn't use rx_ready(), and it should happen after disabling
interrupts. Also rename uart.h to util.h to avoid conflicts with
include/uart.h and remove the left-over ISR prototype declaration.

Change-Id: Id38110dd38cf48edfe4a7b8e2e68cd358a9aa5ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-04 13:37:44 +00:00
Sebastien Griffoul
3a5eb1c742 net: timer_expired may not return the right value when called twice
timer_expired uses the nano_timer_test API to determine whether a
timer has expired. This API calls the private function
_nano_timer_expire_wait which returns the timer user data if this
timer has expired. Unfortunately _nano_timer_expire_wait clears the
user data pointer after returning it.
Therefore if timer_expired is called several times for the same timer
and if this timer has already expired then only the first call returns
the expected value (true). Other calls always return false.

In ipv6 this bug can be seen with the uip_ds6_periodic timer. Indeed
when expired this timer is going to be checked at least twice by
etimer_process function and the tcpip eventhandler function. Thus the
final uip_ds6_periodic callback is never called.

The fix consists in adding a expired field in the timer struct and
make timer_expired retain the nano_timer_test result when the timer
has expired.

Change-Id: I3c6aceaa0627be264b6d9913b629e7b619888938
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
2016-05-04 13:37:10 +00:00
Sebastien Griffoul
abb86939ca net: Fix ethernet headers in ipv6
In ipv6 the type field of the ethernet header is
left blank and the net buffer size is not updated
with the ethernet header size. Therefor outgoing
ipv6 packets cannot correctly be received.

In ipv6 these two fields are updated by the function
uip_arp_out. However this function doesn't exist in
ipv6, therefore net_driver_ethernet_send has to take
care of the ethernet header.

Change-Id: Ib883a6553786d74dd2a5bca6893a0501f04ce7f4
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
2016-05-04 13:36:56 +00:00
Andrei Emeltchenko
492448b0f9 drivers/nble: Refactor NBLE RPC function names
Update function names following firmware name changing.

Change-Id: I8b42c4d9f5c892abec10d8653544c3e03e4ee80d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 13:19:04 +00:00
Laurentiu Palcu
5841aeae14 sensor: bmg160: add sample application
The application tests polling mode and trigger mode (both data ready and
anymotion triggers).

Origin: Original
Change-Id: Ic0f9400758aaf56ef95f0f3c68c872d1bfd51176
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-05-04 13:14:00 +00:00
Laurentiu Palcu
6f11e868b0 sensor: add support for BMG160 gyroscope
Datasheet:
http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMG160-DS000-09.pdf

Origin: Original
Change-Id: I27469da8ff04c2eb26e92cc5d747b1bb8fee627b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-05-04 13:13:59 +00:00
Andrei Emeltchenko
ef3fd51ade drivers/nble: Refactor gap_internal headers
Change-Id: I9b3ea113df2759b6586c3767acbde644c4cd2fd4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 13:07:31 +00:00
Grzegorz Kolodziejczyk
b4ea3209fa Bluetooth: tester: Add possibility to set scan response data
Patch extends le advertising repot with configurable scan response
data.

Change-Id: Ibcbe71d6158ece3e7f63daf33d188a9b0d525384
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-05-04 13:07:02 +00:00
Johan Hedberg
caf50a52ea Bluetooth: Fix draining nRF51 FIFO during init
It's possible that there's a queued event from the nRF51 at the point
where we start resetting it, resulting in the stack receiving two NOP
events. To prevent this, make sure to drain the UART while the
controller is in a powered off state.

Change-Id: Ic009e11c11ac750fc76c881c0ffe9bd12d38da0a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-04 15:05:13 +03:00
Szymon Janc
6d5ed390b1 Bluetooth: Simplify advertising API
Instead of requiring application to provide both advertising type
and address type used just require app to provide info if advertising
is connectable or not. Advertising type is set based on provided
SCAN_RSP and local privacy support.

When local privacy is enabled it is no longer possible to advertise
using identity address. If such feature is to be required later on
advertising options can be extended.

This gives BT stack full control over what type of address is used
for advertising and is a preparation for random address rotation
and OOB support.

Change-Id: I90e9a683ef3794f155707343c874f75585439325
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 11:11:34 +00:00
Anas Nashif
74326ec58b build: use gcc instead of ld for linking
We now have to supply location of libraries (libgcc, libc) and header
directories to the build system. This can be solved in the
Makefile.toolchain.* file for known toolchains but becomes a problem
when supporting 3rd party SDKs and cross compilers.

Linking with ld requires ld to know where all the artificats of the
compiler are. Use gcc instead to make use of the internal information
available in gcc about additional libraries and headers.

Jira: ZEP-241
Change-Id: I15a3b812467b7ae878226f7e5532d538d2720268
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-04 10:27:18 +00:00
Iván Briano
d03a6a7e59 qemu_x86: Make the FPU available if it's not building for IAMCU
Change-Id: I250d28cb93829d85e37b0e3e8db7a6f45774586b
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-05-04 10:24:30 +00:00
Iván Briano
5e92acf9cf quark_x1000: The Quark X1000 does have an FPU
Change-Id: I2e23e7a950a055f31f01ccb871d476a9b9d8018b
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-05-04 10:24:30 +00:00
Andrei Emeltchenko
2b7f0c8ede drivers/nble: Implement notification for all conns
In a case connection is not known implement notification for all
connections the same way it is done for HCI stack. Attribute database
is scanned for CCC attribute and notifications are sent to all
connections.

Change-Id: Id556b4aa5af124aea672891ca89b278c71519643
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:29:20 +00:00
Andrei Emeltchenko
d7a31fa726 drivers/nble: Implement bt_gatt_foreach_attr()
Implement foreach iterator for NBLE.

Change-Id: Iebc158121f7a860ce8827468d21a859e62753ed8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:29:08 +00:00
Andrei Emeltchenko
bb96f90694 drivers/nble: Refactor CCC changed logic
Use similar to HCI stack cfg structure to keep value.

Change-Id: I54cf731971c5e2822385dc8eb295ce9951969af6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:28:56 +00:00
Andrei Emeltchenko
21f23c21ad drivers/nble: Save peer address with CCC write
Save peer address to use it with bt_gatt_notify()

Change-Id: Ie5e3af4cdc2d225c9572e010359f59323ae493a7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:16:10 +00:00
Andrew Boie
ced164e14f toolchain: common.h: define PERFOPT_ALIGN for Nios2
This is just a temporary value for now, need to research the best
value to use.

Change-Id: Icaadf75fa3ae98b087f3d51813f85003f398f378
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:47 +00:00
Andrew Boie
f6cf65d57c nios2: add prep_c to zero BSS and copy XIP data
Copied verbatim from arch/arc/core

Change-Id: I00c920064f75455010806951ad052289d0290654
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
d380e555c6 nios2: turn on function and data sections
Change-Id: I5bd841873207d1106a82b3e05187ee401b6c5478
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
f00671ab16 nios2: move cflags hacks to main Nios2 Makefile
These are for any Nios II at this stage of bring-up.

Change-Id: Ie4d0c80df164f81f6615ac35d3f42235b04870f1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
93230c012b altera_max10: enable RAM console
Change-Id: I6da3062c4944e6cc29c58b67c1cba91a99445165
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
9433895954 nios2: basic build, non-functional
Basic build framework for Nios2. Everything is stubbed out,
we just want to have a build going so that we can start to
parallelize implementation tasks.

This patch is not intended to be functional, but should be
able to produce a binary for all the nanokernel-based
sanity checks.

Change-Id: I12dd8ca4a2273f7662bee46175822c9bbd99202a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:45 +00:00
Gerardo Aceves
6a578ad14f doc: Edit arch.rst markup
Edited and added minor markup for consistancy.
Edited some '/' to clarify 'and' 'or'.

Change-Id: I5aa84f278d65e79d12b634fcbef2a8b5070c8ebd
Signed-off-by: Gerardo Aceves <gerardo.aceves@intel.com>
2016-05-03 13:09:16 -05:00
Geoff Thorpe
ded3070c1c nanokernel: tighten _is_thread_essential()
Of the 3 related functions;
  _thread_essential_set()
  _thread_essential_clear()
  _is_thread_essential()

The first two are parameter-less and always operate on
"_nanokernel.current". The last one takes a 'thread' parameter but will
operate on _nanokernel.current if the parameter is NULL. All calls to
_is_thread_essential() pass NULL!

This change makes the 3 functions consistent by removing the parameter
to the 3rd function. This should also be marginally more efficient,
though consistency was the motivation. This change corrects the doc
preamble to all 3 functions.

(These functions would probably be better as inlines. Also, the choice
of when to use wrappers seems a bit arbitrary. E.g. there's nothing
for setting/testing the "FIBER" flag.)

Change-Id: Ie3589f8a28b227c6d7a3a31b664d3b3e6e9c6d17
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
2016-05-03 17:42:54 +00:00
Geoff Thorpe
8b16cac073 microkernel: use _thread_essential_set()
This wrapper exists so that the ESSENTIAL bit doesn't have to be set
explicitly in _nanokernel.current. (And a note is added to nano_init to
avoid a nasty gotcha there.)

Change-Id: I4026ac0cfeace60e36abdbccf15554759f2dbf7a
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
2016-05-03 17:42:54 +00:00
Daniel Leung
8f0ab3038c arm/nxp_kinetis/k6x: simplify uart init
The UART console init should be done after UART init. So it can be
folded into general UART init, thus one fewer SYS_INIT().

Change-Id: Ifb18c5308dfef790325e6bff5bc7b5976fcd421e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-03 12:43:31 +00:00
Daniel Leung
ad6ed299b7 arm/nxp_kinetis/k6x: always inline clock init function
The clkInit() is always called so this can be inlined.
This saves 32 bytes of ROM space compared to non-inlined version.

Change-Id: I2cb6d02c0996acad16029be243f6059183938089
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-03 12:43:31 +00:00
Daniel Leung
b6f56d478a arm/atmel_sam3: always inline clock init function
The clock_init() is always called so this can be inlined.
This saves 32 bytes of ROM space compared to non-inlined version.

Change-Id: I1b95142da4c22f4b7fc7f7f6210503d90cf65cc9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-03 12:43:31 +00:00
Johan Hedberg
68d1feee59 Bluetooth: SMP: Avoid using hard-coded constant
Change-Id: I9d82fde39cc3221c071ce709a10df53f55af87d8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-03 14:28:00 +03:00
Johan Hedberg
31b37ba639 Bluetooth: Increase HCI_LE_rand delay for MyNewt
1 tick (10 ms on most current boards) doesn't seem to be enough to
completely eliminate the HCI_LE_Rand bug. Increase the delay to 20 ms
(i.e. 2 ticks).

Change-Id: Ibe87d5e4b2ec43b2f96afb2c4e0ac726ffe99bd6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-03 13:05:06 +03:00
Johan Hedberg
3a473134c5 Bluetooth: Move bt_conn functions to conn.c
There's no reason to keep these in hci_core.c. Also remove the
duplicate bt_conn_update_param_le() and make bt_conn_set_param_le()
static since it's only accessed from within conn.c.

Change-Id: I1234e9d2e5d1d367732a7b66965cf10a338c07fb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-03 13:05:06 +03:00
Vinayak Kariappa Chettimada
de999a81c5 Bluetooth: SMP: Fix unaligned access usage fault.
xor_128 function uses uint8_t instead of uint64_t XORs to avoid
unaligned access faults.

Change-Id: I0b0c73d64ce4158e3d8aeb4dd5416ead2bd7b664
Signed-off-by: Vinayak Kariappa Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-05-03 08:56:00 +00:00
Anas Nashif
0ce35823a4 Zephyr 1.3.0
Change-Id: I44ebde6cab75fbf64666c1a574ec57463a7167b0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-02 20:50:45 -04:00
Anas Nashif
3905ff4482 update sanitycheck footprint data for the release
Change-Id: I32d8fbf94191d2f1c48cd1d514ed679dfa288a11
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-02 20:50:45 -04:00
Anas Nashif
80fe4aeb05 doc: add section about 3rd party compilers
Change-Id: I469f0daa63dabfccc87bb46c312ebe319a58d863
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-03 00:29:58 +00:00
Juan Manuel Cruz
b20edcae7d doc: Updates the toolchain path format instruction
Jira: ZEP-177
Changes the documentation for the toolchain path. Some windows environments
need the ISSM installation path to be written in windows format.

Change-Id: Ib4729eb668e0daa7f7f520f208def4be6b86c692
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:41 +00:00
Juan Manuel Cruz
a0ed1ff1dc build: add arc support to issm toolchain
Jira: ZEP-186
Change-Id: Ib58aaba3020d8db18130f7d73a394a79c972272a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:41 +00:00
Juan Manuel Cruz
2170ca79ff build: support icx llvm compiler
Change-Id: I0bcc1f2e0ea93830e61fb3eaf8b523b7c4e1c301
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:40 +00:00
Luiz Augusto von Dentz
bd602f6e98 Bluetooth: GATT: Update documentation to include error domain
Refer to ATT as error domain expected by GATT API.

Change-Id: I70d45a618191ae859f3b2c33427dbb7262511393
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-02 15:28:18 +03:00
Luiz Augusto von Dentz
6a4d39d5cd Bluetooth: GATT: Fix error type
Callback errors should contain ATT error code not posix errors.

Change-Id: I698fac086ab8b2dca3487ab99ee974b4318d16f7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-02 14:31:02 +03:00
Anas Nashif
3da30441f5 gpio: fix typo in function documentation
Change-Id: I24cd9386f05e807c77faa61fea9a4ee4a0efec4f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-01 16:21:52 -04:00
Anas Nashif
5f7dd521fc arduino_101: add missing version_header.h file
Jira: ZEP-219
Change-Id: I8ce78733f8699fdfc9fd38dd44a5888be522f1eb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-01 10:26:27 -04:00
Anas Nashif
f2bc6e9277 arduino_101: add support for factory configuration
The factory defconfigs should be used to generate images
compatible with the factory settings and the bootloader that
comes with the Arduino 101.

When using those images, you will be able to keep the original
bootloader and flash the images using dfu-utils and there will
be no need for a JTAG adapter.

Jira: ZEP-219
Change-Id: I34b5e9ef73314f46b31086a772d94d3ddcc6c436
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-01 10:23:00 -04:00
Johan Hedberg
e2a1c43cb3 include/arch/arc: Fix minor space vs tab issue in indentation
Indentation should be with tabs only (these lines were with tab +
spaces).

Change-Id: I8f199b1d6972b02513e4c293636606f481641266
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-01 08:25:57 +03:00
Anas Nashif
909dd7ee05 arduino_101: support booting with original bootloader
To boot zephyr on the Arduino 101 running the original bootloader
which supports DFU, set the following in your application configuration
file:

CONFIG_SS_RESET_VECTOR=0x40034000
CONFIG_PHYS_LOAD_ADDR=0x40010000
CONFIG_VERSION_HEADER=y

Jira: ZEP-219
Change-Id: Ia015a7b6fce888b49ed22c558de992132d4713ea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:56:54 -04:00
Anas Nashif
2c4c6af2ec samples: cpp_synchronization: rename local configuration and use one config
Change-Id: If903f48c97d4ee6e603d9db32784639837fe0254
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00
Anas Nashif
8f73a27035 samples: i2c_lsm9ds0: we are using printk only
printk is enabled by default.

Change-Id: Id10cb0678c32db98e7cfb313fe9681783cc0267c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00
Anas Nashif
fab4f4def6 samples: pwm: rename local configuration and use printk
Change-Id: Idd72bb8c7147911e0bf19c157ac8294b936684a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00
Anas Nashif
7d64e54577 led_apa102c: rename local configuration and use printk
Change-Id: I14192240fdcc595f1a9aa12513c72b07886ae210
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:43:31 -04:00