The nrfjprog utility is not capable of flashing a hex file which
affects the flash memories of both coprocessors of the nRF53 family of
SoCs.
However, the user is capable of creating such a hex file using the
HEX_FILES_TO_MERGE build system variable.
An example use case is to build a bluetooth controller application for
the network core, then use the zephyr.hex file in that build directory
as the HEX_FILES_TO_MERGE argument for a separate Bluetooth
application build targeting the app core.
Work around this by detecting the situation and doing the right thing
by splitting the hex file back up again, even if thats a bit awkward.
Splitting the hex into app and network core components allows them to
be flashed separately. This is the only way we can get the job done
with nrfjprog.
This is arguably nicer since there's just one 'west flash' invocation.
At least in the use case named above, you wouldn't need to rebuild the
controller application very often, so this is a simpler user workflow.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The SD Card Physical Layer specification states in Table 7-1
(in section 7.3.1.1) that the LSB of the 48 bit command must
be set to 1 to act as an 'end bit'.
Fixes#33479
Signed-off-by: Rich Barlow <rich@bennellick.com>
Kconfig option USB_HID_PROTOCOL_CODE does not allow to set
boot interface protocol code for specific HID device but
only to set the same value for all device.
Add new API function to allow the application to set
Protocol Code per device. Deprecate USB_HID_PROTOCOL_CODE option.
Fixes: #32778
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The pointer to interface descriptor in struct usb_cfg_data
is used to access and modify the descriptor at runtime.
Remove const qualifier and thus avoid unnecessary casts.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Increase BD buffers from 7 to 9 to handle 1024 block
counts having mega/normal src,dst bd combinations in one request.
Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Sync packet is always CARD to HOST and if it's combined with HOST
to CARD transfers in one single RM header packet, it's not allowed
due to RM implementation constraints. RM implementation allows same
type of data transfer direction in all the BD's populated under one
header BD.
Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Adds Friendship tests to the Bluetooth Mesh BabbleSim test suite. The
friendship tests cover all basic friend establishment and message
sending scenarios, including coverage for previous regressions, such
as #29544, #32033 and #30657.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Remove support for counter_read and counter_get_max_relative_alarm as
they have been deprecated for at least 2 releases. As part of the
removal of counter_get_max_relative_alarm remove the code in all
counter drivers that implemented the API.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
GCC10 introduced by default calls to out-of-line helpers to implement
atomic operations with the '-moutline-atomic' option. This is breaking
several tests because the embedded calls are trying to access the
zephyr_data region from userspace that is declared as MT_P_RW_U_NA,
triggering a memory fault.
Since there is currently no support for MT_P_RW_U_RO (and probably never
will be), disable the out-of-line helpers disabling the GCC option.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
It is apparently possible for one CPU to change the memory domain
of a thread already being executed on another CPU.
All CPUs must ensure they're using the appropriate mapping after a
thread is newly added to a domain.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Introduce the necessary routines to have the user thread stack correctly
mapped and the functions to swap page tables on context switch.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
The size_t usage, especially in struct z_heap_bucket made the heap
header almost 2x bigger than it needs to be on 64-bit systems.
This prompted me to clean up our type usage to make the code more
efficient and easier to understand. From now on:
- chunkid_t is for absolute chunk position measured in chunk units
- chunksz_t is for chunk sizes measured in chunk units
- size_t is for buffer sizes measured in bytes
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The end marker chunk was represented by the len field of struct z_heap.
It is now renamed to end_chunk to make it more obvious what it is.
And while at it...
Given that it is used in size_too_big() to cap the allocation size
already, we no longer need to test the bucket index against the
biggest index possible derived from end_chunk in alloc_chunk(). The
corresponding bucket_idx() call is relatively expensive on some
architectures so avoiding it (turning it into a CHECK() instead) is
a good thing.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Sparc architecture is strange. Va_list arguments are packed (1 byte
alignment) while unaligned access fails. Added dedicated handling of
Z_CBPRINTF_STORE_ARG which is copying the data word by word.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added missing errno.h include. Fixed Z_CBPRINTF_ARG_SIZE macro for
void * and cleaned up macro description.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit removes the signing commands from the post build steps,
in order to leverage the consolidated TFM signing code.
Also with the support to adjust the hex base address when signing,
there is no need to run the TFM_UPDATE.sh script. We can use west
flash to flash the merged hex file on the board.
Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
This commit enables the TF-M IPC sample application on stm32l562e_dk
board.
It provides device tree flash partition as an overlay in order to
configure and flash the bl2, secure/non secure firmwares.
Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
After TZ is enabled, the GPIO peripherals are secured and are
not accessible from non secure world.
This commit prevents the GPIO pinctrl from the non secure target
for stm32l562e_dk board.
Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
This commit adds a second target for the stm32l562e_dk board.
The non secure target can be configured for TFM IPC application.
Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
This commit allows to append an optional --hex-addr argument to
the wrapper script if speficied. This can adjust the base address
of the output hex file when signing the non-secure or secure
firmware images.
Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
GPIO driver properly disconnects a pin. On subsequent pin
configure calls the driver does not clear the GPIO pin's
power gate field resulting in the pin remaining disconnected.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
Added test_pipe_get_large to cover branches in both k_pipe_put and
k_pipe_get. Added trivial testcases in test_pipe_avail_no_buffer to
cover trivial branches for k_pipe_read_avail and k_pipe_write_avail.
This is the second patch as the continuation of #31037.
Signed-off-by: Shihao Shen <shihao.shen@intel.com>
Fix control Tx buffer leak into data Tx pool that happens
after a cross-over control procedure response was paused due
to currently active encryption setup procedure, and a new
control Tx PDU in addition to the paused one is enqueued
thereafter.
When the control tx PDUs is resumed but not yet enqueued
towards the radio, if there is a new control Tx PDU enqueued
then the paused control Tx PDU is not set as the head of the
control PDUs in the Tx queue. This caused the paused control
Tx PDU to be associated with data Tx pool, hence causing the
incorrect release into data Tx pool.
Relates to the commit bff76b4cce ("Bluetooth: controller:
split: Fix control tx queue handling") and to the
commit 6991d09977 ("Bluetooth: controller: Fix control tx
queue handling").
Fixes#32898.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The only user of arch_mem_domain_destroy was the deprecated
k_mem_domain_destroy function which has now been removed. So remove
arch_mem_domain_destroy as well.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove the redundant connection initiated check as the event
is closed on connection initiated and it is sufficient to
check in the prepare_cb function to abort any events in the
pipeline after the connection has been initiated.
Relates to commit 5ce5dc055e ("Bluetooth: controller:
Avoid race between ULL and LLL when initiating conn") and
commit 18f5fb99c1 ("Bluetooth: controller: Remove use of
lll_stop").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Function random_byte_get() returns only the least significant byte of
the 32-bit random datum, as this is the used value, so avoiding that
higher numbers are interpreted as negative error codes and their value
is not discarded.
Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
Building this file with CONFIG_COVERAGE=y and CONFIG_SHELL_LOG_BACKEND=n
fails on the llvm-clang compiler. Swapping the IS_ENABLED and
log_backend allows the compiler to optimize out the if block even with
coverage enabled.
Signed-off-by: Jeremy Bettis <jbettis@chromium.org>