Commit Graph

90310 Commits

Author SHA1 Message Date
Øyvind Rønningstad 0786e523da west.yml: Update zcbor to 0.8.0 as well as uoscore-uedhoc and MCUboot
Highlights of zcbor 0.8.0:
- Add support for unordered maps
- Performance improvements
- Naming improvements for generated code
- Bugfixes

Update MCUboot and uoscore-uedhoc to bring in changes related to
zcbor 0.8.0.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-25 15:09:16 +00:00
Hang Fan b3d2891e16 Bluetooth: Classic: Add support for class of device
Add `CONFIG_BT_COD` for class of device.

< HCI Command: Write Class of Device (0x03|0x0024) plen 3
        Class: 0x200408
          Major class: Audio/Video (headset, speaker, stereo, video, vcr)
          Minor class: Hands-free Device
          Audio (Speaker, Microphone, Headset)
> HCI Event: Command Complete (0x0e) plen 4
      Write Class of Device (0x03|0x0024) ncmd 1
        Status: Success (0x00)

Signed-off-by: Hang Fan <fanhang8@gmail.com>
2024-01-25 15:09:01 +00:00
Patryk Duda 73396f9f86 flash: Add program/erase parallelism support for STM32F4x
The implementation uses the same approach as STM32F1x.

Program/erase speed can be set by setting 'write-block-size' flash
property to 1, 2, 4 or 8.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-01-25 14:45:32 +01:00
Nicolas Pitre 7c21df641d multi_heap: keep number of heaps as an unsigned value
Although very unlikely for this value to ever be negative in practice,
this would make Coverity happy.

Fixes #67969

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-01-25 11:36:23 +00:00
Alberto Escolar Piedras 571b647825 subsys/net/lib/lwm2m: Change how we seed the random generator
Instead of seeding the random generator from the test
itself calling into a host API, let's use the
entropy generator option to be seeded from /dev/urandom

This avoids trouble with the srandom() and time() calls
not existing depending on the chosen C library.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-25 12:28:51 +01:00
Alberto Escolar Piedras c6ed39e3ad drivers entropy fake_native: Add option to seed generator randomly
Add a command line option which will seed the random generator
from /dev/urandom.
This can be usefull for some particular tests in which we are
interested in having different random numbers in each run,
but we cannot provide a different random seed from command line.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-25 12:28:51 +01:00
Flavio Ceolin 3fc5d971fe security: Add compiler static analysis support
Enable GCC builtin static analysis in Zephyr's static code analysis
(SCA) infra.

When this option is enabled GCC performs a static analysis and
can point problems like:

sample.c

+	int *j;
+
+	if (j != NULL) {
+		printf("j != NULL\n");

output:

${ZEPHYR_BASE}/samples/userspace/hello_world_user/src/main.c:30:12:
warning: use of uninitialized value 'j' [CWE-457]
[-Wanalyzer-use-of-uninitialized-value]

   30 |         if (j != NULL) {
      |            ^
  'main': events 1-2
    |
    |   25 |         int *j;
    |      |              ^
    |      |              |
    |      |              (1) region created on stack here
    |......
    |   30 |         if (j != NULL) {
    |      |            ~
    |      |            |
    |      |            (2) use of uninitialized value 'j' here

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-25 12:07:27 +01:00
Keith Packard b27494b7ed lib/libc: Update picolibc to 1.8.6
* Reduces memory usage for ctype while fixing an 'isblank'
   related compatibility issue.

 * Resolves compatibility issues with GCC 13

 * Removes explicit _POSIX_C_SOURCE definition when building
   as a module.

 * Fix some _FORTIFY_SOURCE issues.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-01-25 12:07:19 +01:00
Keith Packard 4f40dd1f95 tests/strerror: Remove test for non-standard strerror_r function
Zephyr does not include this function under Rule A.4: C Standard Library
Usage Restrictions in Zephyr Kernel, hence a conforming C library need not
provide it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-01-25 12:07:19 +01:00
Christopher Friedt 57057b141c posix: add a top-level menu
Add a top-level menu to prevent POSIX API options from
cluttering the menuconfig view under
"Additional libraries".

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-25 05:54:06 -05:00
Bjarki Arge Andreasen d801e697dd modem: chat: Implement TRANSMIT_IDLE event
Refactors modem chat module to use TRANSMIT_IDLE event instead
of polling when transmitting, cleaning up the transmit handler
by combining duplicate code and using an internal state instead
of multiple iterators to track send state.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Bjarki Arge Andreasen 27b0d4e3fe modem: chat: remove receive and transmit timeouts
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.

Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Magdalena Kasenberg 62809d7581 bluetooth: tester: Enable BT_CTLR_ISOAL_PSN_IGNORE
Temporarily ignore the Tx ISO Data Packet Sequence Number use
as the tester app does not have yet a synchronization mechanism for
the sequence number and it constantly fails to send ISO data on time.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2024-01-25 09:04:02 +01:00
Guillaume Gautier 5aff88ab93 drivers: entropy: stm32: reinit rng when exiting suspend to ram
With PM, when resuming from low power mode, reenable the RNG register
clocks and check the health register. If it is not set to the desired
value, it means we exit Suspend to RAM mode, and that the RNG needs to be
reinitialized.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier b8fdcbb59e drivers: entropy: stm32: prevent suspend to ram when operation in progress
Prevent the system to enter Suspend to RAM state while RNG operation is
in progress.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 276fc569d6 drivers: adc: stm32: prevent suspend to ram while measure in progress
Prevents the system to go in Suspend to RAM low power mode while ADC
measurement is in progress.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 0792a85f77 drivers: serial: stm32: add reinit after standby
When resuming from low power mode, if UART is disabled, this means that
we come from a mode that reset the registers, so we redo a full init of
the driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier be26c71fd4 drivers: serial: stm32: prevent suspend to ram when operation in progress
Prevent the system to enter Suspend to RAM state while UART operation is
in progress.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 02ef0c5fb9 drivers: gpio: stm32: do not resume device when flag is DISCONNECTED
Fix a bug where after a standby, it was impossible to reenable a GPIO
clock.

A counter is incremented each time pm_device_runtime_get is called, and
decremented each time pm_device_runtime_put is called. The
clock is only enabled if this counter equals 1.
When configuring a GPIO (as input or output), the timer is incremented, and
when disconnecting it, it is both incremented and decremented. Thus the
next time we try to configuring it, the clock is not enabled (since the
counter will now be equal to 2).

This causes a problem when using low power standby mode: after wakeup all
clocks are disabled and the GPIO clock can not be reenabled.

This commit fixes this bug by not incrementing the counter when disconnect
is asked (or in other words incrementing it only when configuring either
an input or an output).

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier 58c296b30f drivers: timer: stm32 lptim: add support for backup standby timer
Add support for a backup standby timer in STM32 LPTIM driver for cases
when the LPTIM is not available (ie standby low power mode).
A counter (typically RTC) is used for such a case.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Guillaume Gautier e541666d90 drivers: timer: stm32: lptim: remove init to 0 of static
Remove initialization of static variable to 0 to prevent resetting the
value when reinitializing the driver after resume from standby.
This has no impact since static variables are initialized to 0 by default.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-25 08:55:02 +01:00
Mykola Kvach 09fbd4c2cd drivers: pinctrl: renesas: add definitions of missed IPSR macros
Add missed definitions of IP[0-3]SR[67] macros.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-01-25 08:54:52 +01:00
Mykola Kvach caf9a53330 drivers: pinctrl: renesas: fix ipsr generation for S4
Avoid unexpected memory access in cases where the IPSR has an odd
register index. In the scenario where an odd register index is present
in IPSR, the LSB of the register index is utilized as MSB of the bank
number. Observe how we pack reg/bank:
    'IPSR(((reg) << 4U) | (bank), shift, func)' (macro IPnSR)
and how it is read from the device tree source:
    '(RCAR_IPSR(node_id) >> 10U) & 0x1FU' (macro RCAR_PIN_FUNC).

 Finally, this bank is used to obtain the required IPSR offset:
    'PFC_RCAR_IPSR + rcar_func->bank * sizeof(uint32_t)'
in the 'pfc_rcar_set_ipsr' function. For example, if we have the 1 as
a reg index and the 3-rd bank, the resulting offset would be 19,
which is beyond the IPSR range.

Align the IPSR comment with the definition of the 'rcar_pin_func'
structure.

Note: we can omit the usage of the register index entirely since this
information is obtained from the pin number inside the
'pfc_rcar_get_reg_index' function.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-01-25 08:54:52 +01:00
Timm Knape 019fbefa0f doc: Clarified usage of STL with Minimal C++ Library
STL is not available, so the applications should *not* rely on it.

Signed-off-by: Timm Knape <timm@knp.de>
2024-01-25 08:54:38 +01:00
Jordan Yates 4019d17746 flash: spi_nor: different `wait_until_ready` delays
Provide different loop delays to `wait_until_ready` based upon the
operation that we are waiting for.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-24 22:15:33 -06:00
Jordan Yates a7ba06bedb flash: spi_nor: don't hard loop in `wait_until_ready`
Don't monopolise the CPU in `spi_nor_wait_until_ready`. For slow flash
chips, operations can take minutes (Full chip erase on MX25R is listed
as 120s typical, 240s max).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-24 22:15:33 -06:00
Jędrzej Ciupis 88c4362ef7 manifest: update hal_nordic revision
This commit updates revision of hal_nordic repo.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-24 22:13:40 -06:00
Greter Raffael 81022fae79 linker: Only use itcm and dtcm snippets if regions exist
This tests whether there actually is an itcm or dtcm in the device tree.
Otherwise a FATAL_ERROR is generated.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-24 22:10:11 -06:00
Greter Raffael 33ffe001f8 linker: Generate snippets files for dtcm and itcm
This allows to link code and data blocks, e.g. the vector table, into
tightly coupled memory using `zephyr_linker_sources`.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-24 22:10:11 -06:00
Yong Cong Sin acfb87dca3 devicetree: reuse `DT_CAT*` instead of pasting manually
Reuse `DT_CAT*` macros to paste these things together instead
of pasting manually.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-24 19:56:42 -05:00
Yong Cong Sin f64af1aecb devicetree: use `DT_CAT*` wherever possible
Use `DT_CAT*` macros to paste simple things together instead
of `UTIL_CAT` wherever possible. This should reduce the amount
of error messages from the compiler when something goes wrong.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-24 19:56:42 -05:00
Christopher Friedt 2236e57e42 samples: thrift: update doc to include optional modules
Update the Thrift sample to include instructions on
fetching optional modules. Without this, user builds
will fail.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-24 19:35:33 -05:00
Flavio Ceolin 4e39f79eeb drivers: power_domain/intel_adsp: Init priority option
Add a Kconfig option to customize initialization priority of
Intel ADSP power domain.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-24 18:20:17 -05:00
Flavio Ceolin e80ea1e129 drivers: power_domain/gpio: Init priority option
Add a Kconfig option to customize initialization priority of
gpio power domain.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-24 18:20:17 -05:00
Flavio Ceolin 9506720bd8 drivers: power_domain/gpio_monitor: Init priority option
Add a Kconfig option to customize initialization priority of
gpio monitor power domain.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-24 18:20:17 -05:00
Pisit Sawangvonganan e7875de3f9 drivers: sdhc: set 'sdhc_driver_api' as 'static const'
This change marks each instance of the 'api' as 'static const'.
The rationale is that 'api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-24 21:25:06 +00:00
Alberto Escolar Piedras cf6a3824a0 tests/bsim host/privacy/peripheral: Minor fixes to allow equality check
Minor fixes in this test script to:
* Start with an empty flash even if there was a left over flash file
  on disk
* Not overwrite the simulation activity from the first part of the test
  in the second part of the test, to allow looking into the
  traffic and to allow rerunning the test in check mode, to ensure
  there is no radio activity changes when another change is done.
* Set the simulation id to something more unique (it was just
  "peripheral" before which is too easy to be repeated in another
  test)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-24 21:19:57 +00:00
Peter Mitsis 4c5a96ec65 tests: latency_measure: Configurable iterations
Updates the latency_measure benchmark to make the number of
iterations for which each test executes to be configurable.
This allows someone to make a tradeoff between accuracy
and execution time (can be useful for simulators).

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-24 21:48:56 +01:00
Tim Lin 8317f9ea4f ITE: drivers/gpio: Add keyboard-controller property
When set, this GPIO controller has pins associated with the
keyboard controller. In this case the reg_gpcr property is
overloaded and used to write the keyboard GCTRL register

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-01-24 21:48:12 +01:00
Dominik Ermel 43d57ce1c2 doc/releases: Add note on update of LittleFS
The LittleFS is now at version 2.8.1.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-01-24 21:47:35 +01:00
Johan Hedberg c1dfa97960 doc: coding_guidelines: Update reference to Bluetooth language document
Update the reference to the Bluetooth Appropriate Language Mapping
Tables document. The link is now the same as the Bluetooth SIG website
uses.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2024-01-24 18:02:38 +01:00
Daniel DeGrasse c1b7b817cc sd: modify sdmmc_wait_ready to always decrement timeout
As described in issue:
https://github.com/zephyrproject-rtos/zephyr/issues/65027,
sdmmc_wait_ready can enter an infinite loop if the card is removed while
waiting for it to report an idle status. Fix this by always decrementing
the timeout in sdmmc_wait_ready, regardless of whether the SD card is
busy.

Fixes #65027

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-24 16:37:21 +00:00
Hake Huang d744719eb8 test: dma: fix dma code-data_relocation failure on nxp rt platforms
NXP RT series DMA need use buffer in nocached area,
so only use memory region relocated is not enough.

fixing: #67053

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-01-24 17:07:29 +01:00
Talha Can Havadar 4ce0555d90 drivers: bmp581: Add BMP581 driver
This commit adds source and header files required for bmp581 I2C driver.
I have used bmp581_user.h to add more usage related definitions
but bmp581.h to add hardware related definitions.

Signed-off-by: Talha Can Havadar <havadartalha@gmail.com>
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-01-24 09:32:34 -05:00
Javad Rahimipetroudi 8534767aed boards: arm: stm32wb5mm-dk: add basic board support
This patch add the basic board support for the
STM32WB5MM-DK Discovery Kit. At the moment only
debug UART Debug is ported. Other peripherals will be added
in the following patches.

Signed-off-by: Javad Rahimipetroudi <javad.rahimipetroudi@mind.be>
2024-01-24 14:56:31 +01:00
Marco Widmer 32b4388ba8 drivers: dma: stm32: do not clear busy flag in cyclic mode
The STM32 DMA driver supports cyclic mode by setting source_reload_en
and dest_reload_en. This causes the dma_callback to be called twice per
buffer run-through, at half-time and when wrapping back to the start of
the buffer.

However, the current implementation only calls dma_callback twice. When
wrapping the first time, it sets stream->busy to false and ignores
subsequent interrupts.

With this change, the busy flag is only cleared in non-cyclic mode.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2024-01-24 14:56:24 +01:00
Jonathan Rico 6fa5d1e6a5 Bluetooth: L2CAP: fix net buf frags handling
Fix the handling of buffers with fragments. What seems to have been
broken is the metadata reference that was not passed to the next frag in
the chain.

Add a test to regression too.

The main user of this is IPSP.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-24 14:56:16 +01:00
Jonathan Rico 9d5217f68b Bluetooth: L2CAP: call `bt_l2cap_send_cb` once
Small refactor to improve readability.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-24 14:56:16 +01:00
Guillaume Gautier 7228642c72 tests: drivers: adc: adc_api: boards: st: use different acquisition time
Use different acquisition time for a board (WB55) that has individual
sampling register, and for another (WBA52) that have two common registers.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-24 12:44:59 +00:00
Guillaume Gautier 14839e80d5 drivers: adc: stm32: add support for two sampling time common channels
For series that have two sampling time common channels, only one was used.
This commit add the support for the second one. The first two different
acquisition time values are used for the sequence and all further values
must match either of them, otherwise generating an error.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-24 12:44:59 +00:00