Commit graph

96396 commits

Author SHA1 Message Date
Tomi Fontanilles
c294069b7d modules: tf-m: restore check on CONFIG_TFM_PARTITION_INITIAL_ATTESTATION
Restore the check that was introduced in
cd8d4ccad5 and removed in
cac7f4058f, rather than checking only
CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION in the tfm_psa_test sample.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles
925d2ca052 modules: tf-m: fix unused CMake variable warning
Define and pass down PSA_ARCH_TESTS_PATH only in the sample that
needs it (tfm_psa_test).
Otherwise, it provokes a CMake warning because the variable does not
get used in TF-M.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles
a8ec15294f samples: tfm_psa_test: fix CMake logs
Remove TF-M version number and explicit mention of the available test
suites; one was missing.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles
2c575190bb Revert "tf-m: Silence harmless version warning"
This reverts commit 33786b55ab.

Reverting it because the upstream PR has been abandoned, and
this extra CMake variable is causing the warning
"Manually-specified variables were not used by the project".

As of now the version warning doesn't come up.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles
9ad1a7c8d2 modules: tf-m: disable tf-m-tests revision checks
Permanently disable the revision checks made in the tf-m-tests
repository that were introduced with TF-M 2.1.0.

They fail because the expected upstream tags are not found in Zephyr's
tf-m-tests.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles
f451201228 manifest: trusted-firmware-m: update to 2.1.0
Update TF-M to version 2.1.0.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Chaitanya Tata
ef533e2144 tests: spi_loopback: Fix high RAM usage
Display diff of contents for large buffers is not quite helpful and
takes up huge RAM, and if a board has less RAM then this causes the test
module build failures.

So, disable display of diff and just log a failure, small buffer tests
can be used to debug such basic issues and large buffer tests can act as
a smoke test for debugging other issues. This saves about 80K of RAM.

Fixes #72792.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-05-29 12:03:50 +02:00
Jerzy Kasenberg
71ed2e4b02 drivers: spi: Add power management Smartbond SPI
Code adds pm action function that stores SPI configuration
before PD_COM is allowed to be turned off.

PM_DEVICE_RUNTIME scheme is also supported

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-05-29 12:03:29 +02:00
Johann Fischer
2f272b2d79 usb: device_next: fix BOS descriptor request
Return protocol error if bcdUSB is less than 0x0201. Fix typo in number
of capabilities.

Fixes: b0d7d70834 ("usb: device_next: add initial BOS support")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-29 12:03:12 +02:00
Tim Lin
d1ca30e8f7 ITE: drivers/pwm: Optimize the PWM set cycles
It takes 11 CPU ticks to recalculate ctr and cxcprs at the same frequency.
The previously calculated ctr and cxcprs can be stored at the same
frequency without recalculation.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-05-29 12:00:22 +02:00
Tomasz Moń
2368623f32 drivers: udc_dwc2: Avoid IN endpoint dequeue race
Flushing TxFIFO is racing with actual use of the TxFIFO. The software
controls only one side of the race (flush trigger) while the host
controls the other side. Therefore, locking interrupts before flushing
TxFIFO is not protecting against the race condition.

Disable the endpoint on dequeue to make sure that TxFIFO flushing won't
conflict with host actions (because the endpoint would be forced to NAK
the IN tokens before the TxFIFO is flushed).

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-29 12:00:08 +02:00
Tomasz Moń
4db14f83e5 drivers: udc_dwc2: Fix timeouts when disabling endpoints
Do not set NAK bit again for endpoints that already have NAK bit set.
Do not wait for OUT endpoint 0 disable because it cannot be disabled by
application (DOEPCTL0 EPDis bit is Read-Only).

Disable endpoints before disabling interrupts because it is necessary to
handle RXFLVL interrupt (in Slave mode) for GOUTNAKEFF to become active.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-29 12:00:08 +02:00
Robert Lubos
63d4037e2f samples: net: Exclude native_posix when socket service lib is used
Socket service library uses eventfd, which does not work with
native_posix platform, hence need to exclude it from samples that now
rely on socket services.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-05-29 11:59:51 +02:00
Ioannis Karachalios
245c7db0da drivers: display: smartbond: Update PM policy
Since the display port should be enabled
by default and sleep is bound to the
blanking status, PM constraints should
be acquired at initialization.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-29 11:59:36 +02:00
Henrik Brix Andersen
88fb5e2edb drivers: can: shell: print device name in RX path
Include the device name when printing received CAN frames. This improves
the user experience when working with multiple CAN controllers via the CAN
shell.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-29 11:58:54 +02:00
Marcin Szymczyk
68c48cd116 tests: kernel: interrupt: account for table offset
When verifying sw_isr_table, take into account custom offset,
like `CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET` in some
RISC-V SoCs.

Relates to #71948 and #73232.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-05-29 11:58:44 +02:00
Marcin Szymczyk
e17b3fd884 arch: riscv: implement arch_irq_disconnect_dynamic
For SoC with `CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET`,
it should be taken into consideration when disconnecting IRQ.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-05-29 11:58:44 +02:00
Jakub Zymelka
ae0822d0bf tests: drivers: uart: Add nrf54l15/cpuflpr overlays to test scope
Adding a separate overlay for nrf54l15 flpr is required because
running tests on console uart fails.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-05-29 11:58:14 +02:00
Emil Gydesen
b1b61babec doc: Migration guide: Fix bad formatting for LE Audio
The two items for LE Audio had some formatting issues.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-29 11:57:58 +02:00
Ioannis Karachalios
c140053654 drivers: i2c: smartbond: Add support for PM
This commit should add all the functionality needed for the I2C
driver to work when PM is enabled.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-29 08:42:00 +02:00
Tom Burdick
054f453ea7 rtio: Callback chaining and testing
Callbacks were a bit neglected in terms of test coverage, especially
when used in chains. It was clear from the code that chained callbacks
may not actually work, and callback ordering then was hard to verify.
Test callbacks chained to transactions work as expected.

The test iodev had built up some cruft over time and in the process
showed a few bugs once callback chaining was fixed so the test iodev now
better matches typical iodev implementations at this point.

Cancellation testing now includes an added case for cancelling a the
second submission in the chain prior to calling submit noting that no
completions notifications should be given back for those.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-05-29 08:41:12 +02:00
Nicolas Pitre
99dcbdf933 drivers/timer/apic_timer: move to periodic mode
This driver is impossible to make time-accurate using single-shot
mode. Time accuracy may be obtained only by using periodic mode, meaning
it is not tickless capable either. Let's simplify the code by only
supporting periodic mode and strip out the TSC stuff. Any hardware with
TSC capability should now use the apic-tsc driver instead.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-05-29 08:40:43 +02:00
Nicolas Pitre
3c2e57c923 drivers/timer/apic_tsc: use ICR as a fallback timeout event source
This adds support for the local APIC in one-shot mode as the timeout
event source for those cases where the CPU supports invariant TSC but
no TSC deadline capability. It is presented as another timer choice.
Existing Kconfig symbols were preserved to minimize board config
disturbance.

This hybrid approach was implemented kind of backward in the apic_timer
driver but it is far cleaner to carry this here.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-05-29 08:40:43 +02:00
Nicolas Pitre
e34369ce31 drivers/timer/apic_tsc: move to common code pattern
Let's replicate a common code pattern for this to be abstracted more
easily in the future. In addition to duplicating the correctness fixes
implemented in the ARM and RISC-V drivers, this eliminates a couple large
runtime divisions.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-05-29 08:40:43 +02:00
Fin Maaß
7d5f2b6af3 doc: migration-guide-3.7: rename litex compatible
Mention the change of compatible of the
LiteX VexRiscV interrupt controller.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-29 08:40:11 +02:00
Fin Maaß
858f25ce39 maintainers: litex: add to maintainers
move the litex part of the codeowners
file over to maintainers and add me as
colaborator.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-29 08:40:11 +02:00
Fin Maaß
c8fda13b4c drivers: interrupt_controller: litex: add prefix
add litex prefix to its interupt controller.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-29 08:40:11 +02:00
Tomi Fontanilles
b9a7c18ce4 tests: mgmt: mcumgr: fs_mgmt_hash_supported: add unsupported platforms
- `stm32h745i_disco/stm32h745xx/m4` says "#error Flash driver on M4 core
  is not supported yet".
- `mpfs_icicle/polarfire/smp` fails in the compilation of the `spi_nor`
  flash driver.
- `cyw920829m2evk_02` fails to build because of undeclared
  `cyhal_nvm_*()` functions.

As a bonus, group the excluded platforms under the common part to
avoid repeating them.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 08:39:26 +02:00
Tomi Fontanilles
7669b58d9d samples: http_get: exclude native_posix in the CONFIG_POSIX_API=y build
CONFIG_POSIX_API depends on !CONFIG_NATIVE_APPLICATION, which is
incompatible with the native_posix platforms.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 08:39:26 +02:00
Tomi Fontanilles
3efdbe6c0c modules: mbedtls: rename CONFIG_MBEDTLS_MAC_*_ENABLED and rm duplicates
Remove the `_MAC` part because those Kconfig options enable only hash
algorithms, nothing MAC-related, and the `_ENABLED` part to align the
naming to the Mbed TLS defines (plus we don't need such a part).

As a bonus, enabling SHA-256 does not automatically enable SHA-224
anymore.

See the migration guide entries for more details on the practical
changes.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 08:39:26 +02:00
Yong Cong Sin
6e8d979336 arch: riscv: stacktrace: handle user threads
Handle user threads stack bound validation in
`in_stack_bound()` to get more accurate traces.

If `CONFIG_PMP_POWER_OF_TWO_ALIGNMENT` is enabled:

```
+------------+ <- thread.arch.priv_stack_start
| Guard      | } Z_RISCV_STACK_GUARD_SIZE
+------------+
| Priv Stack | } CONFIG_PRIVILEGED_STACK_SIZE
+------------+ <- thread.arch.priv_stack_start +
                  CONFIG_PRIVILEGED_STACK_SIZE +
                  Z_RISCV_STACK_GUARD_SIZE
```

otherwise:

```
+------------+ <- thread.stack_obj
| Guard      | } Z_RISCV_STACK_GUARD_SIZE
+------------+
| Priv Stack | } CONFIG_PRIVILEGED_STACK_SIZE
+------------+ <- thread.stack_info.start
| Thread     |
| stack      |
|            |
+............|
| TLS        | } thread.stack_info.delta
+------------+ <- thread.stack_info.start +
                  thread.stack_info.size
```

See: zephyr/include/zephyr/arch/riscv/arch.h

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-29 08:38:53 +02:00
Yong Cong Sin
602c993799 arch: riscv: stacktrace: fix cpuid type and optimize branch with compiler
Change the type of `cpu_id` to `uint8_t` since that is the type
of `arch_curr_cpu()->id`.

Instead of using precompiler switch (`#ifdef CONFIG_SMP`), use
if-else shorthand instead (`IS_ENABLED(CONFIG_SMP)`).

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-29 08:38:53 +02:00
Dominik Ermel
25138ff99c storeage/stream_flash: Cache write_block_size to ctx on init
The commit caches write_block_size and erase_value to stream flash
context, at init, to avoid calling Flash API multiple times
to get these values at various stages of code exectuion,
at run-time.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-05-29 07:35:19 +02:00
Ethan Lu
9baf77dd39 sensor: ms5837: fix compensate parameters for 30BA variant
The previous parameters seems wrong if we refer to:
https://www.te.com/usa-en/product-CAT-BLPS0017.html

Signed-off-by: Ethan Lu <ethan@cpdesign.com.au>
2024-05-29 07:34:51 +02:00
Fredrik Gihl
649d9d31af drivers: w1: Ensure DQ pin is both input and output.
Driver did not work on ESP32c3, by specifying pin to be output and
input solve the issue. Improve documentation, to highlight that driver
is requiring open-drain support.

Signed-off-by: Fredrik Gihl <fgihl@hotmail.com>
2024-05-29 07:34:29 +02:00
Jeppe Odgaard
a9581c75d1 maintainers: add jeppenodgaard as sensor collaborator
Add myself as collaborator to help with sensor PRs.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-05-29 07:33:58 +02:00
Arkadiusz Cholewinski
5cfb4bd3f5 CI: Fix Coverage Analysis
The coverage_analysis.py while generating report, duplicates
files and functions of components.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2024-05-29 07:33:45 +02:00
Johann Fischer
0809b75b42 boards: remove test feature usb_cdc
This test feature is not required and was only used as a dependency in
the usb/console example. It is redundant since the sample already
depends on usb_device.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-29 07:32:41 +02:00
Declan Snyder
ce7448b11e doc: migration-guilde-3.7: nxp,lptmr
List change to nxp,lptmr compatible in migration guide.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-29 07:32:25 +02:00
Declan Snyder
2cff570083 dts: nxp: Convert nxp,lptmr compats
Convert compats in tree from nxp,kinetis-lptmr to
nxp,lptmr string.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-29 07:32:25 +02:00
Declan Snyder
eae316ebc9 dts: bindings: Rename nxp,kinetis-lptmr compat
Rename nxp,kinetis-lptmr compat to nxp,lptmr.
Because of concerns over breaking downstream users,
keep support for the old compatible temporarily and
make it clear it should be changed.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-29 07:32:25 +02:00
Pisit Sawangvonganan
75165050f7 drivers: gpio: remove '&' when assigning gpio_xxx_init function
Remove address-of operator ('&') when assigning `gpio_xxx_init`
function pointer in `DEVICE_DT_INST_DEFINE` macro.

This change aims to maintain consistency among the drivers in
`drivers/gpio`, ensuring that all function pointer assignments
follow the same pattern.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-29 07:32:17 +02:00
Ravi Dondaputi
9e38bcc173 wifi: utils: Get correct channel count
When channel range is configured in scan params, get the
channel count from `chan_idx` instead of taking a difference
of start and end of the channel range. The `difference` method
fails in case of 5GHz band since channels may not be consecutive
numbers.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2024-05-29 07:32:09 +02:00
Margherita Milani
885d271e57 drivers: sensor: si7006: fix redundant include in si7006
Remove redundant include of `zephyr/logging/log.h` in si7006.c.

Signed-off-by: Margherita Milani <margherita.milani@amarulasolutions.com>
2024-05-29 07:31:53 +02:00
Daniel DeGrasse
0767fd97f8 sd: sd_ops: fix DISK_IOCTL_CTRL_SYNC return code
SD IOCTL handling for DISK_IOCTL_CTRL_SYNC was falling through to the
default return statement, and returning an error when disk sync
succeeded. Fix this issue by properly breaking in IOCTL handler.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-29 07:31:39 +02:00
Sadik Ozer
e31d66a183 boards: Add MAX32690EVKit board
Added MAX32690EVKit board
For more information about this board please check
https://www.analog.com/

MAX32690 has two core, Cortex-M4 and Risc-V.

Examples can be build by below command for cortex-m4

west build -b max32690evkit/max32690/m4 samples/hello_world

As a shorthand, the soc may be omitted from the build command and
keeping the corresponding forward slashes:

west build -b max32690evkit//m4 samples/hello_world

Co-authored-by: Jason Murphy <jason.murphy@analog.com>
Co-authored-by: Maureen Helm <maureen.helm@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-05-29 07:30:12 +02:00
Sadik Ozer
d33d5b3a79 soc: Add the MAX32690 SoC
Added ADI MAX series soc, first partnumber is MAX32690
The family structure will be
ADI_MAX
  MAX32xxx
    MAX32655
      MAX32655EVKIT
      MAX32655FTHR
    MAX32666
      MAX32666FTHR
      MAX32666FTHR2
    MAX32690
      MAX32690EVKIT
  MAX78xxx
    MAX78000
    MAX78002
        ...

When MAX32 MCUs goes to sleep mode debugger could not access it
and flashing fails, ARM_ON_ENTER_CPU_IDLE_HOOK prevent
the CPU from actually entering sleep
by skipping the WFE/WFI instruction.
Due to ARM_ON_ENTER_CPU_IDLE_HOOK is not configurable at the user
space, added a config wrapper as MAX32_ON_ENTER_CPU_IDLE_HOOK.

If MAX32_ON_ENTER_CPU_IDLE_HOOK config being defined (default y)
devicei will not goes to sleep mode in idle state.

To disable it add below line in your configuration file
CONFIG_MAX32_ON_ENTER_CPU_IDLE_HOOK=n

MAX32690 has two core Cortex-M4 and Risc-V this commit adds M4 core
support.

Co-authored-by: Jason Murphy <jason.murphy@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-05-29 07:30:12 +02:00
Sadik Ozer
0480b2625b drivers: Add MAX32690 uart driver
UART driver for MAX32690

Co-authored-by: Okan Sahin <okan.sahin@analog.com>
Co-authored-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-05-29 07:30:12 +02:00
Sadik Ozer
c121f405fe tests: drivers: gpio: Enable gpio driver tests for max32690evkit board
Enable gpio driver test for max32690evkit

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-05-29 07:30:12 +02:00
Sadik Ozer
d6e1753125 drivers: Add MAX32690 gpio driver
GPIO driver for MAX32690

Co-authored-by: Okan Sahin <okan.sahin@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-05-29 07:30:12 +02:00