Commit graph

47391 commits

Author SHA1 Message Date
Julien D'Ascenzio f1963dd599 drivers: can: stm32: fix bus-speed
Set the prescaler in register BTR according to the configured bitrate in DTS.
This bug appeared in commit 8b6c1bd4b7

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
2021-01-10 11:09:37 -05:00
Peter Andersson 71b3ce259f ipm: Fixed linker error in drivers/ipm/ipm_handlers.c
```
/home/humanentity/zephyr/drivers/ipm/ipm_handlers.c:23: undefined reference to 'z_impl_max_data_size_get'
```

The error shows when having CONFIG_BT=y and CONFIG_USERSPACE=y, and
is easily reproduced by adding
```C
CONFIG_USERSPACE=y
```
to `samples/bluetooth/peripheral/prj.conf` and building the sample.
E.g.
```
$ west build -p auto -b nrf5340pdk_nrf5340_cpuapp samples/bluetooth/peripheral
```

Signed-off-by: Peter Andersson <pelleplutt1976@gmail.com>
2021-01-10 11:08:38 -05:00
Peter Bigot 70ac3387ce drivers: gpio_ite_it8xxx2: fix use of uninitialized variable
Retain the assumption that the loop will assign a pointer, but
initialize it pointer first to eliminate build warnings.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-09 15:14:50 -06:00
Dominik Ermel 738bddf765 tests: fs: Add tests for fs_tell/fs_seek ENOTSUP error
The fs_seek and fs_tell are expected to return -ENOTUSP if file system
driver lacks implementation of said funcions.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-01-09 08:33:24 -05:00
Shlomi Vaknin 8d12bcebf8 dts: stm32l4+: add bindings for dmamux
Add device tree bindings for dmamux in stm32l4+ soc.

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
2021-01-08 11:58:01 -05:00
Armando Visconti 34a677d05a drivers/sensor: iis2dlpc: Move power Kconfig property into dts
Move iis2dlpc power-mode option from Kconfigs to Device Tree.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-01-08 09:16:35 -06:00
Armando Visconti e9b93f99a5 drivers/sensor: iis2dlpc: Remove odr values from Kconfig
Remove all odr values from Kconfig and always init it
at 12.5Hz. It is responsibility of application to set
the rate to a different value using SENSOR_ATTR_SAMPLING_FREQUENCY.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-01-08 09:16:35 -06:00
Armando Visconti e8bbcb9284 drivers/sensor: iis2dlpc: Move range Kconfig property into dts
Converts iis2dlpc range options (2g, 4g, 8g, 16g) from Kconfigs
to Device Tree.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-01-08 09:16:35 -06:00
Armando Visconti cb6f665717 dts/bindings: iis2dlpc: create a common st,iis2dlpc-common.yaml
Create a common binding file that will be included by all bindings
handled by iis2dlpc driver. For now this includes optional drdy-gpios
property and it is shared by the i2c and spi version of the driver.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-01-08 09:16:35 -06:00
Erik Robstad 1feb49fd22 drivers: Dev. spec. PWM functionality for SX1509B
Add device specific functions for initiating
and controlling PWM output pins.

Signed-off-by: Erik Robstad <erik.robstad@nordicsemi.no>
2021-01-08 15:52:42 +01:00
Vinayak Kariappa Chettimada 6bc79ce33a Bluetooth: Define assigned number values of BIGInfo and Broadcast Code
Add defines for assigned number values of BIGInfo and
Broadcast Code.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-08 16:38:19 +02:00
Maik Vermeulen f03d1177d0 net: lwm2m: Direct firmware_transfer() call instead of work-item
The LwM2M firmware pull object no longer uses the system workqueue
to execute firmware_transfer(), but directly executes it itself.
Previously, the workqueue would be blocked because firmware_transfer()
indirectly calls a blocking connect(). This would lead to problems
with e.g. modem drivers that use UART to interface with the modem
hardware, as some UART drivers use the workqueue.

Fixes #31053.

Signed-off-by: Maik Vermeulen <maik.vermeulen@innotractor.com>
2021-01-08 15:46:57 +02:00
Anas Nashif 7aaead1e81 soc: intel_cavs: use correct config for V15
Use SOC_INTEL_CAVS_V15 instead of SOC_INTEL_CAVS_APL.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-08 07:49:19 -05:00
Anas Nashif b2a5782570 ci: remove west extension call
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-08 07:49:19 -05:00
Anas Nashif c078eb9f3b samples: audio: sof: add filter
Build only for relevant platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-08 07:49:19 -05:00
Anas Nashif 92da29dbf1 sof: remove west extension
sof module now has rimage integrated until issue with submodules is
resolved.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-08 07:49:19 -05:00
Flavio Ceolin 6bf34a6258 arc: power: Remove dead code
Removing dead code to handle deep sleep. This option is never enabled
and it is broken.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-08 06:49:43 -05:00
Flavio Ceolin 47e0621bb7 power: Remove not used build option
There is no usage of BOOTLOADER_CONTEXT_RESTORE since quark support
was removed.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-08 06:49:43 -05:00
Flavio Ceolin 28cf88183a x86: power: Remove dead code
X86 currently has no support for deep sleep states, just removing this
dead code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-08 06:49:43 -05:00
Vasilyev, Pavel d593af30db Bluetooth: Mesh: Fix typo when deleting app key in CDB
This commit sets `net_idx` to `BT_MESH_KEY_UNUSED` when deleting app key in
cdb.

Signed-off-by: Vasilyev, Pavel <pavel.vasilyev@nordicsemi.no>
2021-01-08 13:16:46 +02:00
Jukka Rissanen d904f95562 net: tcp2: Mark tcphdr struct as packed
As the tcp header struct can be cast to unaligned memory, mark
it as packed and access fields using UNALIGNED_GET/PUT when
needed.

Fixes #31145

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-01-08 11:31:43 +02:00
Christian Taedcke d969aced6d dts: silabs: Fix wrong gpio interrupt numbers
The interrupt numbers for two socs for the gpio peripheral was wrong.
This commits corrects this issue for the relevant socs.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2021-01-07 16:54:23 -06:00
Christian Taedcke 0c17b3681c dts: silabs: Fix invalid nodes in gpio node
The watchdog and rng nodes were a sub-node of the gpio node.
This commits corrects this issue for the relevant socs.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2021-01-07 16:54:23 -06:00
Krzysztof Chruscinski 712ff3298b doc: kernel: other: ring_buffers: Add Kconfig option description
Added section with configuration options.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-01-07 16:54:59 -05:00
Thomas Stranger 13a5d05757 boards: nucleo_g071rb: enable adc support
Enable ADC on Nucleo G071RB board(ADC1 channel 0 and 1)

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-01-07 15:50:22 -06:00
Thomas Stranger 4ed375040e drivers: adc: stm32: add support for stm32g0 series
Adds support for ADC on G0 series.
Simple implementation: sequencer not fully configurable,
and only one common sampling time.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-01-07 15:50:22 -06:00
Erwan Gouriou 56c3c8b2e3 boards: stm32: Remove default PWM configuration
PWM, as other peripherals should not be enabled as part of
default board configuration.
Fix this.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-07 15:46:43 -06:00
Johan Hedberg 4ba387829b edtlib: Match any parent bus when binding lacks an explicit on-bus
There are some drivers in the tree that support devices on multiple
different buses, although so far this has not been represented in
device tree using the bus concept. In order to convert these drivers &
bindings to refer to a formal bus in device tree we need to be able to
match bindings which lack an explicit "on-bus: ..." value against any
parent bus. This will also be needed for any external bindings, since
those would not be aware of on-bus (as it's a Zephyhr-specific
extension).

The two drivers I'm particularly targeting is the ns16550 UART driver
(drivers/serial/uart_ns16550.c) and the DW I2C driver
(drivers/i2c/i2c_dw.c). They both support devices with a fixed MMIO
address as well as devices connected and discovered over PCIe. The
only issue is that instead of encoding the bus information the proper
DT way these bindings use a special "pcie" property in the DT node
entries to indicate whether the node is on the PCIe bus or not.

Being able to convert the above two drivers to use the DT bus concept
allow the removal of "hacks" like this:

 if DT_INST_PROP(0, pcie) || \
       DT_INST_PROP(1, pcie) || \
       DT_INST_PROP(2, pcie) || \
       DT_INST_PROP(3, pcie)

to the more intuitive:

 if DT_ANY_INST_ON_BUS_STATUS_OKAY(pcie)

This also has the benefit that the driver doesn't need to make any
arbitrary assumptions of how many matching devices there may be but
works for any number of matches. This is already a problem now since
e.g. the ns16550 driver assumes a maximum of 4 nodes, whereas
dts/x86/elkhart_lake.dtsi defines up to 9 different ns16550 nodes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2021-01-07 20:07:12 +02:00
Flavio Ceolin 2b49266861 power: Add notifier API
Get rid of weak functions adding a new API to register an object to
receive notifications when the system changes power state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-07 12:40:19 -05:00
Vinayak Kariappa Chettimada 8a5154d71c Bluetooth: controller: Add missing initialization of ISO sync
Add missing initialization of ISO sync context to be
established.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 18:02:34 +01:00
Vinayak Kariappa Chettimada c709d4f85f Bluetooth: controller: Rename periodic adv rx enable flag
Rename the Periodic Advertising Rx Enable flag from
is_enabled to is_rx_enabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 18:01:44 +01:00
Vinayak Kariappa Chettimada 44492c8324 Bluetooth: controller: Rename supported ISO Sets Kconfig
Rename Kconfig BT_CTLR_SCAN_SYNC_ISO_MAX to
BT_CTLR_SCAN_SYNC_ISO_SET, to be consistent with other
Kconfig naming.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 18:01:10 +01:00
Vinayak Kariappa Chettimada 32a79dd7e3 Bluetooth: controller: Fix AUX_CONNECT_RSP PDU buffer size
AUX_CONNECT_RSP PDU static buffer definition was missing one
byte required for the Extended Header Flags.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 18:00:35 +01:00
Vinayak Kariappa Chettimada 5d3d9b7522 Bluetooth: controller: Internal documentation of node rx count
Document with comments, the explanation of node rx count and
the design of the free rx PDU management.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:59:59 +01:00
Vinayak Kariappa Chettimada bc71d39d81 Bluetooth: controller: Fix free Rx PDU queue starvation
Fix for scenarios where in active PHY Update Procedure or
Connection Update Procedure could cause temporary depletion
of the free Rx PDUs in the queue between LL/HCI thread
context to LLL context. Symptoms being on-air NACKing during
the above said procedures, causing supervision timeouts due
to procedures not completing at instants.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:59:59 +01:00
Vinayak Kariappa Chettimada 2a99857cad Bluetooth: controller: Refactor PA/LNA PPI configuration
Refactor the implementation of PA/LNA PPI configuration
which was done on every Tx or Rx as common code to be
executed once per radio reset. And only setup the timeout
and enabling of PPI at every Tx or Rx.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:59:20 +01:00
Vinayak Kariappa Chettimada 5470444e6a Bluetooth: controller: PA/LNA use NRF_P0/P1 define
For PA/LNA implementation use NRF_P0/P1 defines instead of
the deprecated NRF_GPIO to reference GPIO Port 0 registers.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:58:24 +01:00
Vinayak Kariappa Chettimada e51295a309 Bluetooth: controller: Fix missing GPIOTE channel disable
Fix the missing GPIOTE channel disable when GPIOTE channel
is alternately used between PA and LNA use.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:58:01 +01:00
Vinayak Kariappa Chettimada f265b178c3 Bluetooth: controller: Fix regression in PA/LNA support
Fix regression in PA/LNA support wherein the GPIO pins where
left in undefined state after each radio event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:57:29 +01:00
Vinayak Kariappa Chettimada e14be4477a Bluetooth: controller: Fix missing call to radio_setup interface
Fix regression, add back missing call to radio_setup HAL
interface. This is needed to setup the initial PA/LNA GPIO
states.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:56:57 +01:00
Vinayak Kariappa Chettimada 108d431902 Bluetooth: controller: nRF52811: Errata Id 164 not applicable
nRF52840 Engineering A Errata Id 164 is not applicable to
nRF52811 SoC.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-07 17:56:03 +01:00
Martí Bolívar 7097e1785d doc: improve west's repo-tool.rst
Various improvements to the west repo-tool.rst page and pages that
link to it:

Rename the page title to "Basics", since it documents, well the
basics, including built-in commands like "help" an "config" that are
not directly related to multiple repositories.

The "multi-repo" term was invented before we started using
"workspace". Drop it from the text and rework things using words like
"workspace", "basics", or "built-ins" instead, which read better.

We've been using west for a long enough time that justifying its
existence prominently at the start of this page is no longer
necessary; move that to the "dustbin of history" page (why.rst).

Try harder to clarify exactly what a "project" is, along with other
workspace related clarifications.

Improve the documentation for the west init and west update commands,
and create :ref: targets for linking directly to them for convenience
elsewhere in the docs.

Slim down the usages for other built-in commands, so we don't have to
keep those up to date as carefully each release. This is about to be
important for west 0.9, which is going to change the detailed
semantics for the "[PROJECT ...]" part of each command synopsis in a
way that will be inconvenient to duplicate for each of these.

Move the "Topologies supported" content lower down. Try to help the
reading flow by letting people get familiar with a workspace and what
you can do with it using the Zephyr GSG workspace that they probably
already have before overwhelming them with other possibilities and
choices.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-01-07 17:16:35 +01:00
Steve Winslow 476e9e80d1 samples: net: Fix vlan error message in samples
This fixes an incorrect error message log statement for IPv4 vs.
IPv6 in several net samples.

The error message is in a portion of the files dealing with IPv4
bring-up. If the address is invalid, it logs the invalid address;
however, the IPv4 statement incorrectly refers to ipv6_addr. This
PR corrects it to output ipv4_addr as expected.

Signed-off-by: Steve Winslow <steve@swinslow.net>
2021-01-07 09:52:21 -06:00
Jefferson Lee 35c5fbe554 boards: Add the Arduino Nano BLE 33
This commit adds the board definition files
needed to support the Arduino Nano BLE 33.
Tested: the following have been verified with
my logic analyzer.
* Serial peripherals (UART, I2C, SPI)
* USB
* RTC

Untested:
* PWM. In theory it should work but I don't
have a good enough logic analyzer to test this

* RTC's. The board doesn't have a backup battery.
The peripherals are enabled for modding another
battery in the device tree.

Signed-off-by: Jefferson Lee <jeffersonlee2000@gmail.com>
2021-01-07 09:46:22 -06:00
Bilal Wasim f4a26837c8 boards/arm: Adding Contextual Electronics Advanced BLE Cell board to Zephyr
This commit adds supports for the nRF52840 based BLE Cell board from
Contextual Electronics. This board contains support for BG95 Modem,
BQ52895 charger, SD card etc and can be used as a PI Hat.

In this commit, this board supports UART, I2C, SPI, Modem. Support
for charger, SD card and other things will be added later.

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
2021-01-07 15:14:23 +01:00
Peter Bigot 6297c667c5 lib: os: cbprintf: correct arg extraction of wide characters
The l length modifier can apply to the c format specifier; in that
case the expected value is of type wint_t.  Minimal libc doesn't
define wint_t, and it is complex to do so correctly (must add
<wchar.h>, and use a lot of conditional tricks).

wint_t can differ from wchar_t in rank when wchar_t undergoes default
integral promotion, which it does on xtensa (wchar_t is unsigned
short).  So we can use wchar_t as an approximation, except in va_arg
where we need to use a wider type: int covers this case.

Note that we still don't format wide characters, but we do want to
consume the correct amount of data for a default-promoted extended
character.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00
Peter Bigot 8eda19a898 lib: os: cbprintf: correctly handle signed vs unsigned char
Whether char is signed or unsigned is toolchain and target specific.
Rather than assume it's signed (which is true for x86, but not for
ARM), do the right thing based on whether the minimum representable
value is less than zero.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00
Peter Bigot b036afba5a lib: cbprintf: document length modifiers
It may not be clear that the length modifiers reference native C types
with specific ranks.  Document the core type for each modifier.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00
Peter Bigot d12a99588b lib: cbprintf: remove cbprintf_arglen
This function was designed to support the logging infrastructure's
need to copy values from va_list structures.  It did not meet that
need, since some values need to be changed based on additional data
that is only available when the complete format specification is
examined.  Remove the function as unnecessary.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00
Peter Bigot 0bc01822a2 lib: cbprintf: improve coverage
Providing a literal width or precision that exceeds the non-negative
range of int does not appear to be rejected by the standard, but it
does produce a build diagnostic so we can't test it.  Switch to an
equivalent form that doesn't affect line coverage.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-07 14:02:06 +01:00