Commit graph

49803 commits

Author SHA1 Message Date
Robert Lubos
d53fb5700d net: lwm2m: Introduce attribute handling helper functions
Introduce LwM2M engine helper functions that allows to work with LwM2M
attributes outside of lwm2m_engine.c.

This is a groundwork for application/lwm2m-format content writer.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-18 10:18:57 +01:00
Yonatan Schachter
6ca6b22ac7 boards: Add support for Silicon Labs' BRD4255A Radio board
This commit adds support for Silicon Labs BRD4255A (a.k.a. SLWRB4255A)
Flex Gecko Radio Board.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2021-03-17 19:33:35 -05:00
Yonatan Schachter
1d9f0e35a9 soc: silabs_exx32: Add support for EFR32FG13P SoC
This commit adds support for Silicon Labs EFR32FG13P (Flex Gecko) SoC.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2021-03-17 19:33:35 -05:00
Yonatan Schachter
09c85d09a3 west.yml: Update hal_silabs module
Update west.yml to point to hal_silabs version with support for Silicon
Labs EFR32FG13P SoCs.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2021-03-17 19:33:35 -05:00
Shihao Shen
084989564a tests: kernel: pipe: testcases to improve code coverage for pipes
Added back test_pipe_alloc because the z_thread_malloc called in the
API has been updated to use k_heap instead of k_mem_pool.
Adjusted test_resource_pool_auto_free by replacing z_mem_pool_malloc
with k_heap_alloc. Added new test_k_pipe_cleanup to cover one more
branch in k_pipe_cleanup. Modified test_half_pipe_put_get to cover
branches for (reader != NULL) in k_pipe_put. Added test
test_pipe_get_put to cover branches for (writer != NULL)
in k_pipe_get. Added trivial tests to cover input validity checks.
Line coverage has been improved by 52%, function cov by 56%, and
branch cov by 46%.

Signed-off-by: Shihao Shen <shihao.shen@intel.com>
2021-03-17 19:10:25 -04:00
Jun Lin
2638f2ecc4 npcx: move scfg driver from pinctrl to soc/arm/nuvoton_npcx/common
In NPCX chips, System Configuration module can configure not only
pinctrl but also misc. functionality such as glue and flash write
protection. This change moves the scfg driver from the pinctrl folder
to soc/arm/nuvoton_npcx/common and renames it to avoid confusion.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-03-17 18:47:32 -04:00
Wealian Liao
5835928423 drivers: watchdog: npcx: mask the WDRST_STS when accessing T0CSR
Register T0CSR bit 4 is WDRST_STS which is used to check whether the
chip has watchdog reset from the last power-up or vcc1_rst. WDRST_STS
hardware is design to write one clear. For the original
read-modify-write, it will reset the WDRST_STS unexpected. Add a mask
to avoid it.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-03-17 17:49:17 -04:00
Ioannis Glaropoulos
a31bd1539d tests: add missing CONFIG_TEST=y in test suites
In several test suites CONFIG_TEST was missing.
Define CONFIG_TEST=y, so testing-related Kconfig
options (depending on TEST) get switched-on.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-17 17:48:20 -04:00
David Brown
a1533cacdf doc: security: Fix broken link to moved doc
Now that the security process has been moved to its own page, fix a
broken link that was to the current page.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-17 17:47:26 -04:00
David Brown
9cf59acf73 doc: security: Move vulnerability reporting to new page
Create a new page containing just the information on reporting security
vulnerabilities, leaving a link behind in the old section.  This will
make it easier to reference this document, rather than it being in the
midst of a larger document.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-17 17:47:26 -04:00
Jukka Rissanen
f63855c657 net: if: Mark not used args as unused
If the function parameter is not used, mark it as unused to
avoid compiler warning.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-17 21:58:49 +02:00
Jukka Rissanen
24b49f4399 net: if: Add locking
Add locking when accessing network interface.

Fixes #33374

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-17 21:58:49 +02:00
Carles Cufi
59a51f0e09 debug: Clean up thread awareness data sections
There's no need to duplicate the linker section for each architecture.
Instead, move the section declaration to common-rom.ld.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-03-17 14:43:01 -05:00
Carles Cufi
d2465d6268 debug: Move away from openocd and make it generic
The exported structures that were originally introduced for OpenOCD have
since then been reused for other debugger plugins, including PyOCD and
Segger J-Link.

Rename the Kconfig option and the implementation from openocd to debug
thread info, so that it reflects the fact that this is no longer
specifically tied to OpenOCD.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-03-17 14:43:01 -05:00
Glauber Maroto Ferreira
ca758c84a8 esp32: nvs: add NVS support using fixed partitions
Add NVS support to ESP32 using fixed partitions defined on DT

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-03-17 14:38:23 -05:00
Rubin Gerritsen
2affd52339 bluetooth: host: EAGAIN when initiating a connection when scanning
Also improve the documentation.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2021-03-17 15:33:43 -04:00
Carles Cufi
66c298dbb7 bluetooth: controller: Set missing bits in supported list
A bunch of commands were missing from the bitmap in the Read Local
Supported Commands response. Add them accordingly.

Fixes #33324.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-03-17 15:33:19 -04:00
Wolfgang Puffitsch
010c5c2f20 Bluetooth: controller: Ignore connections from same peer
Ignore connection indications from peers that are already
connected. This is to bring the behavior of the controller in
accordance with [5.2, Vol 6, Part B, 4.5 Connection state]:
"If an advertiser receives a connection request from an initiator it
is already connected to, it shall ignore that request."

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-17 15:32:47 -04:00
Wolfgang Puffitsch
1161c1dca9 Bluetooth: controller: Rename peer's address in advertising set struct
Rename the peer's address in the advertising set struct from `id_addr`
to `peer_addr` to clarify what the address refers to.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-17 15:32:47 -04:00
Mulin Chao
8c76688b5f soc: power: npcx: solve an interrupt storm caused by host access.
This CL solves an interrupt storm caused by plenty of host access
messages when system is in S0. It only turns on the host access
interrupt before ec enters sleep and turns it off after leaving
sleep.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-03-17 15:32:14 -04:00
Watson Zeng
1b99f0e67f linker: arcmwdt: use preprocess opiton -E.
-P is an option that was inherited from the old MetaWare compiler.
[ccac foo.c -P] is actually a shortcut for: [ccac -E foo.c -o foo.i].
In new version of mwdt, -P option can't redirect the output. we need
to use -E option, which works in all versions.

-P:  Preprocess the file and write it to <src>.i (C) or
      <src>.ii(C++). No compilation is performed.

-E:  Run preprocessor only.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-03-17 15:29:43 -04:00
Maciej Perkowski
e37d12e631 Twister: Refactor Test(Harness).handle()
The function `handle()` from class `Test(Harness)` had most of its
code being the direct copy of the code from
`Harness.process_test(line)`. This patch replaces the copied code
with the call for `process_test(line)` and removes repetition of
this function call.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-03-17 15:18:06 -04:00
Kumar Gala
3a6598054a kernel: remove deprecated mem domain APIs
Remove k_mem_domain_destroy and k_mem_domain_remove_thread as they've
been deprecated for at least 2 releases now.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-17 13:49:36 -05:00
Marcin Niestroj
9f12dbba5d net: sockets: improve DGRAM recvfrom() on NET_OFFLOAD iface
When recvfrom() was called with src_addr != NULL, then source address
was fetched from beginning of net_pkt. This works with native IP stack
obviously. However with offloaded IP stack there is no IP header, so
trying to parse missing IP header results in undefined behavior.

Check if network interface has offloaded IP stack. If positive, then
figure out if there is assigned remote address to network context on
which packet was received. Return this remote address, which SHOULD be
the source address of received packet. Otherwise, return an error.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-03-17 20:00:42 +02:00
Martí Bolívar
6479073853 doc: west: west init --mr changes for v0.10.1
See release notes for details.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 12:50:33 -05:00
Martí Bolívar
696e0da1a5 doc: west: remove some unnecessary 'master' usages
Although a project's default revision is still "master", we can change
some examples around to refer to "main" branches instead, in keeping
with the changes we're making for Zephyr more generally.

We cannot change the default project revision away from "master" in
west v0.10.x, because that would be a schema change. That will have to
wait for v0.11.0.

However, in the meantime, we are making some inclusive language
changes related to 'west init', because the --mr option is not
governed by a schema. These will be documented in the next commit.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 12:50:33 -05:00
Martí Bolívar
2ea77dd019 ci: doc-build: bump west version
This should produce no changes in the docs since there are no API
changes in this point release, but let's just keep the build up to
date with the version being documented for cleanliness.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 12:50:33 -05:00
Joakim Andersson
5b9a881e8f Bluetooth: tests: Add privacy configuration to init test
Add privacy configuration to init test for both central and peripheral
roles with or without extended advertising.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-17 18:58:49 +02:00
Joakim Andersson
2013ce41e6 Bluetooth: host: Fix undefined references to adv in central only builds
Fix regression is central only builds when CONFIG_BT_PRIVACY and/or
CONFIG_BT_EXT_ADV is enabled, or the functions bt_id_reset or
bt_id_delete is called from application.

This resulted in build error for undefined functions
bt_le_ext_adv_foreach and bt_le_adv_lookup_legacy since the definition
for these functions are now only compiled in when CONFIG_BT_BROADCASTER
has been enabled.

Regression from:
53cea4719d

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-17 18:58:49 +02:00
Joakim Andersson
101b96a0b9 Bluetooth: HCI: Fix option CONFIG_BT_HCI_ACL_DATA_SIZE default to 0
Fix CONFIG_BT_HCI_ACL_DATA_SIZE default value set to 0 when data length
feature in the controller is not enabled. In this case the default value
will be set to 0 which is outside of the range specified for the option.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-17 17:09:19 +02:00
Wolfgang Puffitsch
3773d6d3d0 Bluetooth: controller: Remove unused assignments to ticker_id_prev
Remove assignments to ticker_id_prev that were overwritten before
being used.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-17 16:03:12 +01:00
Wolfgang Puffitsch
07130ec24c Bluetooth: controller: Move access to volatile out of assertion
Move access to volatile variable out of assertion to avoid warnings
about side effect in assertion.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-17 16:02:09 +01:00
Michał Grochala
fcad510105 doc: samples: bluetooth: Add a note about nRF5340.
Document that for any Bluetooth sample to work on the nRF5340 device,
the additional application for the nRF5340 network core is required:
hci_rpmsg.

Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no>
2021-03-17 16:39:13 +02:00
Wolfgang Puffitsch
ede34fb0e2 Bluetooth: host: Add missing include in id.c
Add hci_driver.h to include files in id.c to ensure that prototype for
bt_read_static_addr is visible. This fixes builds that define
CONFIG_BT_CTLR but not CONFIG_BT_HCI_VS_EXT.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-17 08:43:26 -05:00
Xavier Chapron
30c9588aaa drivers: modem: ublox-sara-r4: Fix dereference before null check
Fixes #32916

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2021-03-17 07:25:59 -05:00
Igor Knippenberg
066be0a45e samples: sensor: fdc2x1x: Add FDC2X1X sample application
This sample application periodically reads raw data from the FDC2X1X
sensor in polling mode or optionally with data ready trigger.
It is able to read the 12-Bit and 28-Bit, as well as the 2-Channel
and 4-Channel versions (FDC2112, FDC2114, FDC2212, FDC2214).
The 4-channel versions are chosen through devicetree properties.
The default is FDC2112.

Signed-off-by: Igor Knippenberg <igor.knippenberg@gmail.com>
2021-03-17 11:35:17 +01:00
Igor Knippenberg
79a3d1b85a drivers: sensors: fdc2x1x: Add driver for Texas Instruments FDC2X1X
Adds support for the Texas Instruments FDC2X1X Capacitance-to-Digital
Converter for Proximity and Level Sensing Applications.

Signed-off-by: Igor Knippenberg <igor.knippenberg@gmail.com>
2021-03-17 11:35:17 +01:00
Johann Fischer
6a2a26024a samples: hid: filter subsequent USB_DC_CONFIGURED events
Filter subsequent USB_DC_CONFIGURED events.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
352f63d98b samples: hid: adjust LOG level
Adjust LOG level to hide repeating debugging outputs.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
84e55414ad samples: hid: rework USB HID sample report descriptor
HID report descriptor in the sample has unnecessarily output report
which is not used anywhere. This patch removes unnecessary report.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
0bf67d2c6e samples: hid: rework USB HID sample report and on_idle callback
HID sample has on_idle callback implementation present in the code,
but has not turned on USB_DEVICE_SOF and so does not have
corresponding code in sample self and class/hid/core.c covered.
Also on_idle implementation in HID sample has not taken into
account send_report() which also calls hid_int_ep_write().
This patch enables USB_DEVICE_SOF and revises both on_idle and
the regular report function.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
4516ad0bde usb: hid: rework idle report implementation
HID core implementation has support for Get/Set Idle requests and
on idle report processing. Basically it has little use.
Also, it has no users in the tree except samples/subsys/usb/hid,
which does not have it turned on.
There are several issues with the idle report implementation:
- Core calls hid_ops.on_idle callback with Report ID 0,
  but this ID is reserved and should not be used.
  Report descriptors do not use Report ID index zero.
- Calling hid_ops.on_idle with Report ID 0 cann only
  be turned off by calling SetIdle(Duration = 0, Report ID = 0),
  but not by SetIdle with Report ID not equal zero.
- GetIdle with Report Id not equal zero returns wrong
  value after SetIdle(Duration = n, Report ID = 0)
- It may happen that hid_ops.on_idle is called for
  different Report ID during one and the same SoF event.
  But there can be only one hid_int_ep_write() during a frame.

This patch fixes listed issues and revises Get/Set Idle request,
and hid_sof_handler() implementation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
5533c7ed21 usb: hid: clarify USB_HID_REPORTS configuration
Clarify USB_HID_REPORTS configuration.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Piotr Pryga
8e0444cc17 tests: Bluetooth: df: Add missing intergration_platforms
Add intergration_plaforms entry in testcase.yaml.
Thanks to that nrf52_bsim platform will be used instead
of default platforms that do not include nrf52_bsim.
The test will be not dead as it is now (executed only
when tests code has been changed).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-03-17 11:34:26 +01:00
Jeremy Wood
384795fdcb tests: adc: Add support for NUCLEO_H753ZI.
Add CONFIG_BOARD_NUCLEO_H753ZI to ADC device test definition.

Signed-off-by: Jeremy Wood <jeremy@bcdevices.com>
2021-03-17 11:34:20 +01:00
Jeremy Wood
901cd5745e drivers: clock_control: Add support for STM32H753XX.
Added support for STM32H753XX by adding CONFIG_SOC_STM32H753XX to list
of H7 SoC with maximum 480MHz SYSCLK.

Signed-off-by: Jeremy Wood <jeremy@bcdevices.com>
2021-03-17 11:34:20 +01:00
Jeremy Wood
552e41ec0b boards: arm: Add nucleo_h753zi, based on nucleo_h743zi
* Added boards/arm/nucleo_h753zi, based on boards/arm/nucleo_h743zi.

Signed-off-by: Jeremy Wood <jeremy@bcdevices.com>
2021-03-17 11:34:20 +01:00
Julien D'Ascenzio
e1d22a0b61 drivers: i2c_ll_stm32_v2: Add timeout on transfer
When, due to EMC, a spike happens on the SCL line the driver stay in
BUSY state. It could be reproduced by forcing the SCL temporarily to
ground. It's probably a behavior relating to the operation of
multi-master.
By adding a timeout to the msg_read and msg_write function we can
detect that something went wrong, and when that happens we force the
end of communication.

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
2021-03-17 11:34:08 +01:00
Martí Bolívar
847ba43df9 scripts: run_common: improve error handling for missing runner
Catch the ValueError returned by get_runner_cls() and turn it in to a
log.die().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 11:30:45 +01:00
Martí Bolívar
d61545b513 scripts: runners: handle failure to import individual runners
We need all available runners to be defined as subclasses of
runners.core.ZephyrBinaryRunner in order to be able to look them up by
name at runtime. We do this by importing them from runners.__init__.

This process periodically fails when some runner or other cannot be
imported, usually because it is trying to import something outside of
stdlib and not handling ImportError.

Rather than letting this bring down the entire Python process, catch
and log the error. Sort the list again while we're here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 11:30:45 +01:00