These Kconfig options are changing from select to depends on,
therefore make sure the needed options are used in the sample
project.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
These Kconfig options are changing from select to depends on,
therefore make sure the needed options are used in the sample
project.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
For mcuboot support, this Kconfig option needs to be selected, this
is done by having a separate project configuration file when
building the version that supports mcuboot.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Selects the FLASH_MAP Kconfig as this is changing from an automatic
selection to a depends on due to a dependency loop.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This drops using the environmental part when referencing ZEPHYR_BASE
as the environment value does not have to be set and, in most cases,
is no longer set at all.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
k_work_* API cannot not be used from the user threads as the APIs are
not syscalls. Doing so leads to a crash when userspace is enabled.
As the current use of delayed work API from user threads is merely
scheduling of the initial work execution, it can be moved into the main
thread context. The time difference from the former and current approach
should be marginal, as the start_tcp/udp_proto() calls are not blocking
calls.
Another issue was usage of k_mem_domain_add_thread() on uninitialized
TCP threads. This lead to another crash, as assigning thread to a memory
domain also involves removing it from the previous domain, which lead to
NULL pointer dereference if thread was not initialized yet. As, by
default, newly spawned threads inherit memory domain assignment from
their parent, it's not really needed to assign the same domain
explicitly, hence, it can be safely removed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Allow the Unicast Audio Client sample to work if there are no
sink or no source ASEs on the remove device (e.g. if the remote
device only has sink ASEs).
If the remote have neither, it will abort.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
On M7 based STM32 boards, external SDRAM may be present and mapped in the
area 0xC0000000-0xDFFFFFFF.
According to ARMv7-M Architecture Reference Manual chapter B3.1
(table B3-1), this area is specified as Device Memory Type, with the
consequence that all accesses should be naturally aligned, otherwise
a hard fault will be triggered whatever UNALIGN_TRP status in the CCR reg.
To avoid this issue, when available, configure external SDRAM memory
regions as a MPU with RAM attribute.
Fixes#54670
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
* add opening and closing braces around several blocks
* convert dos line endings to unix
* move assignments out of conditionals
* ensure adequate spacing after control blocks
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Previously, the `fnmatch()` function was available in `lib/util`
but it did not have any test coverage.
After moving it to `lib/posix`, add test coverage to the POSIX
testsuite.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
In the Bluetooth Core Specification, the minimum
ISO_Data_Packet_Length is 0x0001, hence fix the
BT_ISO_TX_MTU range to allow a minimum value of 1.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The Zephyr controller does not support PAST, and there
is no other controller we can build upstream with these samples.
Disable these 2 samples for the nrf52_bsim until PAST
is supported by the controller.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for configuring power on delay when using SPI SDHC. This
allows cards that reliably initialize with a shorter (1ms) delay to
avoid the long initialize delay otherwise imposed.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add I2C bus recovery support to the STM32 v1 and v2 driver. The STM32 i2c
peripheral does not natively support I2C bus recovery so recovery is
performed using GPIO bitbanging. This mirrors the bus recovery
implementation for NXP MCUX LPI2C driver.
Fixes: zephyrproject-rtos#54917
Signed-off-by: Maxmillion McLaughlin <github@maxmclau.com>
Noticed the tests were a bit verbose, saw a few stray printks. Drop those
as they aren't really needed and potentially cause testing issues, printk
is a potential synchronization point.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Renode platform fails the test despite it working well on qemu riscv.
Ignore this particular platform for now.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
By using an mpsc queue for each iodev, the iodev itself is shareable across
contexts. Since its lock free, submits may occur even from an ISR context.
Rather than a fixed size queue, and with it the possibility of running
out of pre-allocated spots, each iodev now holds a wait-free mpsc
queue head.
This changes the parameter of iodev submit to be a struct containing 4
pointers for the rtio context, the submission queue entry, and the mpsc
node for the iodevs submission queue.
This solves the problem involving busy iodevs working with real
devices. For example a busy SPI bus driver could enqueue, without locking,
a request to start once the current request is done.
The queue entries are expected to be owned and allocated by the
executor rather than the iodev. This helps simplify potential
tuning knobs to one place, the RTIO context and its executor an
application directly uses.
As the test case shows iodevs can operate effectively lock free
with the mpsc queue and a single atomic denoting the current task.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Adds a lock free/wait free MPSC queue to the rtio subsystem.
While the SPSC ring queue is fast and cache friendly it doesn't
work for all scenarios. Particularly the case where multiple rtio contexts
are attempting to work with a single iodev. An MPSC queue works perfectly
in this scenario.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
SPSC initializer macro had unused parameters defined and documented. Remove
those as they are unused.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Handling panicking while in an ISR. Instead of attempting to call
`pm_device_get` for each character, ensure that the hardware is enabled
when `log_panic` is called.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Allow the log_backend_uart char_out implementation to integrate with
'Device Runtime Power Management'.
Without using runtime PM, it is impossible for the application to manage
the power state of a UART instance, given that any module in the
application could theoretically LOG_* or printk at any point in time.
This removes the need to manually call `pm_device_state_set` when the
lowest power states must be reached, while still allowing log messages
to be output.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Allow the uart_console console_out implementation to integrate with
'Device Runtime Power Management'.
Without using runtime PM, it is impossible for the application to manage
the power state of a UART instance, given that any module in the
application could theoretically LOG_* or printk at any point in time.
This removes the need to manually call `pm_device_state_set` when the
lowest power states must be reached, while still allowing console and
printk messages to be output.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
The asserts in the USB-C stack functions were causing compilation
errors when asserts were enabled in Kconfig.
This was caused because the asserts checked if the functions
parameters were within limits specified by the state machine arrays.
At the position of these asserts, these arrays were only declared
without specifying the size of them, what prohibited the asserts from
knowing the size of arrays and checking if specified value is within
limit of it.
Signed-off-by: Michał Barnaś <mb@semihalf.com>
When a query is done, the query isn't set to NULL.
This can cause a nullptr exception in invoke_query_callback().
Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
Twister allows filtering based on kconfigs and dts, however the
filtration is a part of the cmake stage, i.e. the stage has to pass
first and then twister checks if required properties are available.
This causes problems, when the full cmake stage is unable to pass.
If so, other filtration methods had to be used, e.g. platform_allow.
The commit modifies the twister workflow:
if a test defines filters based on kconfig/dts first a cmake package
helper script is used to extract dt and/or kconfigs and if the
conditions are fulfilled it proceeds to a regular cmake stage.
If not, test is skipped.
Co-authored-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Couple issues:
- `sys_clock_set_timeout()` should not base its `mtime` on the current
time either. Tracking the `last_tick` and `last_elapsed` values avoids
the need for all the tick rounding computation.
- The MIN_DELAY thing is pointless. The hardware performs a signed
comparison. If the delay gets close or even behind current time then
the IRQ will be triggered right away. This is unlikely to happen very
often anyway so the constant overhead is uncalled for.
- Runtime 64-bits divisions on 32-bits hardware are very expensive.
- The timer must be enabled before the count can return a sensible
value during driver init (at least on qemu_cortex_a9).
Discussion in PR #54919 applies here too.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Now building twice back to back does not build anything the second time
when CONFIG_CLEANUP_INTERMEDIATE_FILES (which obviously breaks
incremental builds) is also turned off.
Fixes commit 2906d1aa51 ("soc/intel_adsp: Build bootloader with Zephyr")
Properly implementing custom commands requires BOTH
`add_custom_command()` and an `add_custom_target()` wrapper with some
careful DEPENDS wizardry between them.
https://cmake.org/cmake/help/latest/command/add_custom_target.html
> Use the add_custom_command() command to generate a file with
> dependencies.
The documentation of add_custom_command() also similarly refers to
add_custom_target()
When this is not done properly, the build is cursed in various, very
time-consuming ways which are not officially documented but here
instead:
https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This gives our users some indication of why they are not receiving
long advertisements.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Don't sample the first entry outside the timer as this is a different
code path which produces a different offset from the clock tick.
Use sys_clock_hw_cycles_per_sec() to be compatible with systems that
read their hardware clock frequency at run time.
Perform cycle difference computations with uint64_t. If ever the
magnitude of the absolute clock cycle values is greater than 52 bits
then the cast to a double will actually lose accuracy.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The fuel gauge API sbs_gauge test uses conf/overlay pairs for each
board. This was getting unnecessary and redundant.
Combine the overlay/conf files into a single generic overlay/conf pair for
emulated boards and apply them via the testcase.yaml rules.
Signed-off-by: Aaron Massey <aaronmassey@google.com>
The sbs gauge emulator intercepts SMBus messages for an sbs gauge
compatible IC. However, it was incorrectly interpreting the byte order of
received register write values based on the endianness of the SoC
architecture instead of SMBus' defined little-endianness. This fault was
not caught earlier because native posix and the majority of qemu
architectures use little-endian.
Explicitly interpret the write values as little-endian.
Signed-off-by: Aaron Massey <aaronmassey@google.com>
Add min-microvolt/max-microvolt to set the range for voltages for testing.
It filter out ranges that cannot test correctly in the configuration.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
The specification of que CBOR request 'image upload request' field
'sha' was decalred as type (str) but is (byte str).
Just replaced the field type after verified with code here:
/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c#L383
Signed-off-by: Mathis Raemy <mathis.raemy@gmail.com>
The commit resets MCUboot revision after zephyrproject-rtos/mcuboot
main branch has been overwritten with mcuboot/mcuboot main.
The reset has been done due to MCUboot fork history, in Zephyr,
has been broken and contained duplicate commits.
For details look at issue: #55303.
The reset of MCUboot also requires update to following repositories:
trusted-firmware-m
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
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>