Commit Graph

105273 Commits

Author SHA1 Message Date
Jukka Rissanen 606eeed8c9 tests: posix: headers: net: Add INADDR_BROADCAST definition
Add INADDR_BROADCAST definition and a test for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen f2d58c4e18 tests: posix: headers: net: Mark unicast/multicast hops supported
Both the IPV6_UNICAST_HOPS and IPV6_MULTICAST_HOPS are supported
so add tests for them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen 96795f0b6c tests: posix: headers: net: Add IPv6 join/leave group
The IPV6_JOIN/LEAVE_GROUP corresponds to IPV6_ADD/DROP_MEMBERSHIP
definitions so define the former and add tests for them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen 5216b52477 tests: posix: headers: net: Add check for in6addr_any variable
The in6addr_any is a global symbol that can be used when any
address (all zero bits) is being referenced.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen 8776ae316c tests: posix: headers: net: sin6_scope_id is supported
The Posix documentation uses sin6_scope_id for scope id and
we support that already.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
James Roy 9e5d4084b1 style: Inconsistent macro name changed
Fix incorrect header file pre-macro name in
'include/zephyr/devicetree.h'.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-16 13:44:12 -05:00
Emil Gydesen c32210b003 Bluetooth: Host: ID: Log resolve list conflicts
In case of conflicts when calling bt_id_find_conflict
there was no way to easily determine what conflicted.

This is a rare occurance, but has happened when testing
against PTS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 13:43:59 -05:00
Mark Inderhees 1993ea019b build: support newlines in syscall decls
Some auto formatters will wrap long lines of code and insert newlines
that are part of function decls outside of arguments. This change strips
out all newlines so syscall typename regex function as expected.

Signed-off-by: Mark Inderhees <markind@meta.com>
2024-11-16 13:43:51 -05:00
Yong Cong Sin 70abb6077d tests/benchmarks: latency_measure: add qemu_riscv_64_smp board
Add `qemu_riscv64/qemu_virt_riscv64/smp` to the list of
integration_platforms.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 13:38:37 -05:00
Marcin Niestroj 60dba52859 boards: st: nucleo_h533re: add arduino_{gpio,serial} supported tags
This allows to build samples by twister which depend on 'arduino_gpio'
and/or 'arduino_serial'.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-11-16 13:38:18 -05:00
Marcin Niestroj 79bc3d1de5 samples: dap: drop 'sample.dap.bulk.nrf'
'nrf52840dk/nrf52840' is already listed under "generic" 'sample.dap.bulk',
so keeping 'sample.dap.bulk.nrf' has no value. The only difference is
dependency on 'gpio' instead of 'arduino_gpio', but
'nrf52840dk_nrf52840.overlay' references arduino header gpios only.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-11-16 13:38:07 -05:00
Jilay Pandya 6a0d7351d5 drivers: sensor: fcx_mldx5 fix string_overflow issue
This commit fixes Copy into fixed size buffer (STRING_OVERFLOW) by checking
the cmd_data_len

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-16 13:38:00 -05:00
Djordje Nedic 5c4f7d9e82 soc: Fix missing mem.h include in stm32h562
This caused failed builds due to the missing DT_SIZE_K(x) macro.

Signed-off-by: Djordje Nedic <nedic.djordje2@gmail.com>
2024-11-16 13:37:52 -05:00
Jilay Pandya cebd1c78e8 drivers: sensor: emul_bmi160: fix cid 215232
This commit fixes the issue of Null pointer dereferencing

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-16 13:37:42 -05:00
Tarang Raval 532c775787 board: silabs: slstk3701a: add i2c2 node
Enable the I2C2 node on the EFM32GG11 SLSTK3701A board

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
2024-11-16 13:37:28 -05:00
Benedikt Schmidt 7918c921d5 drivers: fpga: always check state of CDONE during configuration of iCE40
Turn the assert into an if-statement to ensure that CDONE is always
checked during the configuration of an iCE40.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-16 13:37:16 -05:00
Juha Sunnari 51bc60e142 logging: frontends: stmesp: alternate message output option
Add an alternate message output option in which messages are
ended with an additional zero data byte with marker and timestamp.
Can be used to maintain compatibility with certain decoders.

Signed-off-by: Juha Sunnari <juha.sunnari@nordicsemi.no>
2024-11-16 13:37:02 -05:00
Alberto Escolar Piedras 84dc9a1721 lib/cpp: Remove deprecated CONFIG_CPP_STATIC_INIT_GNU
This option was replaced with CONFIG_STATIC_INIT_GNU
2 releases ago in 6e977ae2d5

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 13:36:37 -05:00
Fabio Baltieri 6342eff58b led: add a struct led_dt_spec and some _dt wrapper APIs
Add a struct led_dt_spec to hold an LED device and index pointer, some
initializer and wrapper APIs.

This allows simpler LED usage, such as:

static const struct led_dt_spec led = LED_DT_SPEC_GET(DT_NODELABEL(led0));
led_on_dt(&led);
led_off_dt(&led);

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-16 13:36:27 -05:00
Daniel DeGrasse 0ea212918f cmake: extensions: use INTERFACE_SOURCES as property for code relocation
In order to enable code relocation, we use a custom target
(code_data_relocation_target), and add files we wish to relocate, as
well as which sections should be relocated to the COMPILE_DEFINITIONS
property for the target.

This approach has been fragile, because COMPILE_DEFINITIONS can also be
added to for all targets using `add_definitions`. This means if another
part of the project uses `add_definitions` and
CONFIG_CODE_DATA_RELOCATION is on, a warning will appear about the
"file" not being found. The "file" of course, is just the definition
added by `add_definitions`.

To work around this, switch to overloading the INTERFACE_SOURCES
property. This property should be a bit more robust, because nobody else
will add sources to the code_data_relocation_target.

However, this approach has the downside that the CMake documentation
pstates targets created with `add_custom_target()` (which the
code_data_relocation_target is) do not have an INTERFACE scope for
their sources- so while this approach works, it is not officially
supported by CMake

Fixes #60220

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-16 13:35:36 -05:00
Martin Stumpf abc296ff65 drivers: display: display_sdl: implement display_show
Adds frame synchronization to every frame.
This prevents frame tearing.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Martin Stumpf 2e0687cfd2 generic: add `frame_incomplete` where missing
The newly introduced `frame_incomplete` flag of
`display_buffer_descriptor` needed to be added at several places to
avoid uninitialized memory.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Martin Stumpf 05bb8d9504 lvgl: add `frame_incomplete` information to `display_write`
In frames with multiple writes (officially supported through
`CONFIG_LV_Z_VDB_SIZE`) the display needs to be signalled that the
current frame is over and the content should be displayed.
This allows displays to present the UI without tearing artifacts.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Martin Stumpf 2bdffc6818 display: add `frame_incomplete` to `display_buffer_descriptor`
Introduces support for double-buffered/latched displays.
Currently, every write has to be presented to the user immediately,
which negates the advantage of latched displays to prevent frame tearing.

Now, GUI managers can indicate whether the current `display_write` call
is the last call of the frame or not, allowing displays to group writes
to a single present.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Jordan Yates 8b69b79279 tests: fuel_gauge: test negative current
Validate that the SBS fuel gauge driver returns the expected values for
negative currents (discharging).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-16 13:35:03 -05:00
Jordan Yates 8345775de0 fuel_gauge: sbs_gauge: fix negative currents
Fix negative currents being read as extremely high currents due to
unsigned variable use.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-16 13:35:03 -05:00
Yong Cong Sin 9c3482b1d5 arch: riscv: smp: allow other IPI implementation
The currently IPI implementation assumes that CLINT exists in the
system, however, that might not be the case as IPI can be implemented
with PLIC that supports software-triggering as well, such as the Andes
NCEPLIC100.

Refactor the CLINT-based IPI implementations into `ipi_clint.c`, and
create Kconfig that selects the CLINT implementation when
`sifive-clint0` exists and enabled, otherwise default to
`RISCV_SMP_IPI_CUSTOM` which allows OOT implementation. This also
makes way for the upstreaming of non-clint IPI implementation later.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-16 13:34:10 -05:00
Tarang Raval bb7319e7f2 drivers: sensor: ina219: remove redundant error check
The function ina219_set_msr_delay always returns zero, indicating success.
Therefore, the error check on its return value is unnecessary and can be
removed.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
2024-11-16 13:33:34 -05:00
Seppo Takalo b3f3bce23e net: lib: coap_client: Add API to cancel specific request
Add a new API to cancel just one, or mathing requests,
instead of cancelling all ongoing requests.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo f0c6efe798 net: lib: coap_client: Stop polling on unneeded sockets
poll() only for sockets that have traffic ongoing or have some lifetime
left.
On socket failures during a poll(), stop listening for the socket.
Application can recover by reconnecting the socket.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo f72d634826 net: lib: coap_client: All error cases should be reported to callback
When the client fails when parsing the response and we stop proceeding,
we should report that to the application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo c0eb260c2c net: lib: coap_client: Drop duplicate MID only after responding with Ack
Even if we receive duplicate confirmable message, we should still
respond with the Ack. Just don't deliver the second callback.

This is achieved by moving the MID deduplication to after Ack handling.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 48434a3c1b net: lib: coap_client: Return -errno from send_request()
Return the -errno when zsock_sendto() or zsock_recvfrom() fails, so
rest of the code can deal with return values, instead of separately
comparing errno and return value.


Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo a1368a7ff7 net: lib: coap_client: Drop duplicate responses
When response is already handled, don't forward anymore responses
to the client application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 934c74f26e net: lib: coap_client: Don't match zero length tokens
If our internal structure is cleared, don't match tokens.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 7b0cce4418 net: lib: coap_client: Parse incoming MID only once
Incomming Message-ID is already parsed, use it as a parameter to
get_request_with_mid().

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 41ee35ae8b net: lib: coap_client: Don't clear internal structures on response
When response is received and handled, don't just clear the structure
but instead mark it as ongoing=false.
So if we later on receive a duplicate response for it, we can still
respond with Ack or Rst.

This is achieved by using release_internal_request() when we don't
expect any response for it and reset_internal_request() when we really
fill up a new request.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 107dc9b96d tests: coap_client: Add testcase for receiving RST
When server responds with CoAP RESET, we should inform the
client and stop the request.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 05a6ba678e tests: coap_client: Add testcase for observation
Add test for ongoing observation and cancellation.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 237b26c44a tests: coap_client: Test for operating on socket while another fails
CoAP client should be able to push data through functioning socket
while another sockets is failing or reporting poll() errors.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo fc51fa491f tests: coap_client: Add testcase for Ack failure
Add testcase where sending Ack to incomming Confirmable message fails.
This should be reported to application as now the server is unaware
that transmission have succeeded, so we cannot thread it as success.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 5559a520c9 tests: coap_client: Improve retry testcases
Add testcases for testing client's retry behaviour.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 120aabbb8f tests: coap_client: Add test when separate response is lost
Test a scenario where Ack is received but the actual response
is not coming.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 83bc1fcb46 tests: coap_client: Add test for duplicate response
Add test where we receive same UDP packet twice.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo ca67f51170 tests: coap_client: Improve socket stubs
* Use sys_rand_get() and seed the CoAP library, so our MIDs are
  random.
* Set socket events per socket, so we don't accidentally receive
  on wrong socket
* Reply with correct tokens

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Daniel DeGrasse 0be5dcd25d arch: arm: add MPU definitions for all flash and SRAM region sizes
Add definitions for all possible flash and SRAM region sizes for ARMv7
MPU. Also, correct some of the SRAM size checks to use <= instead of ==,
to be consistent with the remainder of the file

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-16 13:33:15 -05:00
Declan Snyder 6d1a3bb36e boards: rd_rw612_bga: Move FCB in tree
Move the FCB to be in tree for this board instead of in the NXP HAL.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-16 13:32:48 -05:00
Maximilian Deubel 9bed2b7a98 scripts: logging: dictionary: Add support for size_t %z format specifier
This patch adds support for the size_t %z format specifier to the
dictionary parser.
It's the correct format to use for size_t types in modern C,
but it's not supported in python directly.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-11-16 13:32:22 -05:00
Nidhal BEN OTHMEN 92a7ddfb56 boards: st: Update nucleo_wba55cg dts file
Update nucleo_wba55cg dts file to use pinctrl dtsi file of WBA55
instead of WBA52.

Signed-off-by: Nidhal BEN OTHMEN <nidhal.benothmen@st.com>
2024-11-16 13:32:13 -05:00
Pieter De Gendt 175bfb4bc9 tests: net: lib: lwm2m: interop: Fix strip-with-multi-characters (B005)
All strip functions remove any of the provided characters instead of a
prefix/suffix. This is likely a bug.

See https://docs.astral.sh/ruff/rules/strip-with-multi-characters/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-16 13:32:02 -05:00