Commit Graph

65595 Commits

Author SHA1 Message Date
Benjamin Björnsson fc7e67966a drivers: sensor: bmi270: Change parameters of helper functions
Change parameter list of functions for consistency with other drivers.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:46:01 -05:00
Benjamin Björnsson 4ba3e136f1 samples: sensor: bmc150magn: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:40:03 -05:00
Benjamin Björnsson 8c2a6e34a8 drivers: sensor: bmc150_magn: Update driver to use gpio_dt_spec
Simplify driver by using gpio_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:40:03 -05:00
Benjamin Björnsson c145539b54 drivers: sensor: bmc150_magn: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:40:03 -05:00
Benjamin Björnsson 44b96f9b68 drivers: sensor: dht: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:34:28 -05:00
Benjamin Björnsson f06ea0e12e drivers: sensor: dht: Update driver to use gpio_dt_spec
Simplify driver by using gpio_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:34:28 -05:00
Benjamin Björnsson a8586e8409 drivers: sensor: dps310: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:32:19 -05:00
Benjamin Björnsson 4edf96d40b drivers: sensor: dps310: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:32:19 -05:00
Benjamin Björnsson 481fe82fa9 drivers: sensor: dps310: Change parameters of helper functions
Change parameter list of functions for consistency with other drivers.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:32:19 -05:00
Benjamin Björnsson f69bf5412f samples: sensor: hmc5883l: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:24:43 -05:00
Benjamin Björnsson b22c6a8867 drivers: sensor: hmc5883l: Update driver to use gpio_dt_spec
Simplify driver by using gpio_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:24:43 -05:00
Benjamin Björnsson be1e512aad drivers: sensor: hmc5883l: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:24:43 -05:00
Nicolas Pitre 147728775f riscv: pmp: properly initialize per-thread m-mode/u-mode entry array
Retrieve the pmpaddr value matching the last global PMP slot and add it
to the per-thread m-mode and u-mode entry array. Even if that value is
not written out again on thread context switch, that value can still be
used by set_pmp_entry() to attempt a single-slot TOR mapping with it.

Nicely abstract this with the new z_riscv_pmp_thread_init() where the
PMP_M_MODE(thread) and PMP_U_MODE(thread) argument generators can be
used.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-06-23 15:56:00 -05:00
Lukasz Maciejonczyk cc9caf4b22 net: openthread: add option for setting Thread v1.3
Make Thread v1.3 configurable.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2022-06-23 15:52:34 -05:00
Lukasz Maciejonczyk bc9bc7702e manifest: openthread upmerge to commit: 5cfbcfc
Regular OpenThread upmerge.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2022-06-23 15:52:34 -05:00
Sylvio Alves 5a7585a387 west.yml: esp32c3: update hal to enable built-in jtag
ESP32C3 has built-in USB JTAG interface and this PR enables it
in HAL.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-06-23 15:51:31 -05:00
Benjamin Björnsson 4db3b0c0d4 boards: arduino_nano_33_ble: Pull user LED low during board init
Pull user LED low during board init since the Arduino bootloader
leaves it high.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 15:47:32 -05:00
Benjamin Björnsson d4731daaf6 drivers: sensor: lps25hb: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 15:46:00 -05:00
Andrei Emeltchenko 6bc6b5c405 shell: mqtt: Remove unneeded variable
Remove unneeded variable.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-23 15:43:59 -05:00
Andrei Emeltchenko ce76beecc3 net: lwm2m: Remove unused variable
Remove unused variable.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-23 15:43:59 -05:00
Andrei Emeltchenko edc98394b1 lib: os: Remove unneeded assignment
Remove assignment since it is duplicated at the end of do-while
loop.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-23 15:43:59 -05:00
Krzysztof Chruscinski 9833ca61c9 logging: Removing v2 suffix from logging names
Renaming objects which had 2 in the name to indicate that
it is v2 specific. Once logging v1 has been removed such
suffixes are redundant.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 15:46:37 -04:00
Lauren Murphy 318e6db239 debug: coredump: add xtensa intel adsp, support toolchains
Adds compatibility with Intel ADSP GDB from Zephyr SDK and
from Cadence toolchain to coredump_gdbserver.py.

Adds CAVS 15-25 (APL) register definitions. Implements
handle_register_single_read_packet to serve ADSP GDB
p packets.

Prevents BSA from changing between stack dump printout
and coredump by taking lock. Observed to be necessary for
accurate results on slower simulated platforms.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-06-23 15:44:45 -04:00
Lauren Murphy b034711f59 arch: xtensa: implement ARCH_EXCEPT
Triggers CPU exception with illegal instruction when z_except_reason
is called (e.g. in k_panic, k_oops). Creates exception stack frame
for use by coredump. Adds unique cause code for ARCH_EXCEPT. Disables
test case failure for qemu_xtensa.

Without an ARCH_EXCEPT implementation, z_except_reason calls
z_fatal_error directly with a null ESF and bypasses
xtensa_excint1_c's error logging. An ESF is required to coredump.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-06-23 15:44:45 -04:00
Nicolas Pitre b6377ccdd7 riscv: pmp: work around another QEMU bug
A QEMU bug may create bad transient PMP representations causing
false access faults to be reported. Work around it by setting
pmp registers to zero from the update start point to the end
before updating them with new values.

The QEMU fix is here with more details about this bug:
https://lists.gnu.org/archive/html/qemu-devel/2022-06/msg02800.html

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-06-23 13:12:05 -04:00
Nicolas Pitre 00a9634c05 riscv: new TLS-based arch_is_user_context() implementation
This reverts the bulk of commit c8bfc2afda ("riscv: make
arch_is_user_context() SMP compatible") and replaces it with a flag
stored in the thread local storage (TLS) area, therefore making TLS
mandatory for userspace support on RISC-V.

This has many advantages:

- The tp (x4) register is already dedicated by the standard for this
  purpose, making TLS support almost free.

- This is very efficient, requiring only a single instruction to clear
  and 2 instructions to set.

- This makes the SMP case much more efficient. No need for funky
  exception code any longer.

- SMP and non-SMP now use the same implementation making maintenance
  easier.

- The is_user_mode variable no longer requires a dedicated PMP mapping
  and therefore freeing one PMP slot for other purposes.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>

5f65dbcc9dab3d39473b05397e05.
2022-06-23 13:12:05 -04:00
Nicolas Pitre 3f8e326d1a riscv: stop preserving the tp register needlessly
The tp (x4) register is neither caller nor callee saved according to
the RISC-V standard calling convention. It only has to be set on thread
context switching and is otherwise read-only.

To protect the kernel against a possible rogue user thread, the tp is
also re-set on exception entry from u-mode.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-06-23 13:12:05 -04:00
Nicolas Pitre 95b18c7f9f riscv: abstract RV32E register access
... and avoid macro duplication.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-06-23 13:12:05 -04:00
Dmytro Firsov d48f99f01f xenvm: evtchn: fix undefined value during event handling
This commit fixes issue with undefined value during position calculations.
Shift for positions may be >32, so we need to explicitly use unsigned long
casting to prevent unexpected behavior during event handling.

Thanks @jgrall for suggestion.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
2022-06-23 13:09:40 -04:00
Dmytro Firsov 5f4fd311fc xenvm: evtchn: use proper barrier during events handling
This commit fixes barrier usage in Xen event channel driver. Previously
compiler_barrier() was used and it did not prevent processor from
re-ordering of the write operations, that is needed for correct event
handling. It is now changed to data memory barrier (dmb()), which will
work as expected in this situation.

Thanks @jgrall for suggestion.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
2022-06-23 13:09:40 -04:00
Maximilian Deubel 1c1c72ea08 ADXL362: Add separate activity/inactivity triggers
This patch modifies the ADXL362 driver to use the new
SENSOR_TRIG_MOTION trigger for activity detection
and SENSOR_TRIG_STATIONARY for inactivity detection.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2022-06-23 10:28:34 -05:00
Maximilian Deubel ba59262425 sensors: add trigger types for motion detection
This patch adds the new trigger types SENSOR_TRIG_MOTION
and SENSOR_TRIG_STATIONARY to distinguish these common
motion detection events.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2022-06-23 10:28:34 -05:00
Rubin Gerritsen 77b8252da6 usb: bt_h4: Set stack sizes using Kconfig
The previously used stack sizes where in many cases too small.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-06-23 14:40:01 +02:00
Rubin Gerritsen 8619e0300a boards: nrf52_bsim: Replace irq name table with function call
The interrupt names are now defined in the HW models.
As a result, all source files in the nrf52_bsim folder are now
free of nrf52832 specific references. Therefore these can in
theory be used for other models as well.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-06-23 14:35:26 +02:00
Rubin Gerritsen 0f84a57705 manifest: Update nrf_hw_models revision
Mostly includes minor maintainability updates:
- ci: Add building the HW models as a github workflow
- irq_sources: Remove unneeded irq_sources.h
- irq_ctrl: Define IRQ names inside HW models
- HW_models: NRF_RADIO: Set missing NRF_RADIO states
- HW_models: NRF_RADIO: Disable radio state while RXDISABLE
- HW_Models: NRF_PPI: Enable ppi task and event for TIMER0 CH3

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-06-23 14:35:26 +02:00
Emil Gydesen f6eb15d2d5 Bluetooth: Shell: Fix unused iso_rx_qos variable
The iso_rx_qos is only used for unicast audio, as
we do not set the RX QOS for the broadcast sink, nor
can a broadcast source set RX QOS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-23 15:30:23 +03:00
Krzysztof Chruscinski 265394e30e tests: logging: log_api: Add cast to char array
Tagged arguments feature fails to correctly tag a char array in
C++ configuration. Temporarily casting to char pointer to make
the test pass.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Krzysztof Chruscinski 041f0e5379 all: logging: Remove log_strdup function
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Krzysztof Chruscinski 59a0e5e645 manifest: Update lvgl
Update lvgl after removal of log_strdup function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Andrei Emeltchenko 87d5a6b1d7 net: gptp_mi: Remove unused variables
Remove unused variables and assignments.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-23 07:18:25 -04:00
Andrei Emeltchenko f82fb0cb55 net: gptp: Remove unneeded variables
Remove unused variable and assignments.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-23 07:18:25 -04:00
Andrzej Głąbek 2ddc0a6c17 manifest: Update hal_nordic revision
Pull in a fix in the nrfx_qspi driver for a problem with incorrect
status returned by `nrfx_qspi_mem_busy_check()`.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-23 11:49:10 +02:00
Robert Lubos fb802fb6c0 samples: net: zperf: Comply with Coccinelle requirements
Cocinelle complains about "shell" being used as a parameter name:

"Violation to rule 5.7 (Tag name should be unique) tag: shell"

Therefore rename the parameter throughout the sample to "sh".

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:10:34 +02:00
Robert Lubos fd2fab1a49 samples: net: zperf: Rewrite download part to use sockets
Rewrite the TCP/UDP download part of the zperf sample to use socket API.
For UDP, performance impact is negligible (< 1 Mbps), for TCP it's
noticable, but still throughputs can be considered satisfactory (up to
~75 Mbps).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:10:34 +02:00
Robert Lubos 6c30c9ac47 samples: net: zperf: Rewrite upload part to use sockets
Rewrite TCP/UDP upload part of the zperf sample to use socket API
instead of net_context. This has a negligible impact on the upload
throughputs (< 1 Mbps).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:10:34 +02:00
Robert Lubos ef6770f22b net: tcp: Avoid unnecessary packet cloning on the RX path
So far, TCP cloned a packet with data on an RX path for the application,
leaving the original packet intact. This isn't really needed, as the
original packet is unconditionally freed later anyway, so the TCP can as
well simply queue the original packet for the application, while
informing the network processing core, that the packet was consumed by
the TCP layer.

This allows to improve the download throughput even further, since the
CPU don't waste time on needles packet copying.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:10:34 +02:00
Robert Lubos 5a05ac8fc9 net: tcp: Increase default NET_TCP_TIME_WAIT_DELAY value
The current default of 250ms appears to be too low in case connection
teardown takes place in lossy networks - in case of FIN packet
retransmission, the connection on the Zephyr side could have already
been dismissed due to low TIME_WAIT state delay, resulting in ICMP
Destination Unreachable replies.

Increase the default value to 1500ms - this is still pretty low, but at
least gives the peer some time to retransmit the FIN packet.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:08:36 +02:00
Robert Lubos 2bd00e65ba net: tcp: Acknowledge FIN packets in TIMED_WAIT state
In case TCP stack enters TIMED_WAIT state (after receiving FIN/ACK reply
from peer), it should stil be ready to reply with ACK for any
consecutive FIN attempts. Othewise, in case the final ACK from Zephyr
side is lost, the connection is not properly closed on the other end,
and peer keeps retransmitting the final FIN packet.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:08:36 +02:00
Robert Lubos 28fb1a5f39 net: tcp: Prevent Silly Window Syndrome
Implement a mechanism, according to RFC 813, which allows to prevent so
called "Silly Window Syndrome" - a scenario where the TCP receiver keeps
reporting small window sizes in the acknowledgments, effectively
limiting the connection throughput. This allows to improve performance
in low-buffer configurations, where the maximum window size is small,
and the issue was hitting quite often.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:08:18 +02:00
Robert Lubos e03e4d5ad1 net: openthread: Fix build with NET_MGMT_EVENT_INFO disabled
In case NET_MGMT_EVENT module was enabled but w/o NET_MGMT_EVENT_INFO,
the OpenThread integration layer failed to build as the "info" field in
the net mgmt callback structure is not available then.

Fix this by conditionally enabling code processing the event only if
NET_MGMT_EVENT_INFO is enabled. Otherwise, print a warning, as the event
is not really useful if no address information is provided.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:07:46 +02:00