Commit graph

41120 commits

Author SHA1 Message Date
Marti Bolivar
5edb6d5def doc: unify documentation on setting environment variables
There are a few different places where alternatives for setting
environment variables are described. None of them is 100% complete, so
the results are likely to be confusing.

Make a single page on setting environment variables, how the zephyrrc
files work, how the zephyr-env scripts work, and some of the important
environment variables, with appropriate references elsewhere. (This is
inspired by the Arch wiki's excellent page on installing programs.)

Link to it from the getting started and application development pages
instead of repeating the information. This has the benefit of
shortening the getting started guide a bit more.

Add some concrete advice on checking the toolchain environment
variables in particular. This is a stumbling block for beginners.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-06-14 14:19:09 -04:00
Marti Bolivar
b587909427 doc: periodic updates to getting started guide
Updates based on discussion and changes in supported features.

- Make the guide shorter by removing content that's not relevant to
  most users who are truly just getting started, such as information
  about pre-LTS versions that did not support west, and by being more
  concise in some places.

- Decrease the number of colored boxes. At the latest TSC F2F, the
  "note / warning / note / tip" contents were identified as a
  readability problem.

- Add additional information based on new west features, like "west
  boards".

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-06-14 14:19:09 -04:00
Anas Nashif
b58aa20e13 ci: skip handling coverage data
We not analysing coverage data at all in CI right now. Disable this
while we figure out a better solution for reporting data.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-14 09:26:40 -04:00
Anas Nashif
eaf994a7fc ci: move to new docker with new SDK
Use new docker image with SDK 0.10.1.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-14 09:26:40 -04:00
Kumar Gala
a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Kumar Gala
01e54a5472 scripts/dts: Change DT_<COMPAT>_<INSTANCE>_<PROP> define
Its possible that the <INSTANCE> number could conflict with the register
number.  This is shown to happen for a device like soc-nv-flash at
address 0.

So change naming convention to DT_INST_<INSTANCE>_<COMPAT>_<PROP> and
make DT_<COMPAT>_<INSTANCE>_<PROP> as deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Luiz Augusto von Dentz
a788ce23da Bluetooth: ATT: Fix unbalanced use of k_sem_give
k_sem_give shall only be used if no callback has been set otherwise
k_sem_take was not called which can break the flow control.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-14 15:55:07 +03:00
Luiz Augusto von Dentz
ec89ae6ff4 Bluetooth: ATT: Queue buffers on bt_att_send
This prevents threads to block which may deadlock when system wq is
used.

Fixes #16803

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-14 15:55:07 +03:00
Charles E. Youse
8013277cd6 arch/x86/Kconfig: remove CONFIG_CMOV
The only we support cores that don't have CMOV insns are the MINUTEIAs,
so we simply check for that rather this using a layer of indirection.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-14 05:49:13 -04:00
Charles E. Youse
c2c85a2a48 arch/x86/Kconfig: remove CONFIG_ISA_IA32
This option is set iff CONFIG_X86 is set, thus it provides no useful
information. Remove the option and replace references with CONFIG_X86.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-14 05:49:13 -04:00
Charles E. Youse
15223dd936 arch/x86/Kconfig: remove CONFIG_IA32_LEGACY_IO_PORTS
Hygiene. This option is never referenced by any code.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-14 05:49:13 -04:00
Kumar Gala
c450e75c8a dts/binding: Cleanup a few new bindings for base.yaml
A few new bindings needed update to remove common info that comes out of
base.yaml.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 05:47:36 -04:00
Kumar Gala
29a661833e dts/bindings: Update soc-nv-flash to use base.yaml
Now that we sort the instance id's we can update soc-nv-flash to use
base.yaml.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 05:47:36 -04:00
Nicolas Pitre
3d51f7c266 k_stack: make it 64-bit compatible
The k_stack data type cannot be u32_t on a 64-bit system as it is
often used to store pointers. Let's define a dedicated type for stack
data values, namely stack_data_t, which can be adjusted accordingly.
For now it is defined to uintptr_t which is the integer type large
enough to hold a pointer, meaning it is equivalent to u32_t on 32-bit
systems and u64_t on 64-bit systems.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-14 05:46:29 -04:00
Krzysztof Chruscinski
ea44b056bc samples: drivers: counter: alarm: Fix compilation for nrf boards
Sample was not compiling for nordic boards because RTC_0
instance was not enabled by default and RTC_0 device is using
different DT define.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-06-14 05:44:39 -04:00
Krzysztof Chruscinski
aabe964b98 logging: Fix log_strdup detection on non-standard messages
Detection of missing log_strdup call was applied to every message
while it applies only to standard messages (string + arguments).
Appling it to hexdump messages could lead to fault as seen on
nrf9160_pca10090ns board.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-06-14 05:43:46 -04:00
Danny Oerndrup
6331dae623 cmake: Toolchain abstraction: Introducing macro toolchain_cc_cstd_flag
The macro obtains the toolchain specific flag and value for
setting of the requested c standard.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-06-14 10:25:28 +02:00
Parthiban Nallathambi
d0d963a85d wifi: eswifi: init net_pkt cursor after net_pkt_write
Initialize the net_pkt cursor to begining after net_pkt_write.
Without which recv_cb can't peek/get net_pkt

Signed-off-by: Parthiban Nallathambi <parthitce@gmail.com>
2019-06-14 09:59:52 +03:00
Anas Nashif
d397799608 manifest: move net-tools to tools/net-tools
We now have a tools/ container, so move all tools to one place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:18 -04:00
Anas Nashif
acfe2e3f95 manifest: remove out-dated comment
We now have more than just the net-tools repo...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:18 -04:00
Anas Nashif
4fd627c8be manifest: add ci-tools to manifest
We need to be able to force certain versions based on the branch and
code base being used. For example for 1.14 we will need to apply some
fixes or revert some commits that may only apply to master.

Next step is also adding this to 1.14 branch and use a working commit.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:18 -04:00
Anas Nashif
bf1f1f637f manifest: order modules alphabetically
To avoid and minimize conflicts when items are always added to the
bottom of the list, order things alphabetically.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:18 -04:00
Anas Nashif
c95b97db2e samples: spi_fujitsu_fram: remove whitelisting
Remove restrictive whitelisting and adapt board configuration causing
issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Anas Nashif
ac2b8eee4a soc: nxp: ke1xf: add DTS SPI definitions
Add missing DTS define for SPI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Anas Nashif
51cc6a4ffa samples: grove_light: remove whitelisting
Remove unnecessary whitelisting and fix boards to enable ADC instance
when ADC is configured in.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Anas Nashif
efb47ace39 doc: samples: cleanup board reference and layout
Cleanup references to boards in some of the example and use the same
boards through the examples. Other minot cleanups and make the text more
generic and not specific to certain boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Nicolas Pitre
a6891e0313 prf.c: make it 64-bit compatible
On 64-bit systems the most notable difference is due to longs and
pointers being 64-bit wide. Therefore there must be a distinction
between ints and longs.

This patch:

- Make support functions take a long rather than an int as this can
  carry both longs and ints just fine.

- Use unsigned values in _to_x() to cover the full unsigned range
  and avoid sign-extending big values. Negative values are already
  converted to unsigned after printing the minus sign. This also makes
  division and modulus operations slightly faster.

- Remove excessive casts around va_arg() and use proper types with it.

- Implement the l and z length modifiers as they're significant on
  64-bit targets. While at it, throw in the z modifier as well.
  Since they all come down to 32-bit values on 32-bit targets, the
  added code should get optimized away as duplicate by the compiler
  in that case.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-13 12:55:17 -07:00
Kumar Gala
062bd0656a scripts/dts: Sort instance IDs by reg addr
Because of how generate defines for instances its possible that we have
a name conflict if the instance ID and reg addr space clash.

For example on qemu_x86 there are current two 'soc-nv-flash' nodes and
one is at reg addr 0, but instance id 1, the other is reg addr 0x1000
and instance id 0.  We'd possibly get this conflict:

For the 'soc-nv-flash' at 0x1000 (instance 0):
	(instance define)
	#define DT_SOC_NV_FLASH_0_BASE_ADDRESS          0x1000

For the 'soc-nv-flash' at 0x0 (instance 1):
	(address define)
	#define DT_SOC_NV_FLASH_0_BASE_ADDRESS          0x0

To deal with this we make sure that the lower reg address is instance 0,
than things work out ok.  To handle this case, if we sort the instance
IDs based on reg addr than if we have something at reg addr 0, it will
also than be an instand ID 0.

The longer term solution will be to deprecated the old defines and
remove the conflict between instance ID defines and normal DT defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-13 14:11:13 -05:00
Yaël Boutreux
6e2631c4f1 dts: bindings: Fix missing "zephyr" vendor name
Fix missing "zephyr" vendor name, currently used with
zephyr,sim-flash; zephyr,bt-hci-spi and zephyr,bt-hci-spi-slave.
This avoid checkpatch warning :
"DT compatible string vendor "zephyr" appears un-documented".

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
2019-06-13 14:10:56 -05:00
Jukka Rissanen
bf0f52dc4c net: nbr: Set the link address type when saving neighbor data
The neighbor cache did not contain link address type. This is not
causing problems atm but good to fix anyway.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-13 19:47:31 +03:00
Jukka Rissanen
d20c6f96e6 net: utils: Print pkt address in net_pkt_hexdump()
It is useful in debugging if net_pkt pointer value is printed
in net_pkt_hexdump().

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-13 19:46:54 +03:00
Vinayak Kariappa Chettimada
802718a773 Bluetooth: controller: BT_CTLR_USER_EXT depends on BT_LL_SW_SPLIT
Make the Kconfig option BT_CTLR_USER_EXT depend on
BT_LL_SW_SPLIT.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-06-13 15:11:31 +02:00
Vinayak Kariappa Chettimada
dd3e8241e9 Bluetooth: controller: split: Port random slave event backoff
Port the implementation that performed random backoff of
forced slave event scheduling.

When peer master implementation skips events, multiple
local overlapping slaves will randomize their forced
scheduling to break out of a round robin pattern increasing
the chance of synchronizing with their masters again.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-06-13 14:13:36 +02:00
Mark Ruvald Pedersen
4052bac93f cmake: Introduce toolchain_ld_link_elf to abstract linker invocation
Final step of linker abstraction:
 * Abstract zephyr_lnk by including it in toolchain_ld_link_elf.
 * Abstract relevant uses of target_link_libraries.
 * Introduce toolchain_ld_force_undefined_symbols.

No functional change expected.

This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2019-06-13 14:06:24 +02:00
Luiz Augusto von Dentz
e61c5b3630 Bluetooth: L2CAP: Fix inverting of SCID and DCID on disconnect
For the request:

DCID shall map to rx.cid:
  'This field specifies the endpoint of the channel to be disconnected
  on the device receiving this request.'

SCID shall map to tx.cid:
  'This field specifies the endpoint of the channel to be disconnected
  on the device sending this request.'

For the response when receiving the roles are inverted.

Fixes #16799

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-13 14:33:27 +03:00
Morten Priess
8a92818c0a bluetooth: controller: Revised ticker for improved conflict resolution
Changed ticker behavior to resolve conflicts in ticker_worker instead of
in ticker_job. This allows better real-time slot allocation, as well as
allowing callbacks even if ticker node doesn't get air-time (for audio
stream housekeeping). A priority property now also allows prioritizing
one ticker node over others.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-06-13 13:12:26 +02:00
Danny Oerndrup
e34ed7c8e2 cmake: Toolchain abstraction: Introducing macro toolchain_cc_nocommon
The macro is intended to abstract the -fno-common compiler option
which controls the placement of uninitialized global variables. The
macro leaves it up to the toolchain to define the option.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-06-13 13:08:11 +02:00
Joakim Andersson
f5d2d99762 Bluetooth: controller: Fix scan request when advertising directed
Fix scan requests being processed during directed advertisiments.
Directed advertise packets are not scannable

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-06-13 10:51:51 +02:00
Jukka Rissanen
343bdd3e3a net: if: Fix null pointer deref when selecting IPv4 address
It is possible that iface is NULL when selecting IPv4 destination
address for a sent packet.

Coverity-CID: 198877
Fixes #16570

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-12 14:50:38 -04:00
Luiz Augusto von Dentz
ada05eaaf4 Bluetooth: shell: Add number of matches to gatt show-db
This adds number of matches as optional parameter to gatt show-db:

> gatt show-db 2803 1
attr 0x005065f0 handle 0x0002 uuid 2803 perm 0x01

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-12 20:09:29 +03:00
Luiz Augusto von Dentz
e8d9609c36 Bluetooth: GATT: Fix bt_gatt_foreach_attr_type
Number of matches was not being properly handled causing the callback to
be called more than specified by the caller.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-12 20:09:29 +03:00
Ioannis Glaropoulos
d281e12569 doc: kernel: rework doc section of shared FP registers mode
This commit rewrites the documentation section describing
the Shared FP registers mode for Cortex-M to align with the
latest architecture rework of Shared FP mode.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-12 09:17:45 -07:00
Ioannis Glaropoulos
9f8044e6b5 tests: kernel: fp_sharing: call k_float_disable() for ARM
We can now invoke k_float_disable(.) for ARM platforms,
too, since we introduced the function as a cross-arch
system call.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-12 09:17:45 -07:00
Ioannis Glaropoulos
d840d1cbb5 arch: implement arch-specific float disable routines
This commit adds the architecture-specific implementation
of k_float_disable() for ARM and x86.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-12 09:17:45 -07:00
Ioannis Glaropoulos
a2029eb5eb arch: restrict FLOAT and FP_SHARING for x86 and Arm
Support for Floating Point (both un-sharing and sharing
registers mode) is currently implemented for ARM and X86
architectures, so reflect this in the Kconfig symbol
definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-12 09:17:45 -07:00
Ioannis Glaropoulos
a6cb8b06db kernel: introduce k_float_disable system call
We introduce k_float_disable() system call, to allow threads to
disable floating point context preservation. The system call is
to be used in FP Sharing Registers mode (CONFIG_FP_SHARING=y).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-12 09:17:45 -07:00
Ioannis Glaropoulos
d2c724f4c9 arch: arm: fix start of MPU guard in stack-fail check (no user mode)
When building without support for user mode (CONFIG_USERSPACE=n)
we need to correct the starting address of the MPU Guard, before
passing it to the function that evaluates whether a stack
corruption has occurred. The bug was introduced by commit
(60bae5de38) in
PR-13619, where the start address of the MPU guard was properly
corrected, but the guard start at the corresponding stack-fail
check was not adjusted accordingly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-12 09:16:16 -07:00
Nicolas Pitre
6311766d9a pointer-type args: cast appropriately to be 64-bit compatible
Using void pointers as universal arguments is widely used. However, when
compiling a 64-bit target, the compiler doesn't like when an int is
converted to a pointer and vice versa despite the presence of a cast.
This is due to a width mismatch between ints (32 bits) and pointers
(64 bits). The trick is to cast to a widening integer type such as
intptr_t and then cast to
void*.

When appropriate, the INT_TO_POINTER macro is used instead of this
double cast to make things clearer. The converse with POINTER_TO_INT
is also done which also serves as good code annotations.

While at it, remove unneeded casts to specific pointer types from void*
in the vicinity, and move to typed variable upon function entry to make
the code cleaner.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-12 08:20:52 -07:00
Nicolas Pitre
5f5c9a5962 INT_TO_POINTER macros: make 64-bit compatible
The INT_TO_POINTER and POINTER_TO_INT macros must accommodate larger
pointers on 64-bit systems that don't fit into an int.

In the INT_TO_POINTER case, we have to use an extra cast to intptr_t
as an intermediate widening type to avoid complaints from the compiler
when converting from an int.

This change makes no difference on 32-bit systems.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-12 08:20:52 -07:00
Tobias Svehagen
1c84d7c5eb Bluetooth: Change from bitfields to normal types
Since the bt_mesh_msg_ctx struct no longer has a size that is a
multiple of 2, the bitfields might as well be made to normal types
as this will minimize the code generated to access them.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2019-06-12 15:51:04 +03:00