In GNU LD, the location counter (the 'dot' variable) always refers to
the byte offset from the start of current object as mentioned in
documentation[1]:
```
'.' actually refers to the byte offset from the start of the current
containing object. Normally this is the SECTIONS statement, whose start
address is 0, hence '.' can be used as an absolute address. If '.' is
used inside a section description however, it refers to the byte offset
from the start of that section, not an absolute address.
```
For example, if the section 'rom_start':
rom_start : {
. = 0x400;
_vector_start = ABSOLUTE(.);
} > FLASH
has a starting address of 0x8000000, then _vector_start will be
0x8000400
However, behavior of LLVM LLD is quite different, the value of the
location counter is always absolute (see discussion [2]), so in the
example above, the linker will return error, because it will interpret
'. = 0x400' as an attempt to move the location counter backwards.
It could be fixed by changing line to '. += 0x400' (#54796) which will
move the location counter by 0x400 for both linkers, but it would work
only when we are at the beginning of section. Consider the following
example:
rom_start : {
. = 0x400;
KEEP(*(.boot_hdr.conf))
. = 0x1000;
KEEP(*(.boot_hdr.ivt))
KEEP(*(.boot_hdr.data))
KEEP(*(.boot_hdr.dcd_data))
. = 0x2000;
_vector_start = .;
} > FLASH
In this case, _vector_start will be 0x2000, but if we change
'. = 0x2000' to '. += 0x2000', then the value of _vector_start depends
on size of data in input sections (but it's 0x3000 at least).
Actually, this example comes from final linker script when compiling
firmware for mimxrt1170_evk_cm7 board. This board failed to boot
(#55296) after #54796 was merged.
This patch introduces method compatible with both linkers. We calculate
relative offset from the beginning of the section and use that value to
calculate number of bytes by which we should move the location counter
to get CONFIG_ROM_START_OFFSET.
[1] https://sourceware.org/binutils/docs/ld/Location-Counter.html
[2] https://discourse.llvm.org/t/lld-location-counter-inside-objects
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Some controllers support additional connection parameter ranges
beyond what is described in the specification. Enabling this new option
allows the application to set any value to all connection parameters.
Tbe Host will perform no limits nor consistency checks on any of the
connection parameters (conn interval min and max, latency and timeou).
However, the Host will still use numerical comparisons between the
min and max connection intervals in order to verify whether the
desired parameters have been established in the connection.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When the frame-pointer based unwinding is enabled, the stop condition
for the stack backtrace is (FP == NULL).
Set FP to 0 before jumping to C code.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add test scenario for NXP S32 platforms, for now only ported to
mr_canhubk3.
In some platforms the MPU region used for NULL pointer detection
conflicts with the ITCM region, causing access fault. Make disabling the
null pointer exception detection the default behavior for this scenario.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
In order to support more Arm SoCs, extend the SoC-specific linker file
instead of the default arch linker file.
Fixes#60165
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Currently tests.application_development.code_relocation and
tests.application_development.code_relocation_kinetis scenarios are
restricted to specific NXP platforms only, so make filters more strict.
Also for frdm_k64f, which lacks of ITCM, relocation to ITCM must be
disabled.
Fixes#60167
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Add a feature to suppress commands. The suppressed commands are not
logged on the command reception.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Small refactoring that unifies the assertion order for improved
consistency across tests - placing the SUT before the expected value
everywhere.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces an integration test that simulates an incoming disassociaton
notification from a coordinator.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces IEEE 802.15.4 device roles for use in later change sets.
In the near term this will be used for coordinator-role support in
tests. Then additional coordinator-specific features will be gradually
introduced without exposing them to the user API, yet. Once a reasonable
feature set has been collected for coordinators, it will be exposed in
public APIs for use in applications.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Adds test coverage for the disassociation shell command that
disassociates the enddevice by notifying its coordinator.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
The macro used in an assert statement in the `sys_mm_drv_page_phys_get()`
function was using an older version of the naming scheme, fixed now.
Signed-off-by: L Lakshmanan <l-lakshmanan@ti.com>
TI K3 family of SoCs requires an extended set of registers to operate.
Extended functionality of the current driver to support the variant.
Signed-off-by: L Lakshmanan <l-lakshmanan@ti.com>
Statically created threads with K_THREAD_DEFINE() are launched only
after the SYS_INIT phase. This does not play well with NET_CONFIG
library, which may block during SYS_INIT until network interface
is UP and RUNNING.
In order to be able to connect to L2 network and thus mark the
network interface as running and unblock NET_CONFIG, we need to be
able to run conn_mgr thread during SYS_INIT. This can be achieved,
by starting the thread dynamically during SYS_INIT phase, instead
of relying on static thread creation.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
net_if_lock() should be called only after iface pointer is verified not
to be NULL, otherwise we can end up dereferencing NULL pointer in
certain corner cases.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
nRF USBD ISOINCONFIG register controls USBD behavior after receiving IN
token addressed to ISO IN endpoint when the endpoint was not armed with
data. The options are:
* NoResp, in which case there is no response (i.e. bus timeout)
* ZeroData, in which case device responds with ZLP
This commit both makes the ISOINCONFIG value configurable and changes
the default from NoResp to ZeroData. For reference, DWC_otg controller
will always send ZLP in such case and does not have NoResp equivalent.
Automatically sending ZLP when ISO IN endpoint is not armed resolves
periodic audio dropouts observed on Mac OS with USB Audio headset
sample. Apple USB Audio class driver will attempt recovery (abort all
pending URBs, switch to alternate config 0, switch to active alternate
config and submit new URBs) every time it sees kIOReturnNotResponding
status code. During recovery no audio data can be transferred and
therefore there are gaps in the audio stream.
Apple USB Audio driver sees kIOReturnNotResponding when there is bus
timeout (i.e. IN token was sent to nRF when the endpoint was not armed
and NoResp option was active). Activating ZeroData option results in
perfectly fine (albeit short) packet that does not trigger interface
recovery and thus fixes the USB Audio issues on Mac OS.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
add explicit unsigned suffix to 'Z_DEVICE_MAX_NAME_LEN' macro, matching
it to return type of sizeof (size_t), thus the comparison operator '<='
has the same essential types, complying with required [misra-c2012-10.4]
rule which states; Both operands of an operator in which the usual
arithmetic conversions are performed shall have the same essential type
category.
Found as a coding guideline violation (Rule 10.4) by static code
scanning tool.
Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).
Signed-off-by: ferar alashkar <ferar.alashkar@gmail.com>
Convert the GT911 driver to the input subsystem, fix the existing boards
to work in the default config.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The SPHINXOPTS option was not aligned with latest changes in CMake, and
SPHINXOPTS_EXTRA was not present.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Align `soc/nxp_adsp` with new `WEST_SIGN_OPTS` option added to
`soc/intel_adsp` by recent commit d98a7c2f8d ("soc: xtensa: cmake: add
new WEST_SIGN_OPTS variable").
This allows per-board rimage customization at the CMake level. Example
in `zephyr/boards/xtensa/nxp_adsp_NEWBOARD/board.cmake`:
set(WEST_SIGN_OPTS -- -c rimage/config/special.toml)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Here we achieve 100% coverage for the quarantine module,
thanks to unit tests for QuarantineElement and QuarantineData dataclasses.
Implemented PR suggestions of gchwier.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
When building with the native simulator instead of attempting to
call directly to the host libC, use the trampolines provided
by the runner.
In this way we can build this code even if we are building
Zephyr with an embedded C library.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Updated the implementation of the GPIO_PORT_PIN_MASK_FROM_DT_NODE and
GPIO_PORT_PIN_MASK_FROM_DT_INST macros to support
"gpio-reserved-ranges" device tree property.
Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
Added
* GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, ngpios),
* GPIO_DT_RESERVED_RANGES(node_id),
* GPIO_DT_INST_RESERVED_RANGES_NGPIOS(inst, ngpios) and
* GPIO_DT_INST_RESERVED_RANGES(inst)
as DT gpio's "gpio-reserved-ranges" property missing support.
The array of pins range pairs as shown below now works.
Also implemented paired extended versions of
GPIO_PORT_PIN_MASK_FROM_NGPIOS macro:
* GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, ngpios) and
* GPIO_DT_INST_PORT_PIN_MASK_NGPIOS_EXC(inst, ngpios)
with reserved (ie EXCluded) pins support too.
The implementation constraint is inherited from common DT limitations:
a maximum of 64 pairs can be used, i.e. theoretically no more than
128-bit gpio ports are supported (but resulted bitmask is actually
limited by the size of gpio_port_pins_t type).
Usage example:
The reserved mask, defined in the device tree as:
gpio0: gpio0 {
....
ngpios=<32>;
gpio-reserved-ranges = <0 8>, <9 5>, <15 16>;
....
};
and used in driver configuration as:
{
...
.gpio_reserved = GPIO_DT_RESERVED_RANGES(DT_NODELABEL(gpio0)),
.pin_port_mask = GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(
DT_NODELABEL(gpio0),
DT_PROP(DT_NODELABEL(gpio0), ngpios)),
...
}
correctly converts to:
.gpio_reserved = 0x7fffbeff, 0b01111111 11111111 10111110 11111111)
.pin_port_mask = 0x80004100, 0b10000000 00000000 01000001 00000000)
Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
Add auxiliary lists Z_SPARSE_LIST_ODD_NUMBERS and
Z_SPARSE_LIST_EVEN_NUMBERS. These lists were originally created for
GPIO_DT_RESERVED_RANGES_NGPIOS macro, but may be useful for others
applications too.
Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
Flash API states that drivers should support write requests without
any restrictions on location or alignment of the source buffer.
Due to hardware limitations of the QSPI peripheral, the nrf_qspi_nor
driver currently fails to perform a write from a RAM buffer that is
not word-aligned. Fix this by using in such case the same mechanism
that is used when the source buffer is located in the internal flash
(copy data to a buffer located on stack).
Also correct the length parameter for writes from this stack-based
buffer to be the actual data chunk length, not always the size of
the buffer (as for CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE > 4
this may lead to overwriting of some data located next in the flash).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Split this tracing backend in a top and bottom to enable
building it with embedded libCs with the native simulator.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add UDC driver for STM32 based MCU, relying on HAL/PCD.
This has been tested with cdc_acm sample on the following boards:
- 96b_carbon (STM32F4)
- disco_l475_iot1 (STM32L4)
- nucleo_wb55rg (STM32WB)
- nucleo_h723zg (STM32H7)
- stm32f3_disco (STM32F3)
This fails at runtime for the following:
- b_u585i_iot2a (STM32U5)
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
The profile type "not set" uses the "default crypto config" header.
However platform may set their own crypto configuration headers.
SHA-512 algorithm is not the most common algorithm to support and
are for example disabled in profile types medium and small.
Change to SHA-256 which is much more common and is even needed
internally by TF-M for protected storage and sub-key derivation.
Update the QEMU icount setting to make the interrupt occur during
the secure call to TF-M.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add a semaphore to ensure that only one transaction
happens at a time when threads want to transfer
simultaneously.
Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
This fixes invalid memset of QoS parameters that may happen if Config
Qos operation is requested on ASE in QoS Configured state. In such case
if the requested parameters have been rejected, the ASE QoS parameters
shall remain unchanged (were memset instead). Otherwise, the stack shall
send QoS Configured state notification with cleaned up parameters (all
zero's) which was not done.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>