Commit Graph

49062 Commits

Author SHA1 Message Date
Armando Visconti e97424e23d drivers/sensor: ism330dhcx: Move accel/gyro odr Kconfig attr into DT
Convert ism330dhcx accel and gyro odr attributes from Kconfigs to Device
Tree binding properties.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-02-28 16:47:15 -05:00
Armando Visconti 404ab86cb5 drivers/sensor: ism330dhcx: Move accel/gyro range Kconfig attr into DT
Converts ism330dhcx accel and gyro range attributes from Kconfigs to
Device Tree binding properties.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-02-28 16:47:15 -05:00
Armando Visconti a6795f5f9b dts/bindings: ism330dhcx: create a common DT binding file
Create a common properties file that will be included by all bindings
(as i2c and spi) handled by ism330dhcx driver.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-02-28 16:47:15 -05:00
Krzysztof Chruscinski 71cdcb7756 sys: util: Update implementation of loop macros
Recursive macros are more generic but they are very depending for
preprocessor. When they are used extensively they can prolong
compilation even ten times. Replaced them with brute force
implementation for:
- FOR_EACH macros
- GET_N_ARG
- GET_ARGS_LESS_N
- UTIL_LISTIFY
- UTIL_REPEAT

New implementation provides same functionality but it is limited to 64
input arguments. This is not a hard limitation and can be increased
in the future.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-02-28 16:46:44 -05:00
Matija Tudan f2b679d4b7 drivers: dac: dacx3608: fix I2C read error
This commit fixes I2C error while reading chip ID in the
init function.

Signed-off-by: Matija Tudan <mtudan@mobilisis.hr>
2021-02-28 16:46:04 -05:00
Kumar Gala 34861b592b i2s: stm32: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the dma controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-28 16:37:22 -05:00
Kumar Gala 19356a0a01 i2s: cavs: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the dma controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-28 16:37:22 -05:00
Kumar Gala 6c9c7ec759 i2s: atmel sam ssc: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the dma controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-28 16:37:22 -05:00
Jordan Yates aeac33a7a2 samples: lorawan: class_a: add datarate callback
Add an example callback implementation that prints out the new maximum
payload given the updated datarate.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-02-28 16:36:57 -05:00
Jordan Yates 54d13ba589 lorawan: add callback for datarate changes
Add a callback to notify applications when the datarate has changed.
This allows applications to know when payload sizes have changed without
needing to call `lorawan_get_payload_sizes` before each transmission.

This also enables:
 * Monitoring of network conditions on the device
 * Determining if a network connection has been lost

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-02-28 16:36:57 -05:00
Jordan Yates bdf13bcc1d lorawan: store current datarate for ADR
Keep track of the current network datarate when ADR is enabled.

The datarate can change in two circumstances. Firstly, the datarate may
change as a result of a command from the LoRaWAN server as the link
budget varies. Secondly, the datarate may be changed due to not
receiving an expected ADRACKReq response. This necessitates querying the
datarate on both packet reception and transmission to provide timely
notifications to the application.

Due to querying the default region datarate at startup and validating
manual datarate parameters, when ADR is not enabled the datarate will
never be different from the value provided to `lorawan_set_datarate`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-02-28 16:36:57 -05:00
Jordan Yates 8c1a45b90d lorawan: queriable minimum datarate
Add a function to query the minimum possible datarate on the network.
This value may change over the lifetime of the connection as a result
of commands from the network server.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-02-28 16:36:57 -05:00
Jordan Yates fa09d0d612 lorawan: queriable payload sizes
Add the ability for applications to query the maximum size of packets
that can be sent. This must be dynamically queried as the sizes change
with datarate, region, and as MAC commands are added by the stack.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-02-28 16:36:57 -05:00
Ilya Tagunov 62d4c6947c drivers: lora: sx127x: rework SX1276 driver to add SX1272 support
SX1272 chip is very similar to the already supported SX1276;
unfortunately, Semtech provides a completely separate driver
for this one. This commit marks an attempt to avoid code
duplication by means of some not-very-pretty ifdefery.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-02-28 16:36:35 -05:00
Ilya Tagunov 7e4509215d modules: loramac-node: add SX1272 support
Add Kconfig option enabling Semtech-provided SX1272 driver.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-02-28 16:36:35 -05:00
Ilya Tagunov 735d2fe7d1 dts: bindings: lora: sx127x: add SX1272 binding
Refactor out common parts and add SX1272 support to SX127x bindings.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-02-28 16:36:35 -05:00
Ilya Tagunov a97d3aebe7 dts: bindings: lora: sx126x: fix reset signal name
Reset signal on the SX126x is called NRESET, not NRST.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-02-28 16:36:35 -05:00
Ilya Tagunov 7ed09bbb61 manifest: update loramac-node module
Update the module to the latest commit.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-02-28 16:36:35 -05:00
Manivannan Sadhasivam dfe8aba504 MAINTAINERS: Add collaborator for lora
Add Marcin as the collaborator for lora.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2021-02-28 16:36:15 -05:00
Jack Rosenthal ea9866dc86 shell: add an option for minimal default configuration
The default shell configuration has heavy flash and memory requirements,
requiring project maintainers to set many configuration options to "n"
to keep flash and memory requirements within reason.

This adds a new configuration option, CONFIG_SHELL_MINIMAL, which will
disable flash and memory heavy options by default, and allow project
maintainers to select/imply only the options they want.

On a quick test from an ARM board I'm working on, enabling this option
cut flash space requirements by ~8 KB, and memory requirements by ~1 KB.

Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
2021-02-27 10:26:33 +01:00
James Harris c2a777c139 tests: kernel: sched: add z_yield under deadline
Add a test case for the error fixed by the previous commit.

Signed-off-by: James Harris <james.harris@intel.com>
2021-02-27 10:25:47 +01:00
James Harris 3330ab12d8 kernel: fix yielding between tasks with same deadline
Previously two tasks with the same deadline and priority would
always have `z_is_t1_higher_prio_than_t2` `true` in both directions.

This is logically inconsistent, and results in `k_yield` not actually
yielding between identical threads.

Signed-off-by: James Harris <james.harris@intel.com>
2021-02-27 10:25:47 +01:00
Kumar Gala ff5b040f78 boards: Add i2s to supported list for testing
Add i2s as a supported feature on at least one board for each driver
that we have in tree to get CI coverage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-26 14:21:59 -06:00
Kumar Gala 46fbc8ab50 i2s: cavs: Remove stale assert
There is no longer a mem_block pointer in the stream struct so the
assert NULL check isn't relevant anymore.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-26 14:21:59 -06:00
Kumar Gala a61744d952 boards: mec15xxevb_assy6853/mec15xxevb_assy6853: Fix compile warning
If CONFIG_I2C=n is set we get a build warning:

pinmux.c:35:13: error: 'i2c_pinmux' defined but not used

Fix this by adding ifdef protection around i2c_pinmux.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-26 11:39:54 -06:00
Kumar Gala 2dce6bff7f samples: shell_module: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.
This should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-26 07:28:46 -06:00
Vinayak Kariappa Chettimada 92f5b68f2c Bluetooth: Use bt_id_get function to get count
Allow NULL pointer to be passed to bt_id_get function so
that only count can be fetched.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-26 08:12:43 -05:00
Kumar Gala 986db52e90 dts: espressif: Move wifi node out of under SoC node.
The wifi controller isn't accessed via MMIO and thus shouldn't
exist under the SoC node which is for MMIO based devices so move
it up a level.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-26 08:11:31 -05:00
Johann Fischer 01a0a6a6e5 samples: shell_module: add shell support over CDC ACM
Add shell support over CDC ACM.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-26 08:10:36 -05:00
Andy Ross 63972d6df7 tests/timer_api: Fix absolute timeout logic
The test_timeout_abs case had baked in similar mistakes to the
off-by-one in the absolute timer implementation.  FOR THE RECORD:

If you have an absolute timeout expiration set for a tick value "N",
and the current time returned by k_uptime_ticks() is "T", then the
time returned (at the same moment) by any of the *_remaining_ticks()
APIs must ALWAYS AND FOREVER BE EXACTLY "N - T" (also: "N - T > 0"
always, until the moment the kernel ISR hands off control to the first
timeout handler expiring at that tick).

The tick math is exact.  No slop is needed on any systems, no matter
whether their clocks divide by milliseconds or not.

The only gotcha is that we need to be sure that the calls don't
interleave with a real time tick advance, which we do here with a
simple retry loop.

But, about slop... This patch also includes a related fix for the
test_sleep_abs().  On an intel_adsp (which has 50 kHz ticks, a
comparatively slow idle resume and interrupt entry, and even has two
CPUs to mess with latency measurements) I would occasionally see the
k_sleep() take more than a tick to wake up from the interrupt handler
until the return to application code.  Add some real time slop there
(just 100us) to handle systems like this.

Fixes #32572

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-25 22:16:51 -05:00
Kumar Gala 4aac908973 devicetree: add DT_NODE_FULL_NAME()
This macro returns a node's name with unit-adddress, given its node
identifier.

The node name is useful information for the user to utilize for debug
information, similar to DT_NODE_PATH, or DT_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 19:24:08 -06:00
Kumar Gala 270a05f697 dts: gen_defines: Change f-string to normal string
Change the use of a f-string to a normal string as there is nothing
that needs formatting in the particular instance.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 19:24:08 -06:00
Kumar Gala 54762e2161 devicetree: dmas: add helper marcos to obtain the node identifier
Added helper macros to obtain the dma-controller node identifier
from a dmas phandle.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 19:23:49 -06:00
Sylvio Alves 7fe8b710a8 wifi: esp32: add board wifi station sample
add esp32 wifi station  board example

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-02-25 17:00:20 -05:00
Shubham Kulkarni e16e606923 esp32: add esp32 wifi driver
add support for esp32 wifi

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-02-25 17:00:20 -05:00
Peter Bigot 54fb930feb tests: devicetree: device: avoid multiple declarations
The test defines driver instances for the devices in the tree, but
there's now a dummy driver for vnd,i2c that would also attempt to
define the same device on any platform that defaults CONFIG_I2C=y,
resulting in multiply-defined symbol errors.

native_posix does not default CONFIG_I2C=y, and because
CONFIG_I2C_TEST is hidden there's no way to turn it on or off at the
driver level, so disable the subsystem to mask the driver, leaving the
test code as the only place the devices are defined.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-25 14:52:16 -06:00
Jack Rosenthal bc58706538 shell: typo correction in Kconfig
"supporort" -> "support"

Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
2021-02-25 15:19:25 -05:00
Kumar Gala b0fd0474cf boards: em_starterkit: Fix duplicate labels
LEDs 5..8 re-used labels from LED1..4.  Fix the labels to be unique.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 13:39:51 -06:00
Kumar Gala ac9d71d689 dts: stm: f1: Fix duplicate label
The dma1 & dma2 controllers had the same label value.  The dma2
controller should really be "DMA_2".

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 13:39:32 -06:00
Thomas Stranger 49b490161d drivers: dmamux_stm32: compile time dmamux channels initialization
Move dmamux_stm32_channels struct from device data to device
configuration and initialize the dmamux channel - dma channel
assignment during build time,
as this association is hardwired in all known series.
The information is taken from dma_offset and dma_requests device tree
properties. The current implementation is valid for series with either
a single or two dma peripherals and a single dmamux peripheral.
Both dmas can independently enabled.
As the driver uses multi-instance DT_INST_DEFINE, also macros for a
second dmamux are are added that should allow easier extension to a
second dmamux instance.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-02-25 21:57:59 +03:00
Antony Pavlov f463bcaa9d include: arch: riscv: drop __soc_get_irq() declaration
There is no __soc_get_irq() definition in the Zephyr source
code tree.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2021-02-25 21:52:20 +03:00
Kumar Gala e317411444 dts: espressif: Move sram & rtc under SoC node
The sram & rtc should exist under the SoC node.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 12:26:48 -06:00
Jordan Yates dcaabb860f west: runners: jlink: prefer .hex over .bin
Update the jlink runner to prefer flashing .hex files instead of .bin.
This can increase programming speed in cases where there are large
amounts of padding in an application.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-02-25 10:59:13 -06:00
Kumar Gala b5a3fe1471 boards: mec15xxevb_assy6853: remove unused Kconfig settings
CONFIG_SPI_0 and CONFIG_SPI_0_OP_MODES aren't relevant for the
XEC QMSPI driver so remove setting them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 10:37:51 -05:00
Kumar Gala ca3bf282b6 samples: condition_variables: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 10:36:02 -05:00
Nicolas Pitre 861f6ce2c8 aarch64: a few trivial assembly optimizations
Removed some instructions when possible.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-25 10:35:37 -05:00
Martí Bolívar 1236c4aa8f Revert "tests: unit: util: Add test for REVERSE_ARGS"
This reverts commit 9d3326586c.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-02-25 10:01:31 -05:00
Martí Bolívar b65669af14 Revert "sys: util: Update implementation of loop macros"
This reverts commit de84575e2e.

Its merge broke the USB audio sample, which is failing CI in unrelated
PRs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-02-25 10:01:31 -05:00
Peter Bigot 84334badfb bluetooth: host: improve documentation on stack override
There's a prompt to set the TX stack size, that's documented as an
advanced setting, but attempts to override it it are rejected unless
you add another setting that allows it to be change.  Tell the user
how to make changes work.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-25 16:53:35 +02:00
Piotr Pryga deeecaaa8f Bluetooth: host: direction: Remove compilation warning
Remove compilation warning caused by currently not used
hci_df_set_conn_cte_tx_param function.
Code is sorrounded by #ifdef CONFIG_BT_CTLR_DF_CONN_CTE_RSP.
The CONFIG_BT_CTLR_DF_CONN_CTE_RSP is changed to be disabled
by default (until complete implementation of the feature is
provided).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-25 14:53:27 +01:00