Commit graph

41120 commits

Author SHA1 Message Date
Johann Fischer
105849cf38 usb: dfu: check requested length (wLength) during DFU_UPLOAD
During DFU_UPLOAD, the host could requests more data
as stated in wTransferSize. Limit upload length to the
size of the request buffer (USB_REQUEST_BUFFER_SIZE).

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-03-02 17:37:24 +02:00
Johan Hedberg
5372e78827 release: Zephyr 2.2.0-rc3
Bumped to v2.2.0-rc3

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-02-29 21:10:38 +02:00
Vinayak Kariappa Chettimada
4bacb0e098 Bluetooth: controller: legacy: Fix cond. compile error
Fix conditional compilation error when enabling
BT_CTLR_FAST_ENC for central only application builds.

Also added additional compilation to code exclusive to
central or peripheral role.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-02-29 19:39:41 +02:00
Martí Bolívar
dc0948424e scripts: run_common: fix command line --hex-file and friends
This is yet another bug introduced by the move to runners.yaml.
Sigh. I should have tested this better.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-29 19:38:49 +02:00
Martí Bolívar
f8cb3d4d53 scripts: run_common: rename 'args' to 'user_args'
This will also make the reason for a following bug fix easier to see.

Update a comment block to include all the work that needs doing.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-29 19:38:49 +02:00
Martí Bolívar
97dbda2088 scripts: run_common: rename unknown_args to user_runner_args
This makes its true value clearer, and will make a later bug fix patch
easier to understand.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-29 19:38:49 +02:00
Vinayak Kariappa Chettimada
ca66f5b2e5 tests: Bluetooth: shell: Fix conditional compile error
When building the tests/bluetooth/shell application without
the BT_CENTRAL feature, compilation fails:

subsys/bluetooth/shell/bt.c:1642: undefined reference to
`bt_conn_create_auto_le'

Signed-off-by: Vinayak Kariappa Chettimada <vinayak.kariappa@gmail.com>
2020-02-29 10:47:18 +02:00
Ravi kumar Veeramally
2709b14bcb tests: net: Add wrong options length case
Wrong option length in IPv4 header options testcase
added. This should cover malformed packet case.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-02-28 22:34:11 +02:00
Ravi kumar Veeramally
22f93b35ab net: ipv4: Fix parsing of IPv4 header options
If IPv4 header options has wrong options length
(e.g. options length is more that actual data),
then parser decrements opts_len without checking
actual data length. Which crashes the network stack.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-02-28 22:34:11 +02:00
Tobias Svehagen
60563977df Bluetooth: Mesh: Fix handling of app index and local device key
Fix problem of not checking if the remote device key is actually our
own. This bug was intruduced in
46a95f12ad and causes failure of models
that use app_idx BT_MESH_KEY_DEV_REMOTE. Since this is used by cfg_cli,
it was not possible to do self-configuration.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-02-28 20:18:54 +02:00
Daniel Leung
2ac3a85273 soc: mec1501: wait for UART FIFO clear before deep sleep
It is observed that after each test, weird characters appear on
console. This problem goes away if deep sleep is disabled.
The theory is that the CPU runs to deep sleep (_sys_suspend())
faster than UART can shift all the bits out. If we spin wait
for UART FIFO to clear, this is no longer an issue. This is
circumstantial evidence to the theory. So for now, put in
a workaround to spin wait for UART FIFO to clear before
going into deep sleep.

Relates to #22885

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-28 20:18:13 +02:00
Jukka Rissanen
67e43a21c8 doc: release notes: Add information about GSM modem
The Modem chapter was missing mention about generic GSM modem
support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-28 16:37:41 +02:00
Martí Bolívar
647fe7a47a doc: dts/macros.rst: "clocks" macro fixes
The "fixed-clock" value referenced in the documentation is actually a
compatible value, not a property name. Fix that.

Harden the "expected to have a clock-frequency property" language to
use "must" instead of "expected". The scripts error out if a node with
fixed-clock compatible is missing a clock-frequency property; it's not
a soft expectation.

Be explicit about clock-frequency units.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-28 12:50:36 +02:00
Vinayak Kariappa Chettimada
f972fb057d Bluetooth: controller: Add Kconfig for Optimize for Speed
Add Kconfig option to support building the controller
optimized for speed.

Fixes #21601.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-02-28 10:55:33 +02:00
Vinayak Kariappa Chettimada
e1d9620187 Bluetooth: controller: legacy: Fix assert on DLE procedure stall
Fix local initiated Data Length Update procedure from being
stalled when a remote initiates a procedure with instant.

Fixes #23069.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-02-28 10:02:15 +02:00
Stephanos Ioannidis
fa19193898 boards: qemu_cortex_r5: Add board documentation
This commit adds the board documentation to the qemu_cortex_r5
platform.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-28 09:55:39 +02:00
Alexander Wachter
b96477dd69 SoC: SAM3x and SAM4: Add the Flash Controller to the DT
This commit adds Device-Tree instances of the Flash controller
to the SAM3X, SAM4E and SAM4S series. The Flash-Controller
is used to get the unique device identifier.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Alexander Wachter
a22f0ac1ab drivers: hwinfo: Don't disable CLOE on SAM3x seies
CLOE (Code Loop Optimization) does not exist on SAM3x.
Make the EEFC_FMR_CLOE disable depending on CONFIG_SOC_SERIES_SAM3X.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Alexander Wachter
4cfd4a707d SoC: stm32: Include LL utilities if HWINFO is selected
Include stm32XXxx_ll_utils.h in soc.h for every stm32 SoC,
if CONFIG_HWINFO_STM32 is selected.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Alexander Wachter
57bd09186b boards: Remove "supported: -hwinfo" from all boards
Remove all "supported: -hwinfo" definitions from the boards
yaml files and documentation. hwinfo can generally be tested
on every board because it returns -ENOTSUP if not supported.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Alexander Wachter
e49de0d866 drivers: hwinfo: Exclude NRF53 non-secure from hwinfo driver
Make the NRF hwinfo driver depending on !TRUSTED_EXECUTION_NONSECURE
because the FICR registers are not accessible from the non-secure
world.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Alexander Wachter
41b2f0a599 tests: hwinfo: Make the tests depending on HWINFO_HAS_DRIVER
The test checks for a correct implementation if HWINFO_HAS_DRIVER
is set, otherwise it checks for -ENOTSUP return value.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Alexander Wachter
39e4686d48 drivers: hwinfo: Introduce HWINFO_HAS_DRIVER Kconfig symbol
Introduce the HWINFO_HAS_DRIVER Kconfig symbol to get
the information if hwinfo is supported on the current platform.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Alexander Wachter
75724bf299 doc: hwinfo: Clarify return values.
Change the doxygen doc from "negative on error" to -ENOSUP and
negative value on driver specific errors.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Carles Cufi
02b630d494 Bluetooth: tester: Fix GATT service registration
The service registration logic was using the wrong variable to check for
a pending service to be registered, which led to the same service being
registered twice in some cases. Fix the logic so that a pending service
is only registered once.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-27 21:21:46 +02:00
Ioannis Glaropoulos
dca762f8ff tests: arch: arm_thread_swap: test FPSCR preservation in FP_SHARING
Under Sharing FP registers mode we would like to verify the
correct preservation of FPSCR during thread context switch.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-02-27 19:26:04 +02:00
Luuk Bosma
dfb80526b4 arch: arm: aarch32: clear CONTROL.FPCA for every CPU that has a FPU
Upon reset, the CONTROL.FPCA bit is, normally, cleared. However,
it might be left un-cleared by firmware running before Zephyr boot,
for example when Zephyr image is loaded by another image.
We must clear this bit to prevent errors in exception unstacking.
This caused stack offset when booting from a build-in EFM32GG bootloader

Fixes #22977

Signed-off-by: Luuk Bosma <l.bosma@interay.com>
2020-02-27 19:26:04 +02:00
Luuk Bosma
cc21aba55f arch: arm: aarch32: clear CPACR for every CPU that has a FPU
Upon reset, the Co-Processor Access Control Register is, normally,
0x00000000. However, it might be left un-cleared by firmware running
before Zephyr boot.
This restores the register back to reset value, even if CONFIG_FLOAT
is not set.
Clearing before setting supports switching between Full access
and Privileged access only.

Refactor enable_floating_point to support initialize
floating point registers for every CPU that has a FPU.

Signed-off-by: Luuk Bosma <l.bosma@interay.com>
2020-02-27 19:26:04 +02:00
Andries Kruithof
2c70df32b7 Bluetooth: controller: split: Fix regression errors
This commit fixes problems with LL tests CON/SLA/129, CON/SLA/130,
CON/SLA/132, CON/MAS/126, CON/MAS/127, CON/MAS/129, CON/MAS/55,
CON/SLA/57

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-02-27 19:14:32 +02:00
Joakim Andersson
5c1963b1c5 Bluetooth: tests: shell: Add missing dependency in mesh.conf
Add missing dependency in mesh.conf.
Handles this warning: Warning: BT_MESH_SHELL was assigned the value 'y'
but got the value 'n'. Check these unsatisfied dependencies:
BT_MESH_HEALTH_CLI (=n)

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-27 13:45:18 +02:00
Joakim Andersson
98827e9f6d Bluetooth: tests: shell: Remove config not supported on native_posix
Remove CONFIG_CONSOLE_HANDLER from project configuration. When building
for native_posix this produces the following warning:

warning: CONSOLE_HANDLER was assigned the value 'y' but gotthe value 'n'
Check these unsatisfied dependencies: SERIAL_SUPPORT_INTERRUPT (=n)

The shell works without this option since this is handled by the shell
itself instead.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-27 13:45:18 +02:00
Christian Taedcke
169f4865e4 editorconfig: Set max_line_length to 80
This way editors like emacs can highlight lines that are too long.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-02-27 12:57:23 +02:00
Erwan Gouriou
73f7028eb0 doc: Update shields section in V2.2 release note
Document noteworthy changes that will be released in V2.2.0

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-27 12:55:39 +02:00
Vinayak Kariappa Chettimada
7a3e29af06 Bluetooth: controller: legacy: Fix Tx pool corruption
Fix Tx pool from being corrupted when rough central device
uses invalid packet sequence numbers, causing NULL pointer
to be released into free data Tx pool.

Fixes #22968.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-02-27 12:54:35 +02:00
Daniel Leung
bf50aae693 xtensa: save/restore scompare1 during context switch
Xtensa uses two instructions to perform atomic compare-and-set
instruction: first the comparison register, then the actual
instruction to do compare-and-set. There is a potential that
context switching is performed before these two instructions.
A restored context may have the wrong value in the comparison
register. So we need to save and restore the comparison
register during context switching.

Fixes #21800

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-27 12:42:26 +02:00
Tobias Svehagen
7a737a0084 Bluetooth: Mesh: Fix bug with storing node in CDB
The free_slot->clear must be set to false since it could still be true
from previous use.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-02-27 12:40:19 +02:00
Alberto Escolar Piedras
2836513cd6 doc: release notes: Content for POSIX arch
Nothing significant has happened in the POSIX arch,
so just leave that section with an N/A

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-02-27 12:31:25 +02:00
Rubin Gerritsen
3a30eed083 bluetooth: Fix wrong warning text for unsupported Zephyr HCI commands
They were interchanged.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2020-02-27 12:31:01 +02:00
Dag Bjarvin
1a43a798e7 Bluetooth: controller: Merge 2 lines
Merge 2 lines that fit on one line

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-02-27 12:30:44 +02:00
Dominik Ermel
d09009d7c5 subsys/mgmt: Fix incorrect buffer space check
zephyr_smp_write_at is supposed to write len bytes of data at
the offset of a given net_buf, overwriting existing data and extending
beyond current buffer length, if needed. Unfortunately condition
checking if written data would fit within the buffer size has been
incorrectly implemented, making write impossible, when there has been
less bytes of space left within buffer tailroom than required to write
len bytes of data, even if len bytes written starting at given offset
would not cross the buffer boundary.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-02-27 12:28:22 +02:00
Jennifer Williams
d6373a38af samples: subsys: nvs: unchecked return values CID#203537
The sample contained calls that were not using the return
value, which was detected by Covery Scan as an issue. This
commit fixes it by changing to (void).

Fixes #18378
CID#203537

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-02-27 11:38:01 +02:00
Dominik Ermel
dd41b12250 tests/subsys/fs/fat: Incorrect mount path has been tested
While testing statvfs operation, same mount path has been tested twice,
instead of two different mount points as intended.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-02-27 11:37:25 +02:00
Gerard Marull-Paretas
6d003af827 lib/timeutil: add missing header required for s64_t
sys/timeutil.h could not be used without including first
<zephyr/types.h> because s64_t type definition was missing.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-02-27 11:35:43 +02:00
Andrzej Puzdrowski
208f15e521 doc/reference/runtime_conf/settings: reference missing API group
Added references to missing settings API groups so them
will be generated in documentation build.

Missing API are doxygen subgroup of already referenced doxygen group,
but subgroups aren't automatically extracted to the documentation
output.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-02-27 11:35:19 +02:00
Luiz Augusto von Dentz
9e8b78b8e1 Bluetooth: GATT: Fix not clearing CF_OUT_OF_SYNC
If the client is change-unware and disconnects the spec requires that
the stack still sends the error out of sync for the next request:

'The ATT_ERROR_RSP PDU is sent only once after the client becomes
change-unaware, unless the client _disconnects_ or the database changes
again before the client becomes change-aware in which case the
ATT_ERROR_RSP PDU shall be sent again'

Fixes #23110

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-02-27 11:26:30 +02:00
Trond Einar Snekvik
7b48611143 Bluetooth: Mesh: Group resends in proxy nodes
Resend transport segments for groups on the advertiser interface, even
if a connected proxy node holds the group.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-02-27 10:02:40 +02:00
Francois Ramu
ff072bc816 west.yml: update hal stm32g4xx and stm32l4R/stm32l4S modules
This updates the stm32cube drivers to fix the issue on sysclock

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-02-26 12:21:04 -06:00
Francois Ramu
f41ff24a3a driver: clock: stm32: boost voltage when clock exceeds 80MHz
This patch activates the boost mode for the main regulator
when the system frequency above 80MHz for stm32l4Rx/stm32l4Sx
soc series.
To save power, the boost mode should be disabled below 80MHz.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-02-26 12:21:04 -06:00
Francois Ramu
5c0687e58b driver: clock: stm32: boost voltage when clock exceeds 150MHz
This patch activates the boost mode for the main regulator
when the system frequency above 150MHz for stm32g4xx soc series.
To save power, the boost mode should be disabled below 150MHz.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-02-26 12:21:04 -06:00
Francois Ramu
0b4fbb916e driver: watchdog: stm32 install watchdog
This patches add a delay after setting the watchdog
to wait for the register (Prescaler and Counter registers)
to be updated before leaving (until LL_IWDG_IsReady is true)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-02-26 12:19:07 -06:00