Systems that enabled this option don't have their stacks in coherent
memory. Given our pipe_buf_spec is stored on the stack, and readers may
also have their destination buffer on their stack too, it is not worth
going to the trouble of supporting direct-to-readers copy with them.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
We are waking up threads but failed to let them run if they are
higher priority. Add missing calls to z_reschedule().
Also wake up all pending writers as we don't know how many there might
be. It is more efficient to wake them all when the ring buffer is full
before reading from it rather than waking them one by one whenever there is
more room in it.
Thanks to Peter Mitsis for noticing those issues.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
If there are pending readers, it is best to perform a single data copy
directly into their final destination buffer rather than doing one copy
into the ring buffer just to immediately copy the same data out of it.
Incidentally, this allows for supporting pipes with no ring buffer at all.
The pipe implementation being deprecated has a similar capability so better
have it here too.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Dispense with the call to sys_timepoint_expired() by leveraging
swap_retval to distinguish between notifications and timeouts when
z_pend_curr() returns.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Simplify the logic, avoid repeated conditionals, avoid superfluous
scheduler calls, make the code more efficient and easier to read.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Change:
commit cc6317d7ac
Author: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Date: Fri Nov 1 14:03:32 2019 +0200
kernel: poll: Allow 0 event input
Allows `k_poll` to be user with 0 events, which is useful for allowing just
a sleep without having to create artificial events.
Allow the same for `k_work_submit_to_queue()` and `k_work_submit()`.
Signed-off-by: David Brown <david.brown@linaro.org>
add migration guide for following renamed variables
- ``en_spreadcycle`` to ``en-spreadcycle``
- ``i_scale_analog`` to ``i-scale-analog``
- ``index_optw``to ``index-otpw```
- ``ìndex_step`` to ``index-step``
- ``internal_rsense`` to ``internal-rsense``
- ``lock_gconf`` to ``lock-gconf``
- ``mstep_reg_select`` to ``mstep-reg-select``
- ``pdn_disable`` to ``pdn-disable``
- ``poscmp_enable`` to ``poscmp-enable``
- ``test_mode`` to ``test-mode``
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
The actual manifest is 1024 bytes, but we previously had padding bytes
due to the implementation of SECTION_FUNC(). The manifest is not
executable code so SECTION_VAR() is appropriate and produces a section of
the appropriate size.
Fixes: #82822
Signed-off-by: Shawn Nematbakhsh <shawn@rivosinc.com>
Currently various zbus functions silently change the timeout
to zero when inside an ISR. If a developer is not aware
of this it could lead to unexpected behaviour or a
publish/read failing.
Also in the zbus docs it states to only use a timeout of
zero when inside a ISR multiple times.
Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
Empty code was incorrectly matched as a request, fix that.
Align coap_handle_request_len() function to behave as documented in the
API documentation - in case of invalid request code (which is also the
case for empty code) -ENOTSUP Should be returned.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The algorithm for matching request with response was incorrect, which
could lead to false matches (for example if request had a token, and
piggybacked reply had no token but matching message ID only, that would
still be counted as a match).
This commit fixes it. The request/reply matching is implemented based on
RFC now, with separate conditions for piggybacked/separate responses.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add test case for matching pending replies with received responses.
Cover corner cases that are failing with the current implementation.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Remove the build assert from NET_L3_REGISTER() macro as that
is causing an issue with llvm. Add runtime check of the handler
pointer value.
subsys/net/l2/ethernet/arp.c:1044:1: error: static_assert expression
is not an integral constant expression
ETH_NET_L3_REGISTER(ARP, NET_ETH_PTYPE_ARP, arp_recv);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/net_core.h:190:2: note: expanded from
macro 'NET_L3_REGISTER'
BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/toolchain/gcc.h:87:51: note: expanded from
macro 'BUILD_ASSERT'
define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
^~~~~~
subsys/net/l2/ethernet/arp.c:1044:1: note: cast from 'void *' is not
allowed in a constant expression
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
^
include/zephyr/net/net_core.h:190:29: note: expanded from
macro 'NET_L3_REGISTER'
BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
^
/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded
from macro 'NULL'
define NULL ((void*)0)
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Trust that the protocol type is set correctly by functions
called before this one. We should not set the protocol type
blindly in this generic function.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The ARP code has set the protocol type of the packet to
0x806, so do not change it when preparing to send to 0x800
which is the IP protocol type. Lets trust the previously
called functions to set the ptype correctly and do not set
it here.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
It was incorrectly introduced earlier and not really needed
because the test will pass without it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print more data / debug information for ARP messages.
Also remove unnecessary "&" when printing IPv4 address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The work in Ethernet send in commit 2f10d7d816
("net: ethernet: Set the ptype by the caller in send")
introduced a bug because we could try to do ARP resolving
for ARP packets too. This is clearly a wrong thing to do.
So before trying to do ARP resolving, make sure the the
packet type is IP packet.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Fix reset of drift_skip count when an anchor point sync was
missed so that drift compensation is applied on the next
successful anchor point sync. This will improve connection
stability for short overlapping radio event intervals.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In order to allow a custom disk name same as with the standard
sdmmc driver an additional device-tree property was introduced.
Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
Split the USART driver into separate implementations for Silabs Series 2
and Series 0/1 boards. This change improves maintainability (especially
with the support of pin-ctrl and clock-ctrl on series 2 boards).
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Add the nucleo_wba55cg board, which implements continuous transfer
with GPDMA and a linked list.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
Currently, when disabling CONFIG_MODBUS_FP_EXTENSIONS,return variable
'err' is not initialized (at least not for debug builds) but later on
checked.
Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
uart_irq_callback_user_data_set return non-zero if the callback function
can't be set. This might happen if you forgot to enable
CONFIG_UART_INTERRUPT_DRIVEN.
Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
Updated the README for the LoRaWAN Class A example to explain limitations
when running multiple times. Provided guidance to resolve the issue.
Signed-off-by: Flavio Felder <felf@zhaw.ch>
Sets LinkServer as the default runner for the mimxrt1180-evk board,
as the board is configured for CMSIS-DAP by default.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
DMA transfers are supposed to write to buffer tail. Use the proper
pointer to make multipart DMA transfers actually write the data to the
intended location.
The issue was observed on control write transfers where the OUT Data
Stage was at least 128 bytes (because endpoint 0 transfer width is
limited to 7 bits).
The issue is unlikely to happen on non-control transfers because the
transfer size width is at least 11 bits (at most 19 bits) and packet
size counter is at least 4 bits (at most: 10 bits) which means that
at least 2048 byte transfer spanning at least 15 packets (or at least
524288 byte spanning 1023 packets for 19 bits transfer size counter
and 10 bits packet counter) is required to necessitate multipart DMA.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Prepare buffer to receive SETUP data on OUT endpoint 0 after endpoint
halt. This solves the issue where the device would no longer process any
control transfers after the first failed transfer with too large OUT
Data Stage (when processing failed due to data stage buffer allocation
failure).
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The DOEPTSIZ0 XferSize field is 7 bits long, meaning that maximum single
transfer can be 127 bytes long. Configure the control write (OUT)
transfers considering the XferSize field size to support transfers with
data stage larger than 127 bytes.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Since some platforms may have some lpuart that are wrapped in lpflexcomm
and some that are not, then change the init code to determine how to
connect the interrupt on an instance basis.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Determine if lpflexcomm wrapped lpi2c by instance and connect
irq differently dependending on that to support platforms with
both flexcomm wrapped and unwrapped lpi2c's.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Determine proper irq setup depending whether the spi is wrapped in an
lpflexcomm or not on an instance basis since some platforms have some
wrapped and some not.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The tests for settings will not work properly with just provided config
file for mimxrt1020:
west build -p always -b mimxrt1020_evk samples/subsys/settings
as there the settings_save_one() would return -2 (-ENOENT) as by default
the CONFIG_SETTINGS_NONE is defined for mimxrt1020 configuration.
For proper operation (i.e. to have a memory medium to store settings
values) the NVS backend needs to be enabled.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Add the appropriate mass erase command for STM32 SoC families.
Family to command mapping taken from:
https://openocd.org/doc/html/Flash-Commands.html
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add support for the `--erase` option on `west flash`, for boards that
specify at least one `--cmd-erase` option.
Signed-off-by: Jordan Yates <jordan@embeint.com>
CONFIG_UDC_BUF_FORCE_NOCACHE depend on NOCACHE_MEMORY && DCACHE in Kconfig,
so it can only be true when the platform supports cache.
The controller driver can imply the value of CONFIG_UDC_BUF_FORCE_NOCACHE,
like UDC_NXP_EHCI. If CONFIG_UDC_BUF_FORCE_NOCACHE is true, then all the
usb transfer buffer should be in noncache section.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
In order to show how to use OpenThread and CoAP, add an application.
This example could be build to run a client or server.
The server could expose LEDs and buttons and client could get their
state and set the LEDs state.
The network is created automatically using the network key predefined
in the config. The goal is to make the example simple by removing
the commisionning and joinning process.
If a client application has a button, it could use it to toggle the first
LED on any boards running the server application.
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>