Commit graph

49785 commits

Author SHA1 Message Date
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
Martí Bolívar
e6435fda94 scripts: runners: jlink: handle packaging ImportError
This too is violating the 'stdlib or handle ImportError' rule.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 11:30:45 +01:00
Martí Bolívar
a56e1fa52d scripts: runners: bossac: handle edtlib ImportError
Runners may not import anything outside of stdlib unless they handle
the possible ImportError.

Apply this rule to the bossac runner. The general pattern is to have a
MISSING_REQUIREMENTS global that we handle at the beginning of
do_run(), but in this case this isn't a missing pip package, but a
misconfiguration. Just log a warning; it won't happen in practice.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 11:30:45 +01:00
Martí Bolívar
b3c6470bb3 scripts: run_common: make edtlib importable to all runners
Runners can (and many should) depend on the devicetree to decide what
to do, especially as it relates to the flash layout. Make it so that
they do not have to manipulate sys.path to get a hold of the edtlib
directory by doing it in one place, before importing any of them.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-17 11:30:45 +01:00
Thomas Stranger
8ee96a5a9f boards: stm32g0: add jlink and stm32cubeprogrammer runners.
Add jlink and stm32cubeprogrammer runners to nucleo_g071rb and
stm32g0316_disco boards.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Thomas Stranger
8397cae10e drivers: clock_control: stm32: rm Kconfig for APB2 prescaler on g0 serie
stm32g0 series does not have apb2 prescaler, reflect that in kconfig.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Thomas Stranger
64a4328ca0 board: arm: add support for the nucleo_g0b1re board
Support for the nucleo_g0b1re.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Thomas Stranger
dde018ce64 drivers: clock_control: stm32g0: add support for g051, g0b1, g0b0 socs
Sets CLOCK_STM32_PLL_Q_DIVISOR for all g0x1 socs and g0b0.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Thomas Stranger
d9f5581499 drivers: gpio: add definition for stm32g0 porte
Advanced stm32g0 socs additionally have gpio port e.
This commit adds the missing definition for the port.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Thomas Stranger
c743beec64 soc/arm/st_stm32: Add additional stm32g0 socs
Add soc configuration for g05x and g0bx socs.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Thomas Stranger
aace0063ec dts/arm/st: add additional g0 device defintions
Restructures dts files(value line definitions are no longer included by
others), and adds additional devices(g05x and g0bx).
All newly added timer pwm prescalers are set to 0.
lpuart1 is moved from stm32g0.dtsi to stm32g031.dtsi, as it is not
available on stm32g0x0 soc.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Thomas Stranger
ff10ba3889 dts/arm/st: g0: remove superfluous interrupt-names from adc, and uart
"interrupt-names: combined" propterty is only used for stm32 i2c driver,
remove all other existing occurences for stm32g0(adc, lpuart, usart).

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00
Emil Gydesen
a3b6bc212f Bluetooth: services: Refacter OTS dir list to avoid circular dependency
Refactors the OTS directory listing object implementation to avoid
circular dependency.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-17 11:30:07 +01:00
Emil Gydesen
0cc408a9ac Bluetooth: Services: Ensure correct ID before getting object index
Moved the call to obj_id_to_index such that we can check for valid
ID before getting the index.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-17 11:30:07 +01:00
Emil Gydesen
806344c8e0 Bluetooth: Services: Adds bt_gatt_ots_obj_manager_obj_contains
Adds a ots_obj_manager function that returns true if the object is
in the object manager, or false otherwise.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-17 11:30:07 +01:00
Emil Gydesen
e90ec2df44 Bluetooth: services: Adds directory listing object to OTS
The directory listing object is an internal object which
content is the aggregation of all the metadata of all objects
(including the directory listing object itself). The client
can read this value to get a list of all objects with names,
lengths, and other metadata.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-17 11:30:07 +01:00
Guðni Már Gilbert
cd74a05011 dts: arm: st: l4: Add maximum-speed parameter to some STM32L4xx
Add optional maximum-speed parameter to USB nodes. This affects all
defined stm32l4xx, except stm32l4rx and stm32l4sx

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-17 11:29:53 +01:00
Guðni Már Gilbert
a7352378e7 dts: arm: st: l0: Add optional maximum-speed parameter for stm32l072
Add a maximum-speed parameter for stm32l072

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-17 11:29:53 +01:00
Guðni Már Gilbert
8d09a49428 dts: arm: st: l0: Add USB FS node for stm32l053
This is the same code used to define a node for stm32l072. The two MCUs
should be the same.

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-17 11:29:53 +01:00