Commit graph

91628 commits

Author SHA1 Message Date
Ruibin Chang
19a23d5190 bbram: fix bbram dead code issue
Clear the whole 192 bytes of bbram, before writing the magic value to it.
test pass "west twister -cviG -T tests/drivers/bbram/".

Fixes #69119

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2024-02-29 11:53:45 +00:00
Lyle Zhu
b7b5cf4053 Bluetooth: Host: SDP: Fix endianness issue of tid
The transfer byte order of SDP is big-endian.

The transaction ID(tid) should be big-endian before
sending.

And tid needs to be converted to CPU byte order
after receiving.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-29 11:53:35 +00:00
Fabio Baltieri
3538335f5a input: add a pat912x driver
Add an initial input driver for the PixArt PAT9125EL, just core
functionalities for now, will add more configuration properties at a
later stage.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-02-29 11:53:20 +00:00
Fabio Baltieri
38b63e9e77 dts: bindings: vendor-prefixes: add pixart prefix
Add pixart binding prefix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-02-29 11:53:20 +00:00
Tom Burdick
01c5b8d6ac i2c: Last message in transfer implies STOP
The last message in an i2c_transfer msg array implies a STOP. This
documents the expected behavior of the i2c_transfer command a bit more
in that every i2c_transfer() call is expected to leave the bus in a
useful state for the next subsequent call to i2c_transfer().

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-02-29 11:53:12 +00:00
Phi Bang Nguyen
8967236756 drivers: video: sw_generator: Fix stream_start return value
The stream_start() callback needs to return 0 for success. However, to
indicate work has been successfully scheduled, k_work_schedule() could
return either 0 (already scheduled) or 1 (newly scheduled).

Due to this issue, the sw_generator could not start streaming. Fix it.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-02-29 11:52:58 +00:00
Phi Bang Nguyen
e1ade02b2b drivers: video: sw_generator: Run clang-format
Run clang-format on the file to fix indentation before making any changes

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-02-29 11:52:58 +00:00
Daniel DeGrasse
3d7b058358 include: mipi_dbi: fix initialization statement for SPI operation field
SPI configuration "operation" field is a bitmask of several
configuration settings for the SPI interface when using SPI controllers
with the MIPI DBI API. The initialization statement for this
configuration structure had a comma after the "duplex" property where a
binary or should be present. correct this issue

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-29 11:52:42 +00:00
Mike J. Chen
f55d281536 drivers: i3c: i3c_mcux: a number of improvements and bug fixes
The main improvement is that mcux_i3c_transfer() and
mcux_i3c_i2c_api_transfer() will try much harder to not return an error
that could be caused by the bus being busy. The bus could be busy because
of IBI handling, especially if there are multiple I3C devices all raising
IBI that need to be processed, which can involve a number of context
switches and delays and take considerable time such that an application
initiated I3C transfer request might have returned busy. Replaced the code
that polled for idle state with a timeout with an infinite loop on a
condvar. The condvar is broadcast to at the end of every stop, which should
be when the bus goes idle.

Details of other changes:

* Remove ibi_lock, which seemed not useful. Use the single lock (switched
  from semaphore to mutex so it can be released by condvar) for both IBI
  handling and application requests.

* Remove code that disables i3c controller interrupts during transfers.
  Since the only interrupt is SLVSTART, and that just posts a work, it
  didn't seem necessary to disable that interrupt.

* Don't clear SLVSTART interrupt in mcux_i3c_status_clear_all(), to prevent
  any application transfers from accidentally clearing the SLVSTART
  interrupt or the handling of one IBI clearing the START initiated by
  another I3C device immeidately as the other one finishes.
  The only clearing of SLVSTART is in the isr.

* Add back a wait in mcux_i3c_request_auto_ibi(), otherwise the ibitype
  could be 0 if the processor is faster than the auto ibi handling.
  An earlier change removed a wait for MCTRLDONE, which isn't
  always set when AUTO_IBI is requested, but that could mean we try to
  read the ibitype before it's ready. Waiting for IBIWON instead should be
  correct and better, since the AUTO_IBI should result in IBIWON status bit
  being set (and MCTRLDONE being set would not guarantee that IBIWON was
  set).

* Change mcux_i3c_request_emit_stop() to still wait for idle if requested,
  even if the STOP wasn't actually issued, and add the release of the new
  condvar

* Change mcux_i3c_do_one_xfer_read() to handle the IBI use case differently
  than the regular application requested transfer case. In the application
  requested transfer case, the rx_len is known and set in RDTERM, so we
  could check for the COMPLETE status bit, but for IBI transfers, we
  just do a read to the payload buffer without knowing how many bytes
  the target may send us so never get a COMPLETE. Rather than check for a
  COMPLETE bit that might never occur, just have both cases read until we
  either read all requested bytes or we get a timeout error. But for the
  timeout error, if it's IBI and non-zero bytes were received, return
  the bytes received instead of an error.

* Change mcux_i3c_do_one_xfer() to return the error returned by
  mcux_i3c_do_one_xfer_read/write().

* Remove spurious return -EIO from end of mcux_i3c_do_daa()

* Change mcux_i3c_ibi_enable() to restore SLVSTART on error, and
  add some LOG_ERR() messages for error cases. Also add check to
  make sure idx is valid since there is a limit to how many IBI
  this controller can support.

* Change mcux_i3c_ibi_disable() to always reenable SLVSTART interrupt,
  even if the CCC to tell the target to disable IBI events fails.

* Change mcux_i3c_isr() to reenable SLVSTART interrupt if the
  work_enqueue() fails.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2024-02-29 11:52:34 +00:00
Christopher Friedt
d8072a9492 tests: posix: add a compile-and-run-only test for syslog
Ensure that we have code coverage for syslog and that it
can compiles and run with regular tests.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-29 02:45:01 -05:00
Christopher Friedt
3593720080 posix: syslog: add support for syslog
This is just a simple wrapper around Zephyr's native log api.

Note: the standard LOG_ERR syslog priority does conflict with
Zephyr's LOG_ERR() macro. This will need to be worked-around on
a case-by-case basis.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-29 02:45:01 -05:00
Yves Vandervennet
4f34a410fa scripts: ci: check_compliance: fix split on ":" for Windows
The method get_kconfig_dts() relies on str's split() to split
lines into fields separated by ':'. The second field is an
absolute path to a file.
On Windows, an absolute path includes a drive's letter followed
by ':' which breaks the current code.
On Linux, although rare, a file or directory name may also include
':', which would also break the code.

The fix is to constraint the number of splits to 1.
The code then becomes:

 _,b = line.split(":", 1)

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-02-28 22:11:16 -05:00
Jordan Yates
bb27f0578b bluetooth: hci: spi: 0xFF is a valid payload length
A payload size of 0xFF is valid and should not be a reason to keep
looping for more headers. The complete reqiurement is now:
```
header_slave[STATUS_HEADER_READY] == READY_NOW &&
header_slave[STATUS_HEADER_TOREAD] > 0
```
This fixes events being dropped when the payload size is 255.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-02-28 19:47:55 -06:00
Pieter De Gendt
408babb00f tests: net: iface: Test foreach multicast helper functions
Add test cases for IPv4/IPv6 foreach functions that iterate all
multicast addresses assigned to an interface.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-02-28 13:18:06 -06:00
Pieter De Gendt
d9d710e6d3 net: ip: Add iface IPv4/IPv6 multicast foreach handlers
Add helper functions to iterate IPv4/IPv6 multicast addresses.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-02-28 13:18:06 -06:00
Daniel Leung
7c80746bc6 tests: kernel: use TC_END_REPORT for faults
Use TC_END_REPORT() to report "PROJECT EXECUTION FAILED"
instead of a call to printk() for ZTEST enabled tests. as
this prints the failed message as well as the RunID (and
whatever will be added in future).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-02-28 13:39:15 -05:00
Jukka Rissanen
4323bfe71c doc: net: Update NAT options for Internet connectivity
The host NAT options for QEMU/native_sim Internet connectivity
needs updating.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-28 18:04:25 +00:00
Fin Maaß
bcf90edd1f net: config: use dhcpv4 option for sntp
Allow the use of the NTP server address, set by
dhcpv4 option, by the net_init_clock_via_sntp function.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-02-28 18:03:53 +00:00
Fin Maaß
3be6557078 net: dhcpv4: set sntp ip via option
Adds the option to set the ntp address ip via
dhcpv4 option 42 (Network Time Protocol Servers).

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-02-28 18:03:53 +00:00
Fin Maaß
2140a4af6a net: lib: sntp_simple: add a function to use with ip address
This adds a function to use sntp_simple with a
ip address directly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-02-28 18:03:53 +00:00
Fin Maaß
78813fa3ad net: ip: add function to set default port
This adds a function, to set the default port
of a sockaddr, if the port had not been set.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-02-28 18:03:53 +00:00
Robert Lubos
b920793e9b tests: net: sockets: tls: Add test verifying send() after close
Add test case verifying that send() returns an error when called after
TLS session has been closed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-02-28 18:03:40 +00:00
Robert Lubos
dc52b20705 net: sockets: tls: Return an error on send() after session is closed
It was an overlook to return 0 on TLS send() call, after detecting that
TLS session has been closed by peer, such a behavior is only valid for
recv(). Instead, an error should be returned.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-02-28 18:03:40 +00:00
Marcin Niestroj
a6b06004c2 drivers: wifi: esp_at: handle commas in SSIDs during scan and status
SSIDs can contains commas (,) when receiving scan results (+CWLAP) or
status (+CWJAP) over AT command from ESP-AT chip. This is in conflict with
modem subsystem argument parsing, which separates arguments automatically
whenever comma is encountered.

Use a direct modem command parsing, so that commas within quoted strings
are taken into account to be part of that string, instead of being treated
as delimiter.

This solves `wifi scan` and `wifi status` Zephyr shell commands output, for
networks containing commas (like "My_2,4GHz_AP") as part of SSID.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-02-28 18:02:44 +00:00
Marcin Niestroj
de30757d21 drivers: wifi: esp_at: escape SSID and PSK
According to [1], SSID and PSK need to be escaped:

  Escape character syntax is needed if SSID or password contains any
  special characters, such as , or " or \

Implement character escaping to fix connection attempt to WiFi APs
containing special characters as part of SSID, like "My_2,4GHz_AP".
Increase "connect command" buffer length to handle worst-case scenario of
all the SSID and PSK characters being special characters.

[1] https://docs.espressif.com/projects/esp-at/en/release-v2.4.0.0/esp32/AT_Command_Set/Wi-Fi_AT_Commands.html#id6

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-02-28 18:02:44 +00:00
Jukka Rissanen
28a46c0f60 net: http: client: Return error if waiting timeout
Return error to the caller if no data was received or there
was some other error. Earlier we did not check the error
condition properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-28 18:02:34 +00:00
Emil Gydesen
9d90e65167 Bluetooth: BAP: Shell: Add bcode support for cmd_sync_broadcast
The cmd_sync_broadcast command now also takes an optional broadcast
code, to support syncing with encrypted broadcasts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-28 18:02:27 +00:00
Tomi Fontanilles
c7c4c80fff modem: pipe: add warning to synchronous pipe open/close functions
This might be useful to those not familiar with how they work.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-28 18:02:17 +00:00
Tomi Fontanilles
a6b710fce3 modem: chat: fix init assert
Use the proper variable.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-28 18:02:17 +00:00
Tomi Fontanilles
90f1ed6a81 modem: cmux: improve handling of receive buffer overrun
This allows to properly drop single CMUX frames that are
too big to fit in the receive buffer, keeping track of
where they end so that following frames are received
correctly regardless of the data contents.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-28 18:02:17 +00:00
Tomi Fontanilles
bc64c91d62 modem: backend: uart_async: improve logging on UART_TX_ABORTED
Only log if the abort is not self-triggered,
and also print the number of bytes sent.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-28 18:02:17 +00:00
Tomi Fontanilles
11f22bf702 modem: ppp: fix receiving of successive frames when one 0x7E is omitted
The SOF delimiter byte may be omitted when a frame follows another
that just ended with that byte.
The parsing used to expect that second delimiter anyway,
which resulted in PPP frames going missing.

As an additional improvement, dropped bytes as well as the length
of received frames are now (debug) logged.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-28 18:02:17 +00:00
Tomi Fontanilles
6aef9d4d9a modem: ppp: fix crash when attaching to a pipe
modem_pipe_attach() can send events before returning, which could
provoke a crash as ppp->pipe, still NULL at that time, could be
used either in receiving (if the pipe had some data pending) or
in sending (if the PPP module had already been attached and had
some data to send in its transmit buffer).

ppp->pipe is now set before modem_pipe_attach().
Also, the ATTACHED_BIT is now set only after having actually attached.
And finally, the send_work is now scheduled on PIPE_EVENT_OPENED
so that data is flushed when the (closed) attached pipe is opened.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-28 18:02:17 +00:00
Tomi Fontanilles
5fc02e3501 modem: backends: use CONFIG_MODEM_MODULES_LOG_LEVEL
This makes the modem backends use the log level
set for the modem modules instead of the default one.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-28 18:02:17 +00:00
Maciej Kusio
352b50bfc9 xtensa: add support for cores without NMI
Some Xtensa cores do not support NMI, so XCHAL_HAVE_NMI=0 and
XCHAL_NMILEVEL won't be defined at all causing
arch/xtensa/include/xtensa-asm2-s.h to throw compilation error.

Fixes: #67855

Signed-off-by: Maciej Kusio <maciejkusio@meta.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-28 17:35:54 +00:00
Andrew Thompson
88d4c1a5fd doc: gsg: add wget as macOS required package
wget is required for installing Zephyr SDK on macOS.
Add this to the homebrew install command as a dependency.

Signed-off-by: Andrew Thompson <andrew@clone.co.nz>
2024-02-28 12:19:10 -05:00
Benedikt Schmidt
9db19dd5a6 tests: drivers: build_all: gpio: fix I2C addresses
Iterate through I2C addresses in devicetree overlay
for build_all/gpio to avoid conflicts.

Fixes #69551

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-02-28 17:08:49 +01:00
Fabio Baltieri
906724fb99 input: increase default stack size to 1024
The default 512 bytes stack size is a bit tight for some architecture
and leads to samples running out of stack. Let's default to 1024 and let
the user tweak it down if necessary.

Suggested-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-02-28 07:45:28 -06:00
John Johnson
c13930791d drivers: entropy: stm32: fix missing rng in function call
Replace rng to dev_data->rng in call to LL_RNG_SetHealthConfig.

Signed-off-by: John Johnson <john.filip.johnson@gmail.com>
2024-02-28 07:44:41 -06:00
Mykola Kvach
ff8c8923ae drivers: clock_control: r8a779f0: add clocks related to MMC
Add the possibility to configure clocks related to MMC.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-02-28 12:38:23 +01:00
Jukka Rissanen
1df8aaeec2 net: ipv6: Allow user to configure the IPv6 MTU size
This makes it possible to set the minimum IPv6 packet size that
can be sent without fragmentation. The default value is 1280 bytes.
This commit allows user to set the IPv6 MTU value within reasonable
limits [1280, 1500].

Fixes #61587

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-28 09:41:53 +01:00
Jukka Rissanen
4b82b108c8 net: zperf: Select also sockets API in Kconfig
We select sockets service API in Kconfig but should select also
sockets API so that user does not need to set the sockets API separately.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-28 09:40:41 +01:00
Jukka Rissanen
bdfcc753c8 net: shell: Print mgmt socket information properly
The "net sockets" command did not print network management
socket information properly but claimed that the socket
was IPv4 one which it is not.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-28 09:39:27 +01:00
Jukka Rissanen
afa4b4ad1d net: socket: mgmt: Return error for poll
The net_mgmt socket does not support poll() or fcntl(), so
return EOPNOTSUPP error if user tries to use those functions
for AF_NET_MGMT type socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-28 09:39:27 +01:00
Kamil Gawor
edf80447c9 bindings: net: nfct: Utilize EasyDMA property
This adds additional memory region property
to NFCT peripheral. This is not mandatory
property, it adds possibility to user to
specify memory region for DMA transfer.
If it is not set then data buffer is placed
in default RAM with other data.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
Signed-off-by: Dominik Chat <dominik.chat@nordicsemi.no>
2024-02-28 09:38:39 +01:00
Daniel Leung
9fda7a3234 sysbuild: typo s/guranteed/guaranteed/
Simply added the missing 'a' in guaranteed. Found this
when I was too lazy to search for the correct spelling
and was hoping to just grep for it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-02-27 22:25:38 -05:00
Jason Hutchinson
650a59479c doc: kernel: services: mailboxes: remove extra '.'
removed extra period after 'k_mbox_data_get()'

Signed-off-by: Jason Hutchinson <Jason_Hutchinson@Outlook.com>
2024-02-27 19:15:27 -05:00
Vinayak Kariappa Chettimada
7bd2804c24 Bluetooth: Controller: Build vendor LLL as library
Build vendor LLL as separate library so that independent
compiler flags can be supplied if required.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-27 16:27:55 -06:00
Henrik Brix Andersen
f1011b3c82 scripts: ci: check_compliance: skip kconfig check in vulnerabilities.rst
Skip doc/security/vulnerabilities.rst when checking for undefined Kconfig
symbols as older vulnerabilities can contain references to removed Kconfig
symbols.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-27 15:23:54 -05:00
Brian Juel Folkmann
2580b5af77 stm32: flash: ospi: Make erase function less chatty
Change LOG_INF to LOG_DBG in flash erase command

Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
2024-02-27 18:43:32 +01:00