Commit Graph

85964 Commits

Author SHA1 Message Date
Benjamin Cabé 92045a021e doc: guidelines: Clarify how code-block directive should be used
Correct a previous mistake indicating syntax highlighting is
autoguessed.

Add recommendations and samples around languages that documentation
authors are encouraged to use.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 14:32:39 +02:00
Benjamin Cabé f2b080b5d6 doc: Set default language for syntax highlighting to "none"
Force code blocks with no 'language' explicitly set to render with no
highlighting. The current default was to use python (bad), and there
would also be an option to set it to "guess" but this doesn't work all
so well (ex. some C blocks would be detected as Transact-SQL!).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 14:32:39 +02:00
Benjamin Cabé 677219ff1a doc: Allow to control wrapping behavior per table
Backport a useful CSS rule from Godot that allows to have *all* cells of
a table to wrap. This can be useful for list-tables in particular,
where otherwise the first column don't wrap.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 14:32:39 +02:00
Jason Wright 7e02a0379f drivers: counter native: Add top value conf and multi channel support
The counter_native_posix driver currently does not support top value
configuration, i.e. `ctr_set_top_value` returns `-ENOTSUP`. This commit
adds support for top value configuration, and with the counter API now
fully implemented, adds `counter` to `supported` peripherals for
native_posix target.
It also resolves an existing bug in which the
counter ISR did not reset upon reaching `TOP_VALUE`.
And adds support for multiple channels

Signed-off-by: Jason Wright <jason@jpw.nyc>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 13:38:43 +02:00
Andy Sinclair 7cf4eff731 drivers: mfd: npm1300: Fixed race condition in event callback
If an event occurs between the status registers being read and
the event being cleared, the interrupt line will remain active.

As the interrupt is edge triggered,  all future interrupts
will being ignored.  This problem will also occur if an I2C
transation fails in the callback.

The state of the interrupt pin is now checked at the end of the
callback, and a retry is attempted if the interrupt has not
been cleared.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-10-23 12:55:04 +02:00
Andy Sinclair 733834851d drivers: mfd: npm1300: Added shiphold button release event
Added event for detecting release of shiphold button

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-10-23 12:55:04 +02:00
Alberto Escolar Piedras e1de306854 doc: samples nrf53_sync_rtc: Fix flash command
Fix the west flash command example using the new flash-args
option.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 12:54:31 +02:00
Alberto Escolar Piedras 8b84402444 doc: boards wio_terminal: Fix flash command
Fix the west flash command example using the new flash-args
option.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 12:54:31 +02:00
Alberto Escolar Piedras d0aec24e45 doc: boards adafruit_itsybitsy_m4_express: Fix flash command
Fix the west flash command example using the new flash-args
option.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 12:54:31 +02:00
Alberto Escolar Piedras 421693b574 doc: extend application sphinx extension to support flash arguments
Passing arguments to west flash is needed in many cases
but there was no way to properly generate documentation
with such examples.
With this new "flash-args" option we can now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 12:54:31 +02:00
Alberto Escolar Piedras 201a48889c doc: samples net mqtt_sn_publisher fix west invokation
Fix the west invokation. "-t" is added automatically
to the run goal, otherwise we get a "-t -t" command.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 12:54:31 +02:00
Yong Cong Sin 49d7910aa4 shell: Update doc to include MQTT transport
The Shell MQTT transport was added in #38107, but isn't
mentioned in the Shell documentation.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-23 12:38:54 +02:00
Rodrigo Peixoto 32bdb24a92 doc: zbus: fix VDED notification sequence figure
The figure and table related to the VDED notification sequence were wrong.
It fixes that by changing the image and adjusting the table content.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-10-23 12:37:08 +02:00
Benjamin Cabé 234df43912 doc: samples: expose JSON-LD markup & meta description for code samples
Since samples are starting to leverage the new :zephyr:code-sample
directive, let's use the available  meta data to expose that structured
information to search engines.

This commit adds JSON-LD markup to the HTML output of code sample pages
and sets the meta description to the samples' description.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 12:30:51 +02:00
Benjamin Cabé 15515f4c7e doc: samples: exclude CodeSample children during transformation
CodeSample node is meant to be a temporary node that's transformed into
standard docutils nodes. While the node might contain children useful
for the transformation, they're not meant to be included in the result
of the transform.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 12:30:51 +02:00
Jamie McCrae b032d0bc00 mgmt: mcumgr: grp: fs_mgmt: Select CRC if hash/checksum is enabled
Since CRC32 hash/checksum support is enabled by default, make it
select the CRC Kconfig symbol

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-10-23 12:15:41 +02:00
Jamie McCrae 8f5925c6de mgmt: mcumgr: Do not imply CRC
Only SMP over console transports need CRC support, therefore do
not imply CRC support for MCUmgr entirely because only 2 optional
transports require it

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-10-23 12:15:41 +02:00
Jamie McCrae a2b22cbe82 samples: mgmt: mcumgr: smp_svr: Select CRC for SMP over console
CRC support is needed for SMP over console support, therefore
enable it

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-10-23 12:15:41 +02:00
Jamie McCrae 0c1d968581 mgmt: mcumgr: transport: shell/uart: Require CRC to use
SMP over console uses a checksum, therefore it is required in order
to enable these transports

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-10-23 12:15:41 +02:00
Pedro Sousa 4207f4add8 kernel: timer: Fix race condition in k_timer_start
The documentation suggests that k_timer_start can be invoked from ISR
and preemptive contexts, however, an assertion failure occurs if one
k_timer_start call preempts another for the same timer instance. This
commit mitigates the issue by implementing a spinlock throughout the
k_timer_start function, ensuring thread-safety.

Fixes: #62908

Signed-off-by: Pedro Sousa <sousapedro596@gmail.com>
2023-10-23 12:10:06 +02:00
Tomasz Moń afc034e294 samples: cdc_acm: Throttle RX when ringbuf is full
Prevent infinite loop inside interrupt handler when there is incoming
data available and ring buffer is full.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-10-23 12:04:15 +02:00
Steffen Jahnke 26a403d629 boards: arm: Add PAN1783 evaluation board
The PAN1783 evaluation board is a development tool for the nRF5340
from Nordic Semiconductor.

Signed-off-by: Steffen Jahnke <steffen.jahnke@eu.panasonic.com>
2023-10-23 11:58:13 +02:00
Bjarki Arge Andreasen 99ce7d071f drivers: rtc: Add atmel sam series RTC driver
This commit adds an RTC device driver for the atmel SAM
series chips.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-23 10:49:11 +01:00
Bjarki Arge Andreasen f41ca50ef3 dts: atmel: Add rtc device to atmel sam dtsi
This commit adds the RTC device to the following
atmel sam devicetrees:
- sam3x.dtsi
- sam4e.dtsi
- sam4s.dtsi
- same70.dtsi

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-23 10:49:11 +01:00
Johann Fischer c152e0980c usb: device: cdc_acm: block in uart_poll_out() routine
According to the UART API documentation, implementation must block when
the transceiver is full. For CDC ACM UART, TX ringbuffer can be
considered as transceiver buffer/FIFO. Blocking when the USB subsystem
is not ready is considered highly undesirable behavior. Blocking may
also be undesirable when CDC ACM UART is used as a logging backend.

Change the behavior of CDC ACM poll out to:
 - Block if the TX ring buffer is full, hw_flow_control property is
   enabled, and called from a non-ISR context.
 - Do not block if the USB subsystem is not ready, poll out
   implementation is called from an ISR context, or hw_flow_control
   property is disabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-10-23 11:48:44 +02:00
Johann Fischer 9112c7e0ff usb: device: cdc_acm: restart OUT transfer in only configured state
When a usb_transfer is cancelled, the callback is finally invoked.
Silly, there is no transfer status passed, and in the callback we can
only check the size and device status.

Reported-by: Alex Kaiser
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-10-23 11:48:44 +02:00
Patryk Duda 3ec58ff749 libc/newlib: Add support for LLVM toolchain
When Zephyr is compiled using LLVM toolchain, we don't need to link with
libgcc to resolve libc dependencies. With this patch, the trick will be
applied only when the GNU compiler is used. Otherwise, we will just link
libc, which works for LLVM.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2023-10-23 11:41:57 +02:00
Lingutla Chandrasekhar 64aa25a8a4 RISCV: Support pm cpu ops for SMP
Add pm cpu ops to call the platform specific implementations for
bringing up secondary cores.

Signed-off-by: Lingutla Chandrasekhar <quic_lingutla@quicinc.com>
2023-10-23 11:36:01 +02:00
Flavio Ceolin b483c9251c drivers: adc: Fix misuse of const and k_tid_t
"const k_tid_t" is "struct k_thread * const" and not "const struct
k_thread *" as the code may be assuming. Just drop it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-23 11:35:33 +02:00
Benjamin Cabé 64058f8753 MAINTAINERS: add myself as maintainer for Samples
Adding myself as maintainer and Anas as collaborator on code samples,
for which an area already exists in Github

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 11:08:44 +02:00
Jukka Rissanen 4b41f9f246 net: wifi: Fix compile error when -Werror -Wextra are set
The warning which became error looks like this

error: type qualifiers ignored on function return type
                                [-Werror=ignored-qualifiers]
  219 | const char * const wifi_ps_txt(enum wifi_ps ps_name);

It is pointless to add a const qualifier to a return value.
So remove the const pointer to avoid this warning.

Fixes #64197

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 11:06:23 +02:00
Jamie McCrae e8bbb033ef mgmt: mcumgr: grp: img_mgmt: Fix erase returning unknown error
Fixes an issue whereby the erase function would return an unknown
error, which would happen when the slot was already erased.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-10-23 10:03:02 +01:00
Aleksander Wasaznik 9f42c92e26 Bluetooth: Host: Fix GATT Long Read for EATT
When EATT is established, the value returned from `bt_att_get_mtu` is
not useful to determine the ATT_MTU that applies to a ATT response. This
is because `bt_att_get_mtu` may return the value for a different bearer
than the request is serviced on.

To fix this, the params struct for the GATT read operation is given a
new field that will record the ATT_MTU that applies to this ATT
operation. This value is then used to determine if the GATT long read
operation is concluded.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/61741

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-10-23 11:01:21 +02:00
Jukka Rissanen 046f00244c net: shell: vlan: Enforce arg count via shell macro
Use the SHELL_CMD_ARG() to enforce the minimum parameter
count in vlan command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 4265fe7a93 net: shell: stats: Use generic iface idx dynamic completion
The interface number is generated automatically if one
presses <tab> when expecting the interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 10def6cac5 net: shell: Allow dynamic interface name expansion
Allow multiple commands use the same dynamic shell command
completion when expecting network interface index.

For example "net iface" and "net stats" are such commands.

The network interface expansion cannot be used in "net ipv6 add",
"net ipv4 add" and "net route" commands as they require more
data after the network interface index argument.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 5bad9680a5 net: shell: Remove the stacks command
The "net stacks" has been obsolete for a long time already
so remove it for good. It is replaced by "kernel stacks" cmd.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 34cd82e80b net: shell: Removing extra stuff that is not needed
The remaining stuff that is not used in net_shell.c can be removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen aab371364c net: shell: Add websocket command
Move "websocket" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen d84c2572ec net: shell: Add vlan command
Move "vlan" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 82a57b9789 net: shell: Add virtual command
Move "virtual" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 7a167648eb net: shell: Add udp command
Move "udp" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 5afeade2fc net: shell: Add tcp command
Move "tcp" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 7cdc235ff5 net: shell: Add suspend command
Move "suspend" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen fdb86e89a6 net: shell: Add stats command
Move "stats" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 76eab4e440 net: shell: Add stacks command
Move "stacks" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 8b4b064a85 net: shell: Add route command
Move "route" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen cb46113df4 net: shell: Add resume command
Move "resume" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen e5534b5262 net: shell: Add ppp command
Move "ppp" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Jukka Rissanen 58ad0a5c13 net: shell: Add pkt command
Move "pkt" command to a separate file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00