The nRF5340dk is shipping an external QSPI flash that can be used to do
XIP from. Extend the code_relocation nocopy sample to support this
platform so that part of the functions are executed from internal flash
and others from external flash.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
* Use case of interest:
Some platforms are shipping in parallel to the internal FLASH some other
storage / external FLASH (usually a QSPI FLASH) that can be used to
execute (XIP) code from.
The content of this external FLASH can usually be written at flash time
using proper tools (see for example the case of the external FLASH on
the nRF5340DK that can be written at flash time using nrfjprog).
The external FLASH is a nice addition that is extremely useful when a
large application code doesn't entirely fit on the internal FLASH so
that we could want to move part of it in the auxiliary FLASH to XIP the
code from there.
* The problem:
Right now Zephyr doesn't have a formal and generic way to move at build
time part of the code to a different memory region.
* The current status:
Zephyr is indeed shipping a code_relocation feature but that doesn't
entirely match our needs.
When XIP is enabled, the code_relocation feature is used in Zephyr to
move the selected code (that is to copy text section, to initialize data
and zero bss) from FLASH to SRAM at run time and execute code from SRAM.
The relocation is done by a generated snippet of code that is
memcpy()-ing the right content to the destination region also using some
build-time generated portions of linker script to retrieve start and
destination addresses and regions.
* This patch:
This patch is leveraging the code_relocation code and adding a NOCOPY
feature. This feature is using the code_relocation feature to
dynamically build the linker script snippets but entirely skipping the
run-time code relocation so that the code can be XIP-ed from the
destination region.
* Example:
Let's say that we have a big file called `huge_file.c` that we want to
XIP from the external FLASH that is mapped in an EXTFLASH region.
In this case we should enable `CONFIG_XIP` and
`CONFIG_CODE_DATA_RELOCATION` and instruct cmake as follows:
zephyr_code_relocate(src/huge_file.c EXTFLASH_TEXT NOCOPY)
zephyr_code_relocate(src/huge_file.c SRAM_DATA)
this means that:
- The .text section of the `huge_file.c` must reside in the EXTFLASH
memory region and we do not need to copy the section there because we
are going to XIP it (and we assume that the file is going to be placed
in the external FLASH at flash time).
- The .data section of the `huge_file.c` must still reside in the SRAM
memory region.
* TODOs:
It's desirable to have the possibility to relocate libraries and
pre-build files instead of source code files.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Zephyr docs should mention OTA:
- Define Over-the-Air update
- Indicate OTA can be used with MCUboot
- Link examples of the OTA DFU process
Signed-off-by: Mike Szczys <mike@golioth.io>
CONFIG_BT_ISO_TX_MTU=230 had been added to deal with the RX
buffers not fitting TX's of same size, which is fixed now.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Register modem power callbacks to show how it can be
used to provide e.g modem power on and off sequences.
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
XCC (based on GCC 4.2) doesn't support C++11, and can't build those
tests. So exclude them from twister.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Both drivers enable device runtime on init, so they will be suspended
in the very beginning. The async get operation no longer exists, so
just remove the message related with this.
Fixes#42740
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Firmware uploading to the host may not always be desired,
disable it by default.
Enable it for existing USB DFU sample to keep
the usual behavior, add note about new option to README.rst.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add missing integration plaforms in direction finding samples.
There were no nRF52820 and nRF5340 added.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Direction finding connectionless RX sample didn't fit into
nRF52820 SRAM. The sample will not be able to store IQ samples
for maximum number of CTEs allowed by Bluetooth Core 5.3
specification.
For nRF52820 the new allowed maximum number of scanned CTEs
is set to one, to save more space in SRAM for an application.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix problem with building sample applications where Host is
split from Controller into separate binaries. In that situation
samples does not have access to controllers Kconfig options.
To optimize memory usage by an application, disable not needed
features (angle of arrival or angle of departure).
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add missing integration plaforms in direction finding samples.
There were no nRF52820 and nRF5340 added.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
To give control over GPIO pins for Direction Finding Extension of
Radio peripheral when build for nRF53 network core, the application
core has to assign those pins to network core.
There is a mechanism that uses a device tree overlay to get
information about GPIO pins to be assigned to network core.
The commit adds overlays with appropriate configuration
to assign GPIO pins in all DF related samples.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There was a bug it periodic advertising sync termination handling.
If a sync was terminated before sync established was reported,
for example sync may be filtered out by CTE type, then sample
will wait until sync_create_timeout_ms is reached.
Also sem_per_sync_lost semaphore is given in term_cb.
Result of the bug is next time a sync is established, CTE sampling
is enabled, sample starts waiting for periodic sync lost and
immediately ends waiting because sem_per_sync_lost is given.
Scan is restarted and already synchronized sync is terminated.
Correct behavior is, when term_cb is executed sem_per_sync_lost
may be given only if sync established was already reported.
Also sample must not wait for sem_per_sync if sync is terminated
due to wrong CTE type. It can end wait immediately.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
In applications where timing is critical it seems like enabling
deferred log mode could be desirable.
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Co-authored-by: Seb Laveze <sebastien.laveze@nxp.com>
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
Blinky PWM sample minimum pwm period was too high for iMX.RT PWM module.
decrease the minimum pwm period so sample will pass pwm calibration
phase.
Fixes#38954
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The samples/kernel/metairq_dispatch runs failed on acrn_ehl_crb
due to the potential race condition in accessing the global stat
data. Add a spinlock to prevent this.
Fixes#40889
Signed-off-by: Enjia Mai <enjia.mai@intel.com>
Mark MODBUS samples as build only, otherwise they would
need different fixtures for each sample.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
MCUX watchdog timer supports min window of 500ms. Increase maximum task
watchdog timeout window to 500ms by default, so that this sample can run
on iMX RT SOCs. Also update iMX RT watchdog driver to reject timeout
maximums under 500ms with a useful error message
Fixes#40153
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
As described in #42403, there was an issue with the existing crc16_ansi()
implementation, since it was not calculating the CRC-16-ANSI (aka
CRC-16-MODBUS). This is because the existing crc16() function only
supported non-reflected input and output (and the CRC-16-ANSI requires
reflection on both) and also it did not seem to support correctly inial
seeds different from 0x0000 (and, again, the CRC-16-ANSI requires 0xffff
as an initial seed).
This commit replaces the existing crc16() with a functional pair,
crc16() and crc16_reflect(), that also work with any poly, any initial seed
and allow to select whether reflection is performed.
It also adapts crc16_ansi() so that it actually returns the correct CRC.
Fixes#42403.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Using a gpio_dt_spec is the current best practice for getting at pins
defined in the DT, because it gets all the boilerplate and flags right
for you. Use that in blinky, keeping the documentation in sync with
the code.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This expands the sample to do both v1 and v2, and both immediate
and deferred modes for each logging verion. This is to make sure
MIPI Sys-T output is not broken for all combinations. Default is
v2/immediate using prj.conf. Deferred mode is enabled via
overlay.
Also add qemu_x86 as an allowed platform as the samples are
working there too.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds a few log lines to show how string processing works
with Sys-T.
Note that CONFIG_LOG_BLOCK_IN_THREAD=y to make sure all log
messages are printed instead of being dropped.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add a basic device tree overlay to support the use of the ATSAMD21 XPro
dev board with the ADC sample application.
Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
All drivers that require input_positive to be set should be given it.
Some parts may require an offset, so abstract this away too.
Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
Direction finding samples had dependency on KConfig option defined
in Controller. That caused a problem for split builds where
an application and host are not part of the same binary as
controller. The code dependend on the Kconfig option
was always disabled.
To fix that issue new Kconfig options were introduced to
Host. The dependency is removed. Unwanted features may stil be
disabled and samples binaier will be smaller.
The commit aligns all direction finding samples code.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
A common pattern here was to take the work item as the subfield of a
containing object. But the contained field is not a k_work, it's a
k_work_delayable.
Things were working only because the work field was first, so the
pointers had the same value. Do things right and fix things to
produce correct code if/when that field ever moves within delayable.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Use the set of headers that the TF-M build system places in the
install output. Not all public header files are available in the
interface/include directory and the TF-M build system uses the install
mechanism of cmake to include additional headers based on platform
or configuration.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Lora samples are missing harnesses and hence are reported
failed by default by twister.
Add required harnesses to be able to detect correct and faulty
test executions.
Fixes#42159
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The ip_k66f doesn't have I2C_0 status set to OKAY so the build of
this sample generates warnings in the nightly build. Root problem
is that the groove display is not ported to the device tree so
there isn't a standard way of filtering on the display being
part of the platform.
fixes#41523
Signed-off-by: David Leach <david.leach@nxp.com>
Increase minimum RAM requirements on this test as it appears
that 32 is too low and 40 is verified ok.
Fixes#42161
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
When moving the samples to samples/modules the example code was not
updated accordingly.
Fixes: 613f1cde4a
Signed-off-by: Moritz Fischer <moritzf@google.com>
The CAN_BUS_UNKNOWN CAN controller state is only used to indicate that
the current CAN controller state could not be read.
Remove it and change the signature of the can_get_state() API function
to return an integer indicating success or failure.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Adds Basic Audio Profile (BAP) unicast server and client samples.
These are the barebones versions of what is needed to scan/advertise
for audio and setup a stream using the mandatory LC3 preset defined by
the BAP spec.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add reference to specific CONFIG_BT_CTLR_ Kconfig options
for the ISO samples. This is due to the fact that ISO
isn't fully supported in the Zephyr controller yet, and
won't be enabled by default for a while yet.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
For tracing_user, the sys_trace_isr_enter() & sys_trace_isr_exit()
block any nest interrupts & most SMP interrupts for the user. It is
hard to analyze the IRQ preemption(e.g., each IRQ counter and execution
time). This commit adds ISR nest level for each CPU to the user instead
of blocking user call back when nest interrupts.
Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
Remove the only_tags filter for the board and add ignore_tags for net
and bt.
Adds a filter to a userspace sample that didn't correctly filter on
usermode being Kconfiged.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Add a check for SDU size and tx qos to ensure that we do not
attempt to send any data and neither central or peripheral
if the benchmark has been setup to be rx-only.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>