Commit graph

92323 commits

Author SHA1 Message Date
Anas Nashif 35176b993d twister: fix exception message
'Handling of handler...' is a bit weird to read.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-13 08:39:37 +01:00
Anas Nashif dbc3246723 tests: twister: use assert_called_with for multiple calls
Do not use assert_called_once_with, we can some functions more than once
and test should not prevent that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-13 08:39:37 +01:00
Anas Nashif 6eb3c2e4c1 twister: harness: match exact charachters when we detect tests
Avoid detecting garbage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-13 08:39:37 +01:00
Anas Nashif 233b2e1100 twister: handler: update missing status of failed tests
Some tests report no status even without timeout, so address this case
as well.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-13 08:39:37 +01:00
Marc Herbert 811a74c019 boards/Kconfig: $BOARD_REVISION -> $(BOARD_REVISION)
Add parentheses missing around $BOARD_REVISION.

The syntax without parentheses has been deprecated for at least 5 years:
https://github.com/ulfalizer/Kconfiglib/commit/374f48873424f9

That same documentation states "Using the old syntax with an undefined
environment variable keeps the string as is." This what actually happens
on Windows where `build/zephyr/.config` looks like this:

  CONFIG_BOARD_REVISION="$BOARD_REVISION"

I found this because the behavior differs on Linux where the same,
"old" syntax produces this instead:

  CONFIG_BOARD_REVISION=""

This could be because environment variables work differently?
(BOARD_REVISION is passed from kconfig.cmake to kconfiglib.py thanks to
cmake -E env)

Let's not try to debug this and just drop the deprecated syntax. It
aligns both Windows and Linux on the same, expected, empty string
behavior.

Note these are the only two `def_string` found across all Kconfig files
right now.

Fixes commit c11b7852d1 ("Kconfig: add CONFIG_BOARD_REVISION")
Fixes commit e2ff2a88ba ("sysbuild: include HWMv2 Kconfig in sysbuild")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-13 08:38:07 +01:00
TOKITA Hiroshi ba46cd006c dts: bindings: gpio: arduino-mkr-header: Correct wrong D9/SCK pin number
D9/SCK pin is #9 pin, not #0.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-03-12 20:22:12 -05:00
TaiJu Wu be9a85bf6c test: Remove multi level queue limit test
Set total priorities to 71.
This setting already exceeds original limit(32) and exceeds 64 to test
secondary bitmap.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2024-03-12 19:37:40 -04:00
TaiJu Wu 1f5f0cf838 sched: Remove multi-level queue priority limit
Modified bitmask to  bitmask array, it can make multilevel queue remove
32 bit prioriry limit.

We can scan bitmask array to find which queue have ready thread.

Only need the number of queues as priority because the priority
is checked on create_thread.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2024-03-12 19:37:40 -04:00
Fabio Baltieri a63b3d1de6 input: xec: use the generic keyboard code
Split the common keyboard scanning code out of the XEC specific driver
and use the generic code instead.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-12 19:30:09 -04:00
Fabio Baltieri ddd2cf1fdc input: convert kscan_mchp_xec.c driver to input
Convert the XEC keyboard scanning driver from kscan to input, add the
corresponding kscan compatibility node to the current board, build test
only.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-12 19:30:09 -04:00
Guillaume Gautier 3b50237699 drivers: adc: stm32: use correct macros for dma transfer
Use the correct dedicated macros for enabling DMA transfer for STM32H7 and
U5.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-12 19:28:54 -04:00
Guillaume Gautier 7aa5d33a94 include: zephyr: drivers: dma: stm32: Fix macro
Macro STM32_DMA_SLOT_BY_IDX should return 0 instead of nothing for
dma v2bis.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-12 19:28:54 -04:00
Guillaume Gautier 5d2558bdad drivers: adc: stm32: dma fixes
Add a blank define for the case where DMA channels are defined in ADC node
of the dts but STM32_ADC_DMA is not enabled. Otherwise compilation fails.
Also fix the way the DMA channel is configured by using a standard DT
macro, otherwise it doesn't work for dma-v2bis DMA types.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-12 19:28:54 -04:00
Fabio Baltieri d123a4571a input: kbd_matrix: define PRIkbdrow coherently
It's not supposed to have the "%" in the macro, reuse the existin one
for the data type.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-12 19:28:40 -04:00
Marc Herbert 03a79d6387 llext: elf.h: fix sign of the r_addend field of struct elf32_rela
The r_addend field is signed (it seems unused for now).

Fixes commit a9a82d557c ("llext: use elf_rela_t instead of elf_rel_t")

https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.reloc.html

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-12 19:28:18 -04:00
Marc Herbert 7eb1d3d57d llext: elf.h: fix wrong 32 bits length of elf64_rela fields
Fixes commit a9a82d557c ("llext: use elf_rela_t instead of elf_rel_t")

Also switch sign of (unused?) `r_addend` to unsigned.

https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.reloc.html

Issue found thanks to the following warnings when compiling in 64bits:

```
/__w/zephyr/zephyr/include/zephyr/llext/elf.h:349:29: error:
  right shift count >= width of type [-Werror=shift-count-overflow]
     349 | #define ELF64_R_SYM(i) ((i) >> 32)
```

The name `elf64_word` was admittedly confusing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-12 19:28:18 -04:00
Marc Herbert 4ad9f90638 llext.c: fix logging of 64 bits pointers
Note `elf64_addr` and friends are defined as uint64_t which is defined
as `long long unsigned` which is for some reason different from
`size_t`. So they all require a cast.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-12 19:28:18 -04:00
Declan Snyder 3667526b83 boards: lpcxpresso55s69: Fix misnomer
pinmux.c is inaptly named since it has nothing to do with pinmux.
Also, remove inclusion of iocon.h since this file does not use it,
as this file has nothing to do with pinmux.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-03-12 21:26:48 +01:00
Robert Lubos 53561e3766 net: dns: Fix timeout calculation with DNS retransmissions
With recently introduced DNS retransmission mechanism, a certain bug
could occur when calculating query timeout.

If the time until the final DNS timeout (as indicated by
CONFIG_NET_SOCKETS_DNS_TIMEOUT) was less than 1 millisecond, the actual
millisecond timeout value was rounded down, resulting in 0 ms timeout.
This in order was interpreted as invalid argument by dns_get_addr_info()
function, so in result, instead of reporting query timeout, the function
reported invalid argument error.

Fix this by rounding the millisecond timeout up, instead of down, so
that in any case, if the final timeout is not due, we always provide
non-zero timeout to dns_get_addr_info().

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-03-12 15:13:31 -05:00
Flavio Ceolin 07426a800c intel_adsp/ace: power: Lock interruption when power gate fails
In case the core is not power gated, waiti will restore intlevel. In
this case we lock interruption after it.

In the bug scenario, the host starts streaming and via SOF APIs, keeps a
lock to prevent Zephyr from entering PM_STATE_RUNTIME_IDLE. During the
test case, host removes this block and core0 is allowed to enter IDLE
state.

When core0 enters power gated state, interrrupts are left enabled (so
the core can be woken up when something happens). This leaves a race
where suitably timed interrupt will actually block entry to power gated
state and k_cpu_idle() in power_gate_entry() will return. This is rare,
but happens often enough that the relatively short test plan run on SOF
pull-requests will trigger this case.

Fixes #69807

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-12 15:12:57 -05:00
Marc Herbert c15f029a71 init.h: restore designated initializers in SYS_INIT_NAMED()
As seen in the PR #68125 discussion, commit 19a33c7884 ("init: adjust
the SYS_INIT dev field init to play nice with older compilers") entirely
threw away designated initializers in SYS_INIT_NAMED() to avoid
compatibility issues across toolchains.

One key aspect that was probably missed at the time: C and C++ are two
different languages and this is especially true with respect to
designated initializers.

Designated initializers provide safer and more readable code, especially
in their much stricter C++ version. So use an #ifdef to restore them in
SYS_INIT_NAMED() thanks to a small braces difference between C and C++.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-12 15:12:37 -05:00
Daniel DeGrasse 5b6fadc10d drivers: mipi_dbi: mipi_dbi_spi: do not take spinlock
Taking a spinlock will result in interrupts being blocked in the MIPI
DBI driver, which is not desired behavior while issuing SPI transfers,
since the driver may use interrupts to drive the transfer

Fixes #68815

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-12 15:12:12 -05:00
Anas Nashif f9932c578d tests: benchmark: adapt recording of benchmark results
We now have a different output, so capture it correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-12 15:02:49 -04:00
Emil Gydesen 025032232c Bluetooth: BAP: Shell: Fix issue with stopping broadcast sink
When the broadcast sink is stopped, the sink was also
set to NULL via

default_broadcast_sink.bap_sink = NULL;

However the lifetime of the broadcast sink does not
follow the state of the streams, and it still exists
afterwards. The broadcast sink can only be terminated
(deleted) via the term_broadcast_sink command.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:57:49 +00:00
Dominik Ermel 6d40cb8038 tests/flash: Fix nrf52840dk configurations
The commit disables QSPI in SoC configurations, as QSPI got enabled
by default and test never really run on SoC.

In QSPI configuration erase page size is set to 4096
There is not TC_PRINT showing name of device that the test will
run on, in test setup.

The nrf52840dk configuration files have been renamed to reflect
dk name and SoC.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-03-12 17:57:39 +00:00
Georgios Vasilakis d706367423 soc: nordic: nrf54l: Remove redundant option
The option SOC_NRF54L_GLITCHDET_WORKAROUND is not
needed anymore becuase the glitch detector is already
disabled in the Nordic MDK in the hal_nordic repo.

File path in hal_nordic:
nrfx/mdk/system_nrf54l.c

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
2024-03-12 17:57:29 +00:00
Alberto Escolar Piedras 2e5a71961e tests/drivers/counter: Allow on nrf52_bsim
Allow all tests which run in the real nrf52840 to also
run in the simulated nrf52_bsim.
That way we will have runtime tests in CI.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 17:57:18 +00:00
Alberto Escolar Piedras 7e47979876 nrf52_bsim: Claim support for counter to enable tests
Let's set the counter tag so counter tests run in this platform.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 17:57:18 +00:00
Alberto Escolar Piedras 16cbf80620 tests/drivers/counter/counter_basic_api: Add overlay for nrf52_bsim
Add a DT overlay so this test can also be run in the nrf52_bsim
simulated board.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 17:57:18 +00:00
Alberto Escolar Piedras 62e9a38590 drivers counter_nrfx_rtc: Fix for simulation
For simulation, let's convert the hardcoded DT/real
HW address to the valid addr for simulation on the fly.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 17:57:18 +00:00
Alberto Escolar Piedras 5b8b9c9f6a manifest: Update nrf hw models to latest
* Update the HW models module to
ffd0ddec0239a47739892f4e705e97b2285a8508

Including the following:
* ffd0dde HAL: RTC2 for nrf52833 was missing
* 12e66d1 PPI: Connect RTC tasks
* e4f3ab9 TIMER: Fix for CAPTURE task when counter was never started

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 17:57:18 +00:00
Christopher Friedt cdc36d090c posix: sysconf: add a "small" implementation option
Previously, sysconf() was only available as a macro (i.e. the
"extra-small" option).

This has the advantage of being compile-time constant, and
optimized for both space and speed. One disadvantage is that
querying an `_SC_` value that was invalid or unsupported
would result in a compile error.

Provide a "small" implementation of sysconf() (via Kconfig
choice) as a normal addressable function.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-12 17:57:11 +00:00
Eve Redero e5573a6ee0 doc: samples: lvgl: add details to lvgl demos readme
LVGL demos in this folder are all based on pointer input devices,
not any input devices types.

Signed-off-by: Eve Redero <eve.redero@gmail.com>
2024-03-12 17:56:36 +00:00
Emil Gydesen 164529145b Bluetooth: Audio: Shell: CAP change microphone gain command
Adds the change microphone gain command to the CAP commander shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Emil Gydesen 6f405f6b80 tests: Bluetooth: CAP Commander Change Microphone Gain unittests
Adds unittests for the CAP Commander Change Microphone Gain
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Emil Gydesen 8956642265 tests: bsim: Bluetooth: CAP Commander Change Microphone Gain
Adds bsim test of the CAP Commander Change Microphone Gain
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Emil Gydesen fa6a7c1b77 Bluetooth: CAP: Commander change microphone gain procedure
Adds the CAP Commander Change Microphone Gain procedure.
This procedure changes the microphone gain on one or more
CAP Acceptors.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Gaetan Perrot d9e9f75bfc kernel: api: implement test for sys_slist_find
implement test for sys_slist_find

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-12 13:46:29 -04:00
Gaetan Perrot 8336d8b1e1 kernel: api: sys_slist find zephyrproject-rtos#65973
add a function to find a node in a slist.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-12 13:46:29 -04:00
Jamie McCrae 8ea1ca7355 boards: snps: nsim: Fix filenames
Fixes filenames of support files to match expected names

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-12 13:14:06 -04:00
Jamie McCrae 65d99da632 boards: snps: nsim: Fix board usage for filenames
Fixes an issue where the board name variable has changed in hwmv2

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-12 13:14:06 -04:00
Anas Nashif be60134421 west: add native_sim flash, debugserver command
Add 'west flash' support which in the case of native_sim just start the
built application.
Reuse existing runner and rename it to be more generic as it does more
than just debugging now.

Also add debugserver command.

Fixes #36706

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-12 12:57:18 -04:00
Yasushi SHOJI 98903d48c3 drivers: sensor: ams_as5600: Fix calculation of fractional part
The original calculation has two bugs. One is the calculated value, and the
other is that the value is not in one-millionth parts.

What the original calculation does is compute a scaled position value by
multiplying the raw sensor value (`dev_data->position`) by
`AS5600_FULL_ANGLE`, which represents a full rotation in degrees. It then
subtracts the product of the whole number of pulses (`val->val1`) and
`AS5600_PULSES_PER_REV` from this scaled position value.

    ((int32_t)dev_data->position * AS5600_FULL_ANGLE)
    - (val->val1 * AS5600_PULSES_PER_REV);

What you actually need is to extract the fractional part of the value by
taking the modulo of AS5600_PULSES_PER_REV from the scaled value of the
position.

   (((int32_t)dev_data->position * AS5600_FULL_ANGLE)
   % AS5600_PULSES_PER_REV)

Then convert the value to one-millionth part.

   * (AS5600_MILLION_UNIT / AS5600_PULSES_PER_REV);

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2024-03-12 16:08:17 +01:00
Erwan Gouriou caf4a29338 boards: stm32h573i_dk: Fix APB1 bus clock
240MHz as APB1 bus clock is too fast to set I2C base bus speed.
Set bus pre-scaler to 2 and reach a safe 120MHz.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-03-12 16:07:20 +01:00
Erwan Gouriou 749c0e41b9 boards: stm32h573i_dk: Enable I2C
Enable i2c1 on stm32h573i_dk (arduino_i2c).
Additionally provide a test configuration for i2c_target_api.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-03-12 16:07:20 +01:00
Erwan Gouriou 456183f982 boards: nucleo_h563zi: Fix APB1 bus clock
240MHz as APB1 bus clock is too fast to set I2C base bus speed.
Set bus pre-scaler to 2 and reach a safe 120MHz.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-03-12 16:07:20 +01:00
Erwan Gouriou 68616f23d8 boards: nucleo_h563zi: Enable I2C
Enable i2c1 on nucleo_h563zi (arduino_i2c).
Additionally provide a test configuration for i2c_target_api.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-03-12 16:07:20 +01:00
Fabio Baltieri fe2b03178a gpio: pcal64xxa: switch to 8 bit internal data automatically
Convert the internal uint16_t data of the driver to an internal type
that automatically switches from uint8_t to uint16_t depending on
whether any 16 bit device is present in the system or not. This shrinks
the internal structures by few bytes when the extra data is not needed.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-12 16:06:25 +01:00
Daniel DeGrasse dae5c29959 boards: nxp: lpcxpresso55s69: fix TF-M support
Fix TF-M support for lpcxpresso55s69 target. The following issues were
resolved:

- lpcxpresso55s69 ns defconfig did not explicitly disable
  CONFIG_TRUSTED_EXECUTION_SECURE (which is set in the secure cpu0
  defconfig file)
- CONFIG_TFM_BOARD was not being set correctly for the NS target

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-12 11:04:13 -04:00
Dat Nguyen Duy 9c500a8a82 drivers: mbox: fix build failures when userspace enabled
Fix build failures due to using wrong arguments when
calling the implementation functions

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2024-03-12 15:39:05 +01:00