Commit graph

73653 commits

Author SHA1 Message Date
Aaron Massey
c0762d003a fuel_gauge: Implement sbs gauge read for mfr acc
Implement and weakly test fetching the manufacturer access word from an SBS
compatible fuel gauge.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-01-08 19:48:12 +01:00
Aaron Massey
db60e08604 fuel_gauge: Add readable mfr access prop
Add the SBS manufactuer access as a fuel gauge readable property.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-01-08 19:48:12 +01:00
Emil Gydesen
57218eee31 Bluetooth: Host: Add BT_CONN_INTERVAL_TO_US
The macro BT_CONN_INTERVAL_TO_MS was used a fair amount
of places, but it often was used with integers. This meant
that sometimes the resulting (integer) value would be
incorrect, as something like 7.5ms interval would not
be properly stored as a integer in millisecond units.

Adding BT_CONN_INTERVAL_TO_US allows users to still use
integers to store the result, but in a more accurate unit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-08 19:47:03 +01:00
Peter Johanson
8a29ed9092 drivers: adc: Fix ADC tests for new RP2040 board.
Fix ADC tests with new SparkFun Pro Micro RP2040 board.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2023-01-08 19:32:59 +01:00
Peter Johanson
e8aeea6d5d boards: arm: Add sparkfun_pro_micro_rp2040 board
Add `sparkfun_pro_micro_rp2040` board with `sparkfun,pro-micro` header.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2023-01-08 19:32:59 +01:00
Flavio Ceolin
05d3b57851 doc: security: Disclose CVE information
Add information about CVE-2022-2993

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-01-07 21:34:33 +01:00
Joakim Andersson
3c4783042e manifest: Update TF-M to use upstream patch for MBedTLS build warnings
Update TF-M version which remove the downstream patch and replaces it
with the upstream TF-M patch for masking MBedTLS build warning of
unused const variable.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-01-06 22:33:37 +09:00
Emil Gydesen
8d86fa0125 Bluetooth: Audio: Add support for encrypted broadcast
Add support for adding a broadcast code to the broadcast
source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-06 10:35:25 +00:00
Emilio Benavente
9b1b68657c tests: drivers: i2s: Combined merged the test files into main
Since main was only registering the Test Suite, it made since
to combine the actual tests into one file instead of having
an empty file to initialize the test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente
3ffc64a92d tests: drivers: i2s: ZTest ordering issue fix
The test was executing the expected functions
out of order. I have created a config functions
and explicitly declared them to be setup functions
for this ZTest framework.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente
d4cfc35b8d tests: drivers: i2s: Fix Label Property issue
The I2S Speed test attempted to find a device
via the Label Property of the node. I have updated
the code to search for the nodelabel instead.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente
fdad738cff tests: drivers: i2s: Adding overlays to I2S supported boards
Adding overlay files that give an alias name to the
i2s node that is equivalent to the alias in the
i2s speed test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Krzysztof Chruscinski
a326f05b93 tests: logging: log_api: Fix test_log_arguments case
Test had by accident an early return and after removal case was failing
in certain configurations. It was failing because set of long messages
was not fitting into the logging buffer used in the test. Fixed the
test by adding more frequent processing between the messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-01-05 18:28:33 -05:00
Peter Mitsis
42db096d28 kernel: resolve static analysis false positives
At least one static analysis tool is flagging a potential NULL
derefence in sys_clock_announce()'s tick processing loop where the
routine 'first()' is concerned. In practice, this does not occur as
...

  1. The code in question is protected by a spinlock.
  2. 'first()' does not change the contents of anything.

The code has consequently been tweaked to prevent similar such false
positives in the future.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-01-05 18:23:04 +00:00
Erwan Gouriou
69cc659c92 boards: stm32: fix --reset argument for stm32cubeprogrammer runner
stm32cubeprogrammer runner takes a --reset-mode argument to specify the
type of reset used in the flashing process.
Though, argparse default configuration in python allows shortened command
arguments and it happened that --reset was used on most boards instead
of --reset-mode.
This argparse configuration is being changed in order to prevent shortened
command  args (see #53495). As a consequence all board configs using
--reset should be updated to use the full length version.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-05 11:16:03 -06:00
Robert Lubos
3fd0801a49 net: ipv4: Fix packet leak with IPv4 autoconf
The IPv4 autoconfiguration feature relies on the fact, that autoconf
ARP packets are always prepared by the ARP module. After recent ARP
refactoring though that could no longer be the case due to packet
queueing mechanism. This could lead to net pkt leaks in the autoconf
module.

Fix this by skipping the pending packet queue for autoconf packets.
Since for autoconf ARP requests there's no really a pending packet
to queue, it can be safely avoided. This results in the ARP request
being always sent for the autoconf case, preventing the packet leak.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-01-05 14:39:17 +00:00
Juha Ylinen
5e4eeb104d net: lwm2m: Verify data buffer size in lwm2m_engine_set()
Check data buffer size and return error if
     * buffer size is too small for opaque or string data type
     * buffer size is not equal to res data length when data type
       is fixed size

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2023-01-05 14:39:01 +00:00
Andrei Emeltchenko
e8f0e66bc4 tests: libc: Fix "unused" type of warnings
Follow example several lines below and fix warnings from static tools.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-01-05 08:00:09 -05:00
Mariusz Skamra
8cd6c55d96 Bluetooth: audio: ascs: Fix possible race condition
This fixes possible ASE state race condition. The notification is sent
immediately once the ASE state changed that eliminates a situation where
the state was changed by user action (API function call) when the state
was not yet notified to the remote Unicast Client.

Fixes: BAP/USR/SCC/BV-158-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-01-05 12:43:32 +01:00
Pascal Brogle
60bf310aae net: lwm2m: fix senml cbor object link encoding
use text format instead of tlv format

Signed-off-by: Pascal Brogle <pascal.brogle@husqvarnagroup.com>
2023-01-05 12:43:24 +01:00
Juha Heiskanen
a70f420b2b net: lib: Patch file for generated code fix
Patch for generated lwm2m senml-cbor.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-01-05 12:43:24 +01:00
Juha Heiskanen
d939c79af1 net: lib: LwM2M SenML-Cbor regenrated files update
Patched and fixed regenerated code.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-01-05 12:43:24 +01:00
Juha Heiskanen
637c9bbf95 net: lib: regenerate cbor code using zcbor
with the updated cddl for object links.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-01-05 12:43:24 +01:00
Pascal Brogle
547c3063b9 net: lwm2m: support senml cbor object link
use "vlo" map key

Signed-off-by: Pascal Brogle <pascal.brogle@husqvarnagroup.com>
2023-01-05 12:43:24 +01:00
Chris Wilson
18d47316ed drivers: clock_control: esp32: fix cpu_freq divisor typo.
Current divisor is 10000000 (should be 1000000).

For example, ESP32_CLK_CPU_240M / 10000000 == 24 MHz (incorrect).

Signed-off-by: Chris Wilson <christopher.david.wilson@gmail.com>
2023-01-05 12:43:17 +01:00
Juha Ylinen
eb914f45d1 net: lwm2m: Check return value from lwm2m_rd_client_pause/resume
Check return values from lwm2m_rd_client_pause() and
lwm2m_rd_client_resume() when engine thread suspend is requested.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2023-01-05 12:43:00 +01:00
Sam Hurst
3e98f20d66 samples: subsys: usb_c: sink: Add missing policy notifications
Add missing policy notifications to case statement

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
983b693198 usb_c: Stop chunking_not_supported timer on exit
Stop chunking_not_supported timer on exit

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
0ed5c886c9 usb_c: Remove unnecessary PE_FLAGS_PROTOCOL_ERROR flag
Remove unnecessary PE_FLAGS_PROTOCOL_ERROR flag

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
77c7a51e4d usb_c: Remove unnecessary code from PE_Send_Soft_Reset
Remove unnecessary code from PE_Send_Soft_Reset

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
3af2752680 usb_c: Transition to Sink Ready on sender response timeout
Transition to pe_snk_ready state from pe_drs_send_swap_run,
on sender response timeout

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
24e18d46f1 usb_c: Properly handle Protocol Errors during DRS
From 8.3.3.4.2.1 PE_SNK_Send_Soft_Reset State, Error Recovery
should be performed if a Protocol Error happens during a Data
Role Swap.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
c27a3a31d3 usb_c: Fix DPM request handlers
Processing the common DPM request handler in the
Sink DPM request handler.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
f04da7f7ab usb_c: Check state machine array of states
Build time check that the number of states initialized
in the state machine array matches the number of enums
used to index said array.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
5b3155ff90 usb_c: Use atomic arrays for PE flags
Use atomic arrays for PE flags because the total number
of Policy Engine flags could exceed 32

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
914fed36d5 usb_c: run clang-format
Run clang-format

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Sam Hurst
7910c617be usb-c: Refactor USB-C Subsystem Sink
Refactor USB-C Subsystem Sink so that Power Delivery
Source support and be easily added.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-05 10:34:06 +01:00
Zhang Lixu
853469351a sensor: add helper function for convert radians and 10 micro degrees
This helper function would be used by Sensor SubSystem(senss).

When the unit is 1 micro degree, the range that the int32_t can
represent is +/-2147.483 degrees. In order to increase this range,
here we use 10 micro degrees as the unit.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
2023-01-05 10:33:46 +01:00
Zhang Lixu
e21ec66738 sensor: add helper function to convert micro Gs and m/s^2
This helper function would be used by Sensor SubSystem(senss).

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
2023-01-05 10:33:46 +01:00
Chris Friedt
8e4137f149 tests: posix: clock: ensure overflow is consistent
Add a test to verify previous fixes when calculating time in
seconds for `clock_gettime()`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-01-04 21:12:58 +01:00
Chris Friedt
4108e14740 ztest: provide sys_clock_tick_set syscall
Accurate timekeeping is something that is often taken for granted.

However, reliability of timekeeping code is critical for most core
and subsystem code. Furthermore, Many higher-level timekeeping
utilities in Zephyr work off of ticks but there is no way to modify
ticks directly which would require either unnecessary delays in
test code or non-ideal compromises in test coverage.

Since timekeeping is so critical, there should be as few barriers
to testing timekeeping code as possible, while preserving
integrity of the kernel's public interface.

With this, we expose `sys_clock_tick_set()` as a system call only
when `CONFIG_ZTEST` is set, declared within the ztest framework.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-01-04 21:12:58 +01:00
Chris Friedt
44b72bf801 posix: clock: fix seconds calculation
The previous method used to calculate seconds in `clock_gettime()`
seemed to have an inaccuracy that grew with time causing the
seconds to be off by an order of magnitude when ticks would roll
over.

This change fixes the method used to calculate seconds.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-01-04 21:12:58 +01:00
Anas Nashif
6f141fe89c pm: pm_device_runtime_enable/disable should return 0 when PM is disabled
When PM is disabled, it does not make sense to return ENOSYS,
pm_device_runtime_enable/disable should be treated as noop functions.
When PM is disabled, those functions are not supposed to be implemented.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-01-04 13:50:17 -05:00
Dino Li
5bcd47f9b9 espi: it8xxx2: make sure h2ram offset is configured correctly
This change for addressing the below symptoms.
Two FW images have different h2ram offset settings.
Jumping to each other will cause offset setting errors.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2023-01-04 18:41:29 +00:00
Dino Li
02578cb834 it8xxx2/espi: protect clear OBF request
At default, IBF (input buffer full) interrupt status will be cleared
after reading keyboard data input register (KBHIDIR) in ISR.
For request to clear OBF (output buffer full), we need to enable clear
mode. In the mode, IBF status cannot be cleared by reading KBHIDIR
register. It means that if AP output data to 60h/64h port during the
mode enable, IBF interrupt will keep triggering until the watchdog is
reset. This patch addresses this issue.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2023-01-04 18:40:55 +00:00
Anas Nashif
7b32ff8294 MAINTAINERS: add collborators to intel adsp area
Add a few collaborators to the intel adsp area.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-01-04 12:16:15 -05:00
Anas Nashif
73ceff0c8b MAINTAINERS: remove incactive collaborators
Remove inactive intel collaborators.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-01-04 12:16:15 -05:00
Mahesh Mahadevan
1a27e2bd8e samples: mimxrt595: Add Deep power down sample
Add a sample to put the part into Deep power down mode by
setting the state to PM_STATE_SOFT_OFF.
Wakup the part using an RTC alarm.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-01-04 11:03:42 -06:00
Mahesh Mahadevan
3f38b011c3 drivers: counter: Update NXP LPC RTC for wakeup source
Add support to wakeup from low power modes

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-01-04 11:03:42 -06:00
Mahesh Mahadevan
6e688980a3 tests: power_mgmt_soc: Add overlay for MXRT595 EVK
Enable the OS Timer to be a wakeup source

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-01-04 11:03:42 -06:00