When k_malloc() is expressed in terms of k_aligned_alloc() it invokes a
longer aligned allocation code path with an extra runtime overhead even
though no alignment is necessary.
Let's reference and invoke the aligned allocation code path only when an
actual aligned allocation is requested. This opens the possibility for
the linker to garbage-collect the aligning code otherwise.
Also bypass k_heap_malloc() and friends given they're invoked with
K_NO_WAIT. Go directly to sys_heap_*() instead to cut some more unneeded
overhead.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
In .../modules/debug/percepio/TraceRecorder/kernelports/Zephyr/include/\
tracing_tracerecorder.h there is a concealed non-parameterized direct
reference to a local variable that is no longer in scope. Provide a dummy
stub for compilation to succeed until that module's layering violation is
fixed, after which this could be reverted.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
When k_heap_alloc() is expressed in terms of k_heap_aligned_alloc()
it invokes a longer aligned allocation code path with an extra runtime
overhead even though no alignment is necessary.
Let's reference and invoke the aligned allocation code path only when an
actual aligned allocation is requested. This opens the possibility for
the linker to garbage-collect the aligning code otherwise.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Let's avoid division and modulus operations as they're costly... and even
more so when they're unnecessary as in this case the main constraint is
about the alignment being a power of 2 which is a very small subset of
sizeof(void *) multiples.
Then move the assertion to common code for wider coverage.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Moved the grove light sensor into a generic light sensor sample.
Replaced board specific node name for light sensor with an alias.
Refactored project name to reflect generic light sensor.
Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
The vendor prefix has been changed from 'ltr' to 'liteon'.
This change is made to better reflect the actual name of
the vendor, which is LiteOn. The previous prefix 'ltr'
was referring to the LiteOn Optical Sensor family, which
could lead to misunderstandings.
Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
RAM power configuration is preserved through soft reset,
meaning that there is a risk of accessing powered off RAM blocks
when booting in different application (i.e. bootloader).
Add option to force all RAM blocks to be powered on
before triggering soft reset to prevent this from happening.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
We can't do synchronous HCI command sending in any settings commit()
callback, since we don't know what context the callback is being called
from. One particular deadlock can happen if settings_load() is called from
the preemptible main thread:
main()
|--> settings_load() (aquire settings_lock mutex)
|-->commit callback A that defers to system wq
|-->commit callback B that calls bt_hci_cmd_send_sync()
system wq from the previous deferral from within settings_load():
|--> work item
|--> settings_save_one()
|--> attempt to aquire settings_lock mutex
In the above scenario, the bt_hci_cmd_send_sync() call from the main thread
depends on the system workqueue being processed (since that's what does HCI
command processing by default), while at the same time holding the settings
subsystem's mutex. At the same time, a system wq item tries to store
something into settings, however it deadlocks waiting for the settings
mutex.
The actual scenario that we have in the Bluetooth subsystem is where
"commit callback A" is commit_settings() in host/settings.c, and "commit
callback B" is keys_commit() in host/keys.c.
The solution to the deadlock is to take advantage of deferred bt_id_add()
handling which already exists, i.e. set a flag and deferre the actual
adding to the system workqueue.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Sending an HCI message requires to wake up the controller
core if it's asleep. Platform controllers may send responses using
non wakeable interrupts and those can be lost during standby usage.
Blocking standby usage until the HCI message is sent.
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
Add some extra ifdefs around MQTT 5.0 specific structures to prevent
compiler errors due to undefined symbols in certain configurations.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The CS complete callbacks provide both status and params.
In the case of errors, NULL pointer is passed to the params of callbacks.
Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
If the HCI status of a complete event is not BT_HCI_ERR_SUCCESS,
the remaining parameters could be invalid.
In this case, the params is passed as NULL pointer to the callbacks.
- LE CS Read Remote Supported Capabilities Complete event
- LE CS Read Remote FAE Table Complete event
- LE CS Config Complete event
- LE CS Security Enable Complete event
- LE CS Procedure Enable Complete event
This change avoids forwarding the invalid fileds to the applications.
Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
String location information should only be sent for core which
do not append strings to the log message (PPR, FLPR). Without
this, cpurad was also sending that information and that was
redundant.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When decoding logs from a remote core with memory that APP can
access, wrong address of an array with string addresses was used.
Log message contains index of a string and APP strings array was
used instead of remote core. Extend STMESP logging so that address
of string array of a remote core is send during startup to the APP
and APP is using this array to decode strings from remote cores.
Bug applies only to PPR and FLPR as APP has no access to RAD memory.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
As there is no currently known board that has the cadence spi,
add a test to just build it under the qemu cortex m3.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Replace manually authored hardware features table with the new Zephyr
board supported hardware directive which automatically generates an
up-to-date table based on the boards' Devicetree.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This is to fix ci failure caused by commit d5d4d57
In the above commit, it's wrongly assumed that ROM_ADDR and RAM_ADDR
are same **only** when CONFIG_XIP is not defined.
Since aarch64 was taken as reference in the review,
we missed to see that CONFIG_FLASH_SIZE is also part of the condition
to define ROM_ADDR as RAM_ADDR.
CONFIG_XIP is not defined for qemu_cortex_a9/xc7z007s however,
CONFIG_FLASH_SIZE is not 0 so the assumption fails
and the required reset to RAM_ADDR is not applied leading to the test
failure.
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
By default the thread priority is still the lowest application thread
priority. Allow the priority to be increase by specifying both, the
`override` option as well as the desired `priority`. This pattern was taken
from the shell thread.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
Add an example of how to initialize gbias. The real application should
restore latest valid values taken from non-volatile memory.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Use SENSOR_ATTR_OFFSET attribute to initialize the Sensor Fusion GBIAS.
This is useful when the device is not sill (e.g. hold in hand) and so
the gyroscope calibration does not run.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Move gyro_freq setting inside lsm6dsv16x_gyro_set_odr_raw() routine,
so that it is properly saved in all cases (i.e. from DT configuration
and from runtime ATTR set case).
Signed-off-by: Armando Visconti <armando.visconti@st.com>
When building with clang, it warns:
tests/subsys/usb/bos/src/test_bos.c:24:22: error: variable
'dummy_descriptor' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t dummy_descriptor[] = {
^
Only the size of dummy_descriptor is used, not the contents. Replace the
struct with a constant for the size.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
The least significant bit of the first octet of a MAC address is a
unicast/multicast bit. The bit should be cleared when generating a
random link address for a virtual interface. Any frames from such
interface/address will be dropped by the network as invalid if
the multicast bit is set.
Signed-off-by: Jack Chistyakov <jack.chistyakov@outlook.com>
- Reduces the ram disc sector count from 400 to 220.
- Saves about 90KB of RAM. All tests still passed.
- Allows platforms with less RAM to run
the ramdisc_small.overlay test.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
Disable automatic LFCLK selection for GRTC during driver initialization.
For Zephyr applications it is selected by `sys_clock_driver_init()`
depending on configuration and DTS.
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
Selection of the LF clock source for the GRTC should be performed
as early as possible, before starting GRTC.
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
There are a couple things going wrong in this test code right now.
First of all, there is no syncrhonization of when the async polling
thread should start polling, causing sometimes the poll to fail on tests
before the async test ran. Add a semaphore to fix this.
The lock test was setting up a nonsense NOP transfer of 0 length.
This might cause unexpected behavior and is not the point of
this test case.
But, still we should add a seperate test case specifically for
testing this instead.
Also add a teardown function to release the locks to allow other test
cases to run in case of some failures.
Also a minor change to remove some ARG_UNUSED invocations for some
arguments that are actually used.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Change OpenOCD version regex to be compatible again with format strings
not having a space or newline immediately after the version nr.
Modified regex has been verified with the strings listed below.
Ubuntu:
"Open On-Chip Debugger 0.11.0"
ADI:
"Open On-Chip Debugger (Analog Devices 0.12.0-1.1.1) OpenOCD 0.12.0 (2024-
08-27-17:25)"
Zephyr SDK:
"Open On-Chip Debugger 0.11.0+dev-00728-gb6f95a16c (2024-02-17-23:51)"
Infineon:
"Open On-Chip Debugger 0.12.0+dev-5.2.1.3248 (2024-08-08-17:29)"
Espressif:
"Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:25)"
Fixes: 1c05f2121c
Signed-off-by: Hakan Jansson <hakan.jansson@infineon.com>
Fix USB controller base address.
rp2040 was fixed in a10f2e8 and the rp2350 uses the same base address.
Signed-off-by: James Turton <james.turton@gmx.com>
We updated the MEC5 portion of hal_microchip. Update Zephyr west
manifest to use the updated HAL.
Signed-off-by: Scott Worley <scott.worley@microchip.com>