If getting the conn info of an ISO channel, the ISO channel may
not yet have an ACL connection, so we cannot get the
ACL source and destination addresses from the ACL.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Change message to make allow distinguishing between error while
getting page info for disk configuration and page layout
verification.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Increase main stack size for next USB device stack config to prevent
stack overflow when FatFs is used. The new main stack size value matches
the value used in old stack mass storage sample config.
Fixes: #55210
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Microchip XEC devices specify GPIO pin using octal numbering and
organize pins in banks of 32. Chip documentation does not use
bank naming rather naming each pin by its octal number. This has
led to the developer having to calculate the bit position of a pin
in its 32-bit bank when a specifying the pin for GPIO usage. We
created a set of defines for all possible GPIO pins that specify
the DT GPIO bank name used in the chip level DTSI files and the
bit position in that bank.
Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
Using `struct shell *shell` would be more consistent but triggers CI
check on MISRA rule 5.7 "A Tag name shall be a unique identifier"
Signed-off-by: Simon Frank <simon.frank@lohmega.com>
Font kerning was used but it was not possible to change it.
Also, font_idx was set to zero twice in init.
Signed-off-by: Simon Frank <simon.frank@lohmega.com>
Track LBA rather than byte offset in order to simplify the code and
support devices larger than 4GiB.
Signed-off-by: JP Sugarbroad <jpsugar@amazon.com>
This demonstates how to use the TI K3 pincrtl driver.
Previously UART0 only worked becuase U-Boot leaves it configured
Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
Fix Extended Scanning support for BT_CTLR_LOW_LAT variant
of the Controller implementation by closing the scan window
for every ADV_EXT_IND PDU received that that ULL_LOW context
is enabled back and ticker job can process the request to
start auxiliary PDU reception. Without the change the
ticker job would only run at the end of the scan window that
caused the auxiliary scan prepare to assert due to delayed
ticker timeout expiry callback.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When running the testcase libraries.hash_map.newlib.cxx_unordered_map.djb2
of this samples/basic/hash_map, it appears that some platforms
have a too low stack size.
This PR is increasing that value to pass the testcase.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Description of the bad behaviour before this change:
The arming of the control EP0_OUT endpoint was not kept under
control. It could happen that the EP0_OUT endpoint was left
armed, after the completion of a complete control transfer.
It is clear that the intention was to NOT keep EP0_OUT constantly
armed while idle, because usb_dc_ep_enable() doesn't arm it,
and the intention was for when usb_dc_ep_read() is called to
collect the Setup-Stage 8-byte data, that is when EP0_OUT is armed,
and before this call is performed, the host will keep getting NAKs
for the Data-Stage of the to_device control transfer.
This happens correctly on the first to_device control transfer with
wLength > 0. However, because usb_dc_ep_read_continue() indiscriminately
re-arms all OUT endpoints, in the case of to_device control transfers
with wLength > 0, on the Data-Stage, the endpoint is also re-armed,
which is wrong, because then the endpoint will be left armed after
the control transfer is over.
In this case when a new to_device control transfer starts, the
Data-Stage will be accepted on the first try. This would still
have worked without a failure if the Setup-Stage would have been
processed immediately, but because we process everything in a work
queue at a later time, when the Setup-Stage associated 8-byte data
buffer is read both the Setup-Stage and Data-Stage have arrived.
At the end of handling the Setup-Stage we try to re-arm the EP0_OUT,
which already contains data, thereby corrupting the received length
portion of the buf_ctl register. (Obviously other fields are changed
too, but the length field is the one that first causes chaos, cause
it's written to the maximum, which is 64.) The above mentioned Data-Stage
already has a message in its workqueue for it to be processed, but
it is picked up only after the length field has been corrupted.
Because of this usb_dc_ep_read() thinks there is more data in the buffer
than there really is, and everything becomes de-synchronized, with
later reads accessing uninitialized parts of the buffer.
This sounds like a fundamental failure, that should make it impossible
to operate USB, however the reason this behaviour doesn't make it
impossible to enumerate the device is that this only affects
to_device control transfers with wLength > 0, and during enumeration
there are not many of those happening.
When enumerating a HID keyboard, there is only _one_ of those
happening, and it is the initial setting of the lock light led status.
And that first one succeeds because it's the first one. (However, later
lock light setting control transfers can cause problems, which is how
this problem was encountered.)
The solution in this commit is to keep better control over when EP0_OUT
is armed. This forces the Data-Stage to arrive later (the host will keep
re-trying), and that way the corruption of the buffer control register
is avoided.
Summary of the changes:
- Rework the logic around deciding wether to re-arm the out endpoint
after a read. For non-0 endpoint the previous behaviour is kept,
however for EP0 it is only re-armed if more OUT transactions are
expected for that SETUP transfer (be it data-stage or status-stage)
- Force un-arm the EP0_OUT endpoint in case a stall condition is observed.
- When a setup transfer is received check if EP0_OUT is already armed.
If armed then log a warning message, and force-disarm it.
- When a setup req interrupt fires, don't immediately force the next
read to get it, instead, it will be read only after a setup message
is extracted from the message queue.
- When a setup packet is received abort any unfinished previous control
transfers:
- cancel any data buffers given to the EP0_IN endpoint
- drop any new ep0_in writes that are attempted before this newest
setup packet's associated message is extracted from the message
queue.
- In the ISR, check buffer interrupts before setup req interrupts.
This is to make sure that the final 0-length status message from the
previous setup packet is consumed before the new setup packet.
(this is the only case now when both interrupts could be seen as
having fired by the time the interrupt handler routine executes.
Signed-off-by: Purdea Andrei <andrei@purdea.ro>
Co-authored-by: Johann Fischer
LPC55S69 flash requires all writes be in multiples of 512 byte blocks.
Configure littleFS sample for these requirements when building targeting
the LPCXpresso55s69 EVK.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Move the volume controller test steps into smaller functions for more
reusability and easier to expand with invalid test steps.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the volume renderer test steps into smaller functions for more
reusability and easier to expand with invalid test steps.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The pwm_mchp_xec driver doesn't clear the divisor or clock select fields
of the config register value before writing it back. If the register
was previously written, the new values were being logically OR'd with
the prior values.
Signed-off-by: Jeff Daly <jeffd@silicom-usa.com>
The number of connections for the tx_buffer_alloc needs to be at least 3
For one of the tests it was set to default 1, which leads to unspecified
behaviour.
This is fixed by setting the maximum nr. of connections to 4
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Packet handlers registered with net_conn API should not use NET_CONTINUE
to report packet processing status. As they register for a specific
local port, it cannot be assumed someone else will handle the packet,
and for net_conn this status is not really handled differently from
NET_OK. Therefore, reporting NET_CONTINUE, and not freeing the packet,
can result in a packet leak.
Too short packets should not really be handled differently from other
malformed packets in DHCPv4 module, therefore report NET_DROP instead of
NET_CONTINUE.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
If waiting on the first semaphore in the main loop times out, the main
loop starts from the beginning and attempts to start scanning for
broadcast sources. But since the first semaphore was not passed, the
scan_recv_cb callback was not called yet and thus the previously started
scanning was not stopped. As a result, an attempt to start the scanning
will fail with -EALREADY and the main thread will end. To solve this,
-EALREADY is now ignored when checking the return value of
bt_audio_broadcast_sink_scan_start.
Signed-off-by: Ladislav Podivin <ladislav.podivin@tietoevry.com>
This is a bugfix. It uses the right storage label `slot0_partition` for
esp32s2. Note that this is already the case for esp32 and esp32s3.
This should address
https://github.com/zephyrproject-rtos/zephyr/issues/55286.
Signed-off-by: Ning Shang <syncom.dev@gmail.com>
Adds REQUIRED to samples and tests for finding the zephyr package
to align all samples and tests with the same call and parameters.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
With BT_GATT_SUBSCRIBE_FLAG_NO_RESUB the MCC subscriptions would
be resent to the server on reconnection. Since this may trigger an
error, the error will trigger a call to the MCC discover complete
callback.
For MCP We can assume that the server stores the subscriptions if
we are bonded, and thus we can use BT_GATT_SUBSCRIBE_FLAG_NO_RESUB.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This board's documentation states the current configuration supports
Ethernet. However, the mac node was not enabled in devicetree.
This commit enables the mac node in devicetree.
Signed-off-by: Ben Marsh <ben.marsh@helvar.com>
This is a follow-up to commit fe3b97a87f.
This message should not be a warning, as it does not actually indicate
that something potentially bad happened. On the contrary, it informs
that conditions in which the anomaly 160 could occur were detected and
the anomaly was prevented from occurring. There is no need for this
message to appear in the default configuration (INFO level). In fact,
the message would undesirably flood the console in some cases (like
the kernel/mem_protect/stack_random test) and sometimes it would also
require enlarging the stack of the idle thread (the function is called
underneath k_cpu_idle()). Therefore, the logging level of this message
is changed to DEBUG.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
* ensure Thrift documents are globbed in `modules/index.rst`
* add a "What is Thrift?" section to the Thrift sample
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The "Thrift Layers" image gives a good visual representation
of Thrift in what would otherwise take many words.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
We weren't explicit about what we mean by "C++ support" as it relates
to standards versions, and it's been causing some friction in the tree
vs. some of our cruftier toolchains. Add a paragraph to clarify
things.
Fixes#55204
Signed-off-by: Andy Ross <andyross@google.com>
This C11 feature doesn't work when building C++ code, but the C++
version is based on C++11's static_assert(), which we don't have in
-std=c++98 either.
Signed-off-by: Andy Ross <andyross@google.com>
Empty structs are incompatible when building with C++, which specifies
their size as 1 byte. Technically they are illegal in C; GCC has
always supported them as an extension, but with a size of *zero*
bytes.
The upshot is that we can't have them in headers that may be presented
to a C++ compiler. Add a placeholder field.
We only get the resulting compiler warning with -std=c++98 it seems
like, which is why this went undetected.
Signed-off-by: Andy Ross <andyross@google.com>
Add some cases to enumerate all the C++ standard variants that the SDK
gcc supports (there are MANY) to prevent compatibility regressions in
the OS headers.
Signed-off-by: Andy Ross <andyross@google.com>
The recently-added LOG2 family of macros were implemented using either
a compile-time expanded C11 _Generic expression or a C++11 constexpr
template. As it happens, Cadence xt-xcc supports neither of these
constructs, and integration for the next-generation xt-clang[1] hasn't
arrived yet.
Let's back out to a more portable (heh) implementation using gcc
__typeof__. This keeps the advantage of expanding to a single
__builtin_clz() for common case usage and is result-compatible with
the new LOG2/LOG2CEIL/NHPOT.
The one downside is that the generic code was able to be used in a
constant context, something that statement expressions can't do. So
the resulting macros are (like the earlier LOG2CEIL was) unhygienic
and multi-expand their arguments. I added a warning to this effect in
the docs.
[1] Which is still based on an ancient clang tree, but more recent
than their GCC 4.2 compiler.
Signed-off-by: Andy Ross <andyross@google.com>
New C++ versions have deprecated "register" variables and restricted
"volatile" semantics, so new gcc's will emit warnings when they see
that syntax. Zephyr uses both in our C headers (though we should
probably get rid of register and unify with C++'s volatile model), so
we're disabling the resulting warnings.
But OLD gcc variants (like xcc, sigh) don't understand new -Wvolatile
and -Wregister on the command line, so they get confused. Limit the
uses to the standard versions for which gcc would emit warnigns; xcc
doesn't support those anyway.
Signed-off-by: Andy Ross <andyross@google.com>
Updates the sensor driver API documentation to explicitly state that
sample fetch functions block until the fetch operation is complete.
Fixes#53728
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
This is an implementation of issue #48334 and adds support for
specifying additional config and device tree overlays through fields in
the testcase.yaml file, which is more readable than having to cram these
in to `extra_args`.
Consider this example which shows the original and new ways to add
config and DT overlays:
```
common:
extra_args: "CONF_FILE=a.conf;b.conf
DTC_OVERLAY_FILE=w.overlay;x.overlay OVERLAY_CONFIG=e.conf
UNRELATED=abc"
tests:
utilities.base64:
extra_conf_files:
- "c.conf"
- "d.conf"
extra_overlay_confs:
- "extra_overlay.conf"
extra_dtc_overlay_files:
- "y.overlay"
- "z.overlay"
extra_configs:
- CONFIG_SAMPLE=y
tags: base64
type: unit
```
The new fields are `extra_conf_files`, `extra_overlay_confs,
`extra_dtc_overlay_files`. Files specified in these sections are appended
to any `CONF_FILE`, `OVERLAY_CONFIG`, or `DTC_OVERLAY_FILE` fields in
`extra_args`, causing the following args being passed in to
`self.run_cmake` at `runner.py:850`:
```
['-DUNRELATED=abc',
'-DCONF_FILE=a.conf;b.conf;c.conf;d.conf',
'-DDTC_OVERLAY_FILE=w.overlay;x.overlay;y.overlay;z.overlay',
'-DOVERLAY_CONFIG=e.conf extra_overlay.conf '
'<build_dir>/twister/testsuite_extra.conf']
```
These fields can be used in the common or scenario-specific YAML
sections and will be merged in order of least to most specific:
1. config files extracted from common's extra_args
2. files listed in common's {extra_conf_files or extra_overlay_confs
or extra_dtc_overlay_files}
3. config files extracted from test scenario's extra_args
4. files listed in test scenario's {extra_conf_files or
extra_overlay_confs or extra_dtc_overlay_files}
Specifying these files in extra_args now triggers a deprecation warning,
as the direct YAML fields are preferred for readability. They will still
function for now but support will be dropped in the future. One
testcase.yaml
(`zephyr/tests/cmake/overlays/var_expansions/testcase.yaml`) is
converted to use the new fields. A follow-up PR will convert the
remaining files to the new format.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Set the bbc_microbit board as part of the integration platforms, since
the sample is designed for the board and so CI should fail if the sample
no longer builds for it.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The sample no longer fits in RAM, reduce the number of discardable
packets to make it fit.
Fixes#55328.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>