Commit graph

44391 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
62f1ad79bb Bluetooth: controller: Fix connection event close check
Fix the check that decides to close a connection event,
which was missing a check on MD bit being set for empty PDU
to be Tx-ed out.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Vinayak Kariappa Chettimada
45593ff508 Bluetooth: controller: Optimise Tx PDU preparation
Optimize the Tx PDU preparation, empty PDU only needs MD bit
to be modified, other fields be initialised only at power up.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Vinayak Kariappa Chettimada
6b1cfdda33 Bluetooth: controller: Fix premature connection event close
Fix premature connection event close due to the new Tx
buffers not being de-multiplexed and routed to connection's
Lower Link Layer context when they arrive while being
inside the connection's radio event.

Also, fix master prepare to demux and enqueue two Tx buffers
so that MD bit can be set correctly.

Relates to #27981.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Vinayak Kariappa Chettimada
0096fca39d Bluetooth: controller: Refactor ull_conn_tx_ack function
Refactor ull_conn_tx_ack function as it no longer needs to
return the connection context back to caller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Vinayak Kariappa Chettimada
35c0b77304 Bluetooth: controller: Add interface to get ULL ref count
Add a static inline interface to get ULL context reference
count.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Vinayak Kariappa Chettimada
41017478b1 Bluetooth: controller: Move tx_ull_dequeue to static functions
Move tx_ull_dequeue function to be placed alongwith other
static function definitions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Vinayak Kariappa Chettimada
2dc174fb10 Bluetooth: controller: Minor relocation of lll_conn_flush function
Minor relocation of lll_conn_flush function to place alongwith
non-static functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Vinayak Kariappa Chettimada
accd35fe62 Bluetooth: controller: Remove commented code
Remove commented out code.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-28 15:23:21 +02:00
Jukka Rissanen
3b64d57943 net: ethernet: Make sure Ethernet header is in the recv pkt
Check that Ethernet header is in the first net_buf fragment.
This is very unlikely to happen as device driver is expected
to only deliver proper Ethernet frames to upper stack.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-28 14:25:13 +03:00
Jukka Rissanen
6fcd945f1f net: conn: Check that TCP pointer is valid
Saw this crash with heavily loaded system in nucleo_f767zi:

<err> os: ***** MPU FAULT *****
<err> os:   Data Access Violation
<err> os:   MMFAR Address: 0x0
<err> os: r0/a1:  0x800f6d30  r1/a2:  0x80005d84  r2/a3:  0x00000006
<err> os: r3/a4:  0x00000000 r12/ip:  0x00000001 r14/lr:  0x60013f69
<err> os:  xpsr:  0x61000000
<err> os: Faulting instruction address (r15/pc): 0x60014304
<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
<err> os: Current thread: 0x80001a18 (rx_workq)
<err> os: Halting system

Where the fault at 0x60014304 points to net_conn_input()

   } else if (IS_ENABLED(CONFIG_NET_TCP) && proto == IPPROTO_TCP) {
	src_port = proto_hdr->tcp->src_port;
60014300:	f8d9 3000 	ldr.w	r3, [r9]
60014304:	881a      	ldrh	r2, [r3, #0]

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-28 14:25:13 +03:00
Jukka Rissanen
be072b1255 net: ethernet: Check that header is valid
Saw this crash with heavily loaded system in mimxrt1050_evk:

<err> os: ***** MPU FAULT *****
<err> os:   Data Access Violation
<err> os:   MMFAR Address: 0xc
<err> os: r0/a1:  0x80000ab0  r1/a2:  0x800f6a60  r2/a3:  0x00000000
<err> os: r3/a4:  0x800f72a0 r12/ip:  0x00000000 r14/lr:  0x6000eb43
<err> os:  xpsr:  0x41000000
<err> os: Faulting instruction address (r15/pc): 0x6000dc82
<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
<err> os: Current thread: 0x80001a18 (rx_workq)
<err> os: Halting system

Where the fault at 0x6000dc82 points to ethernet_recv()

	uint16_t type = ntohs(hdr->type);
6000dc82:	89ab      	ldrh	r3, [r5, #12]

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-28 14:25:13 +03:00
Jukka Rissanen
baf83c2faf net: tcp2: Lock connection when running from work queue
We run various TCP function from work queue. Make sure the
connection lock is taken before accessing the connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-28 14:25:13 +03:00
Pascal Brogle
e3e465a29c net: lwm2m: make max client endpoint name configurable
support longer name like urn:dev:ops:{OUI}-{ProductClass}-{SerialNumber}
or urn:imei-msisdn:###############-###############

Signed-off-by: Pascal Brogle <pascal.brogle@husqvarnagroup.com>
2020-09-28 14:24:14 +03:00
Audun Korneliussen
1e227d1576 drivers: serial: nrf_uarte: Reset rx byte counters
Reset rx byte counters when hw timer/counter is disabled.

Fixes issue where disabling and re-enabling async uart rx can produce
"UART_RX_RDY" events with invalid data when power management is used.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2020-09-28 12:15:52 +02:00
Kumar Gala
51d6931b16 sanitycheck: Only create testcase_extra.conf if needed
Only create the dir and file if we have actual "content" that will
exist in testcase_extra.conf.  This is to reduce a bit of
noise/footprint in the sanitycheck output dir.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-28 12:10:34 +02:00
Alexandre Bourdiol
d800bdfa7d tests: arch: arm: arm_thread_swap: use memset() instead of memcpy()
According to comment memset() should be used instead of memcpy().
There is no need to access to address 0x0.
Fixes #28691

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-28 12:01:14 +02:00
Maureen Helm
76981d9706 release: Update patch level to 99 after the 2.4.0 release
Sets the patch level to 99 for the 2.5 development cycle.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
7a3b253ced release: Zephyr 2.4.0
Set version to 2.4.0.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
3dc0a7c965 doc: conf: Add 2.4.0 version selector
Adds the 2.4.0 release to the documentation version selector.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
b211df9d9b doc: reference: Update API overview for 2.4.0
Updates the API overview table for APIs added or modified since 2.3.0.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
b985624572 doc: reference: Add ec host command api hooks
Adds missing hooks to include the ec host command api in the generated
documentation.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
0962b30173 doc: release: Add 2.5.0 release notes draft
Adds skeleton release notes for the next release.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
e1f634b1f3 doc: release: Remove draft status from 2.4.0 release notes
The release notes are now complete.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
0eba6ef639 doc: release: Clean up 2.4.0 release notes
Cleans up grammar, punctuation, and white space in the 2.4.0 release
notes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Maureen Helm
0ae8d8f77d doc: release: Add more new boards to 2.4.0 release notes
Adds a few more new boards to the release notes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-27 15:15:49 -05:00
Johann Fischer
ba12d6e11f doc: release: 2.4 add notes about USB device support
Add notes about USB device support related changes.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-09-27 09:59:42 -05:00
Maureen Helm
0a0cb52fb2 doc: release: Fill in driver sections in 2.4.0 release notes
Fills in all remaining driver sections in the 2.4.0 release notes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-26 10:20:32 -05:00
Maureen Helm
53f14c5976 doc: release: Deprecate CONFIG_MULTITHREADING=n in 2.4.0 release notes
Adds a note about deprecating single-threaded mode to the 2.4.0 release
notes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-26 10:20:32 -05:00
Maureen Helm
2754c0fb16 doc: release: Add closed issues to 2.4.0 release notes
Adds list of GitHub issues that were closed since the 2.3.0 release.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-26 10:20:32 -05:00
Carles Cufi
ad940e6170 doc: relnotes: Add Bluetooth release notes for 2.4
Contains Host, Mesh and Controller release notes for the 2.4 release.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-26 10:19:06 -05:00
Gerson Fernando Budke
9cd01a8b76 doc: release: 2.4: Add note related to storage
Add flash SHA-256 integrity check note related to storage subsys.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-09-25 14:27:57 -05:00
Gerson Fernando Budke
3d6ab6b8f3 doc: release: 2.4: Move shell note to right place
There are two shell sections on documentation.  Move last section to
right place to fix documentation style.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-09-25 14:27:57 -05:00
Gerson Fernando Budke
57c099a612 doc: release: 2.4: Add notes and security info about UpdateHub
Add release and security notes related to UpdateHub.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-09-25 14:27:57 -05:00
Gerson Fernando Budke
4fe4c01c1f doc: release: 2.4: Add notes about Atmel related changes
Adds 2.4.0 release notes for Atmel SoCs, boards, and drivers.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-09-25 14:27:57 -05:00
Ioannis Glaropoulos
e81954e52a doc: release notes: add missing SoC, Board info in the 2.4.0 notes
Add some missing information regarding some nRF
SoC and Boards that were added in the current release.
Make a note that HW Stack protection is now enabled
by default in Nordic-maintained nRF Boards.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-09-25 13:26:47 -05:00
Ruud Derwig
9d739211ad doc: release notes: ARC
2.4 release notes for ARC related changes

Signed-off-by: Ruud Derwig <Ruud.Derwig@synopsys.com>
2020-09-25 08:30:14 -05:00
Maureen Helm
6a15118937 release: Zephyr 2.4.0-rc3
Set version to 2.4.0-rc3

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-24 18:01:51 -05:00
Marek Porwisz
4ad1e0cfd1 net: openthread: Fix stack overflow for joiner
Fixed stack being to small for joiner operations.
Enabled auto joining even in case of manual start.
Fixed attachement of SED on norfic radios.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-24 15:55:30 -05:00
Ioannis Glaropoulos
8ef34566ed tests: explicitly disable HW Stack Protection when needed
Some ARM platforms, now, enable HW Stack Protection by
default in the Board definition. So if some tests
need to run without stack protection, it is not
sufficient to disable TEST_HW_STACK_PROTECTION;
we need to explicitly disable HW_STACK_PROTECTION.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-09-24 15:42:09 -05:00
Kumar Gala
8a58a44f22 doc: release: 2.4: Add notes about devicetree related changes
Add comments about two main devicetree related features that went into
the 2.4 release.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-24 15:17:17 -05:00
Torsten Rasmussen
b88b1e664b west.yml: update openthread module
Fixes: #28465

Update openthread to dependency changes for fixing #28465.

see zephyrproject-rtos/openthread/pull/31

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-24 22:02:05 +02:00
Gerard Marull-Paretas
faf7736b14 lib: gui: lvgl: fix touch point rotation equations
When rotation is 90 or 270 degrees X and Y resolution values will also
be swapped, so we need to take that into account.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-24 13:50:25 -05:00
Trond Einar Snekvik
fc4fe09966 Bluetooth: Mesh: Provisioning: Reject identical random
Adds check for provisioning random values that are identical to our own,
and terminates the provisioning procedure.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-09-24 13:45:15 -05:00
Ilya Averyanov
e363decf1c Bluetooth: fix strncpy call in bt_set_name
In bt_set_name we already get name length so let's use it in strncpy
Also fix warning with enable -Wstringop-truncation

Signed-off-by: Ilya Averyanov <a1ien.n3t@gmail.com>
2020-09-24 13:41:57 -05:00
Emil Gydesen
8825ce0ce6 Bluetooth: Shell: Fix PA shell command parameter cnt
The sync create and sync delete dit not have the correct
amount of mandatory and optional parameters set in the
SHELL_CMD_ARG declarations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-24 21:29:47 +03:00
Emil Gydesen
68a357e66d Bluetooth: Shell: PA sync terminate callback clears entry
The sync terminate callback did not set any entries in the
PA sync array to NULL, thus not allowing the shell to
reuse them in case that the sync was lost unexpectectly.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-24 21:29:47 +03:00
Emil Gydesen
27f6bf19e8 Bluetooth: Host: Change PA sync scan to fast scan
Instead of doing slow (non-fast) scan when syncing to
a PA, it will now do a fast scan, which drastically reduces the
time it takes to create the sync. The application may
still do explicit slow scan if wanted.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-24 21:29:47 +03:00
Emil Gydesen
b78245db60 Bluetooth: Host: Fix PA sync cancel scan update
When the application cancels the PA sync, it would update
the scan before clearing the BT_PER_ADV_SYNC_SYNCING flag
which cause the scan to always start again.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-24 21:29:47 +03:00
Jukka Rissanen
a95ae6712f net: tcp2: Access k_work in k_delayed_work using field name
Instead of casting k_delayed_work directly to k_work, use the
k_work field name. This avoids warnings from Coverity and
allows the code to work even if the k_delayed_work fields are
re-ordered in the future.

Coverity-CID: 214346
Fixes #28659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-24 13:29:13 -05:00
Alexandre Bourdiol
74be161694 tests: kernel: timer: timer_api: reorder test_timer_remaining step
Move init_timer_data() out of k_usleep() tick alignment.
Compute rem_ticks just after busy_wait_ms() to avoid slew
due to 'now' and 'rem_ms' computations.
With slow CPU 32MHz: -2 Ticks.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-24 13:26:27 -05:00