Commit graph

42249 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
0b6664fc3d Bluetooth: controller: split: Add function to reset conn upd mutex
Add a function to reset the variable holding the connection
context of the currently active Connection Parameter Request
Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-09 10:43:58 +02:00
Vinayak Kariappa Chettimada
da95c08977 USB: Bluetooth: Fix rx_thread_stack size
Increase rx_thread_stack size to follow BT_HCI_TX_STACK_SIZE
value defined by the Bluetooth subsystem.

Below, thread 0x20000d28, the hci_rx_thread earlier had 512
bytes which could be insufficient under edge cases like an
interrupt being asserted at the deepest stack usage.

Logging output as part of update to stack size:
<inf> thread_analyzer: Thread analyze:
<inf> thread_analyzer:  workqueue           : unused 648 usage 376 /
	1024 (36 %)
<inf> thread_analyzer:  thread_analyzer     : unused 264 usage 248 /
	512 (48 %)
<inf> thread_analyzer:  0x20000e30          : unused 280 usage 232 /
	512 (45 %)
<inf> thread_analyzer:  0x20000d28          : unused 584 usage 440 /
	1024 (42 %)
<inf> thread_analyzer:  BT RX               : unused 320 usage 192 /
	512 (37 %)
<inf> thread_analyzer:  BT RX pri           : unused 284 usage 164 /
	448 (36 %)
<inf> thread_analyzer:  sysworkq            : unused 824 usage 200 /
	1024 (19 %)
<inf> thread_analyzer:  logging             : unused 200 usage 568 /
	768 (73 %)
<inf> thread_analyzer:  idle 00             : unused 272 usage 48 /
	320 (15 %)

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-09 10:43:35 +02:00
Ruslan Mstoi
7d8adddd2e scripts: process_gperf: typo fix
Fix double "e" in "repreesentation"

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-06-09 10:40:58 +02:00
Ruslan Mstoi
84822e3086 scripts: gen_syscalls: typo fix
Fix "defing" as "defining"

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-06-09 10:39:49 +02:00
Stephanos Ioannidis
9cf4cab53d soc: arm: Fix header inclusion from deprecated paths
This commit fixes Cortex-M header inclusions from the deprecated paths.

The Cortex-M headers were relocated from `include/arch/arm/cortex_m` to
`include/arch/arm/aarch32/cortex_m` by the refactoring done in the
commit d048faacf2.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-06-09 10:38:36 +02:00
Stephanos Ioannidis
6098f099ca arch: arm: Remove header shims
This commit removes the header shims introduced after AArch32/64
re-organisation in the commit d048faacf2.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-06-09 10:38:36 +02:00
Lukasz Maciejonczyk
ff8b864f48 net: openthread: Make OT thread priority class be configurable
It add an option to configure openthread thread priority class
by the application if there is a such need.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2020-06-09 11:00:17 +03:00
Andrew Boie
5d1ce47ef6 net: sockets: fix zsock_gethostname_ctx()
The SET_ERRNO() macro does nothing if a positive value is provided
to it, and the functions were not returning -1 or setting errno
as expected.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-09 10:58:02 +03:00
Andrew Boie
71d4aeb1c2 net: sockets: set errno EBADF on bad fd
APIs were returning -1 without setting errno if the file
descriptor looked up a null object or there was no function
installed in the vtable. Set to EBADF for this case.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-09 10:58:02 +03:00
Lukasz Maciejonczyk
3fa2fa9a50 net: openthread: Fix the order of adding net pkt in ot_receive_handler
Net pkt is added into the ot net list after queued net pkt into
the net_rx which bases on it. It affects in losting net pkt when for
instance ot thread is preemptive.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2020-06-09 10:57:00 +03:00
Lukasz Majewski
0e32a84bcc net: eth: Add check if passed iface pointer is NULL
The eth_stats_update_errors_rx() implicitly assumes that passed pointer
to struct net_if is not NULL.

This is not true for MCUX's eth_rx() (in eth_mcux.c), where we can
execute eth_stats_update_errors_rx() after net_recv_data() returning
-EINVAL because of passed NULL iface pointer.

This change fixes this problem with adding extra check on iface not
being NULL before it is dereferenced.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-06-09 10:54:29 +03:00
Jukka Rissanen
043400ce89 net: context: Remove obsolete goto in net_context_put()
Some cleanup earlier left unnecessary goto. Cleaning the code
and removing it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-09 10:21:47 +03:00
Christian Taedcke
768968a445 net: ipv6: Also look for nexthop in nbr list
This change fixes routing for routes when the nexthop is a link-local
address of a connected peer.

The issue was that nexthop was correctly set from the routes, but the
code did not detect that the nexthop address (link local of the pc on
ppp interface) was on the ppp interface, because
net_if_ipv6_addr_onlink() only evaluated the network prefix and not
any other information (like the nbr list).

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-06-09 10:19:42 +03:00
Lukasz Majewski
38d38ed90a net: shell: Allow to set interface for ping (add -I option)
This change adds new, optional switch to 'net ping' command - to
be more specific the '-I <iface index>', where the <iface index>
is the number of supported network interface.

One can discover this number from the Zephyr shell after running
'net iface'.

The default interface stays the same - just the switch is added to
override the used interface for 'net ping' invocation.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2020-06-09 10:10:23 +03:00
Xavier Naveira
0fd16f8b78 net: mqtt: Make client "cleansession" flag configurable.
Cleansession is hardcoded to 1 but some use case might require 0
to make the sessions persistent (ie get messages sent while the
client was offline)

Signed-off-by: Xavier Naveira <xnaveira@gmail.com>
2020-06-09 10:09:04 +03:00
Rubin Gerritsen
ae4deae6f9 nrf52_bsim: Move CMSIS functions to cmsis.c
Only a few CMSIS functions are added for now

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2020-06-09 08:19:50 +02:00
Rubin Gerritsen
3cf7f9c974 arch: posix: Print warning on sys_reboot
This will simplify debugging.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2020-06-09 08:19:50 +02:00
Rubin Gerritsen
d233f0c2dd nrf52_bsim: Add wrappers for some more CMSIS APIs
This commit adds some more wrappers for commonly used CMSIS functions.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2020-06-09 08:19:50 +02:00
ff50ca1974 fs: nvs: fail on >= 256 B block sizes
The current code truncates the size_t block size to a u8_t, which
causes a 256 or 512 byte block size to be truncated to zero and
passing the size check.

Check as a size_t then truncate once the check passes.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-08 23:03:21 -04:00
Alexey Brodkin
b98058ecd0 tests: Exclude qemu_arc{em|hs} in some
See https://app.shippable.com/github/zephyrproject-rtos/zephyr/runs/73233/4/tests

And so until "icount" is implemented in QEMU for ARC we exclude
"tickless_concept" & "timer_api" from sanitycheck tests.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-06-08 16:58:37 -04:00
Wayne Ren
0fa4423932 ARC: Add support for basic QEMU platform for ARC EM & HS
Now when we're finally ready to open QEMU port for ARC
we introduce the first ever platform it supports and in fact does
that quite well - Zephyr RTOS.

For now we only offer support of basic EM & HS code execution,
built-in timers, interrupt controller and set of very simple
peripherals: DW UART & optionally MMIO Virtio devices.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-06-08 16:58:37 -04:00
Spoorthy Priya Yerabolu
d434dfc22c sanitylib: Adding small change to enable create_overlay() testing
Returning the content from create_overlay() in TestInstance class

Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
2020-06-08 16:38:48 -04:00
Spoorthy Priya Yerabolu
9ac30b595c scripts: tests: sanitycheck: Add testcases for TestInstance Class
test_testinstance.py: Add testcases for check_build_or_run()
create_overlay() and calculate_sizes()
conftest.py: Module for common pytest fixtures
test_data/board_config: Adding test data for board configurations

Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
2020-06-08 16:38:48 -04:00
Vinayak Kariappa Chettimada
3cabacce9a Bluetooth: controller: Address nRF5340 Engineering A Errata 16
Address the nRF5340 Engineering A Errata 16, RADIO: POWER
register is not functional.

This affects the dependency of controller's HAL
implementation that expected correct reset values being
set in the Radio peripheral.

As the SUBSCRIBE_TXEN and SUBSCRIBE_RXEN where not in their
reset value, Radio transmission and reception start using
DPPI was broken.

Fixes #25942.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-08 22:04:25 +02:00
Peter Bigot
7d3b299b33 device: use helper macro in device define macros
Avoid duplication of the encoding of the public device identifier by
using the constructing macro in definitions.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-08 15:01:52 -04:00
Peter Bigot
bc34501892 drivers: use macro to define device structures
Replace individual device instance definitions with the macro that
expands to the equivalent change.

    F='struct device DEVICE_NAME_GET'
    git grep -l "$F" \
     | xargs sed -i -r \
       -e "s@$F"'\(([^)]*)\);@DEVICE_DECLARE(\1);@'

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-08 15:01:52 -04:00
Eduardo Montoya
75a69b940e net: openthread: cli: Align config of OT and Zephyr shell max cmd size
This PR enables the user to configure the maximum command length for
OpenThread's CLI using Zephyr's shell, which is currently fixed to
256 characteres. This limitation was not enough for certain allowed
OpenThread commands, like some variants of 'ot dataset mgmtsetcommand'.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2020-06-08 21:45:29 +03:00
Eduardo Montoya
fc1d0635df net: l2: openthread: Add config option to enable OpenThread ref. device
This option enables specific features used by Thread Certification
reference devices.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2020-06-08 21:41:40 +03:00
Marcin Niestroj
747f20720a net: wifi: shell: store shell in context before scan
Right now shell pointer is not assigned before doing a scan, so scan
results are printed using printk(). Save shell instance in context, so
results are printed using shell_fprintf(), thus better aligned in the
console output.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-08 21:37:33 +03:00
Jukka Rissanen
2c66525b7b net: stats: Priority field was used instead of traffic class
The network statistics is stored for each traffic class, but the
collecting function was given net_pkt priority. The priority
must be first converted to traffic class and then the statistics
stored to correct place in the stats array.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-08 21:35:18 +03:00
Jukka Rissanen
43287d2323 net: socket: Add sendmsg() support to AF_PACKET
The AF_PACKET was missing support for sendmsg() socket call.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-08 21:34:35 +03:00
Peter A. Bigot
2f269b2ecf Bluetooth: GATT: allow references to const uuids
User and implementation code may change the uuid pointer stored in
discover and gatt_read parameter structures, but it should never
mutate the pointed-to-value.  Add a const qualifer so UUIDs stored in
flash can be referenced.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-06-08 19:56:04 +03:00
Markus Becker
2115b575a4 net: ieee802154: Allow to disable auto-start of 802.15.4 interfaces
Some radio drivers need configuration before start-up. Up to now only
the RF2XX drivers allowed this, but other radio drivers need this as
well. In particular for setting EUI64 addresses.

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-06-08 19:55:19 +03:00
Alexey Markevich
b9f6e33afb samples: net: google_iot_mqtt: fix log typo
Wrong port number logged.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Alexey Markevich
d6d5ae170a samples: net: google_iot_mqtt: log actual error
Error logging was using the wrong variable.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Ilya Tagunov
2b076d8bc7 net: wifi: add extern "C" to wifi_mgmt.h
Add extern "C" to net/wifi_mgmt.h to support C++ usage.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-08 19:48:05 +03:00
Alberto Escolar Piedras
0ecfdf1070 tests: kernel benchmark: Avoid timeout in nrf52_bsim
This test was configuring the system tick period to 1 second.
The test also constantly aligns to system tick boundaries,
in between each test part, which means the test runs for very long
(it is holding for longer than 1 minute just on those waits between
tests alone).
The nrf sys tick driver configures the RTC to produce still
all RTC interrupts at 32KHz intervals, which cause lots of
interrupts which slow down simulation quite bit.
Overall the test could take longer than 30 seconds in the
nrf52_bsim in CI even that this platform simulated time is decoupled
from real time.

=> Add a new config overlay for the nrf52_bsim board so
we configure there a much higher system tick frequency
It does not affect the test in any way more than shortening
the wait periods between in test part.

Also increment the sys tick to twice per second to speed up
the test in other platforms.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-06-08 17:13:10 +02:00
Anas Nashif
09d3bf2090 up_squared: enable SMP on this board
Enable SMP by default. This is one of the few platform where we can test
SMP on real hardware.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-08 11:04:52 -04:00
Anas Nashif
33848debf0 up_squared: disable i2c in defconfig
This should be enabled by application.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-08 11:04:52 -04:00
Jukka Rissanen
d81be8fd9c drivers: modem: gsm: Do not reference possible null pointer
The ppp_dev was used even if its value could be NULL.

Fixes #25781
Coverity-CID: 210031

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-08 16:50:35 +03:00
Kumar Gala
a2d4292a96 doc: relnotes: Add note about C99 types.
Add top line note about C99 integer types being the default

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala
93da8dc478 Revert "checkpatch: update checkpatch to warn about C99 type usage"
Now that we are standardizing C99 integer types we can revert the commit
that warned about C99 type usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala
e353d123fd zephyr: Make Zephyr int types deprecated by default
As the int types defined in include/zephyr/types.h are typdef's we
utilize a Kconfig option (LEGACY_ZEPHYR_INT_TYPES) to enable/disable
the support for them.  By default to LEGACY_ZEPHYR_INT_TYPES not
being enabled and add an explicit test to ensure the types continue to
function until removed in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala
d00d0f1266 samples/tests: Convert use of %ll{u,d} to PRI{u,d}64
Move to using PRIu64/PRId64 instead of %llu/%lld since on
native_posix_64 the uint64_t/int64_t type is defined in terms of 'long
int' and not 'long long int'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala
a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala
ee6fa31af6 west.yml: Update modules for C99 types
Pull in various module updates for C99 type change

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala
7dc3ecd63d stdint.h: Make {u}int64_t types consistent regardless of arch
On 64-bit arch's like AARCH64, x86_64, or riscv-64 the way {u}int64_t
will differ from how its defined on 32-bit arch's.  Do the same trick we
do for {u}int32_t for {u}int64_t so that the type is the same regardless
of what we are building for.

This keeps things like %lld working the same regardless of 32-bit or
64-bit arch.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Carles Cufi
e77985a2f0 release: Update patch level to 99, post 2.3.0 release
Set the PATCHLEVEL to 99 for the 2.4 development cycle.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-06 00:44:36 +02:00
Carles Cufi
b8c78e254f release: Zephyr 2.3.0
Set version to 2.3.0 final.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-05 22:03:54 +02:00
Carles Cufi
964da1ca6c doc: conf: Add 2.3.0 version selector
Add the 2.3.0 release to the version selector for the documentation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-05 22:03:54 +02:00