Commit cd7c44a152
("Kconfig: flag LEGACY_INCLUDE_PATH as deprecated") forgot to select
DEPRECATED when deprecating a Kconfig option. Fix it.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The introduction of sysbuild and west build / flash / debug / etc.
support raises questions regarding how to handle user specified runner
arguments.
Some arguments may be acceptable for all domains, whereas others are
only valid for a single or few domains in a multi domain build.
Therefore, consider the usages of runner specific options experimental
when applied to multiple domains.
The following warning is printed to the user when using runner specific
arguments on multiple domains:
> WARNING: Specifying runner options for multiple domains is
> experimental.
> If problems are experienced, please specify a single domain using
> '--domain <domain>'
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Wire this up the same way ASAN works. Right now it's support only by
recent clang versions (not gcc), and only in 64 bit mode. But it's
capable of detecting uninitialized data reads, which ASAN is not.
This support is wired into the sys_heap (and thus k_heap/k_malloc)
layers, allowing detection of heap misuse like use-after-free. Note
that there is one false negative lurking: due to complexity, in the
case where a sys_heap_realloc() call is able to shrink memory in
place, the now-unused suffix is not marked uninitialized immediately,
making it impossible to detect use-after-free of those particular
bytes. But the system will recover cleanly the next time the memory
gets allocated.
Also no attempt was made to integrate this handling into the newlib or
picolibc allocators, though that should hopefully be possible via
similar means.
Signed-off-by: Andy Ross <andyross@google.com>
This had bitrotten a bit, and didn't build as shipped. Current
libasan implementations want -fsanitize=address passed as a linker
argument too. We have grown a "lld" linker variant that needs the
same cmake treatment as the "ld" binutils one, but never got it. But
the various flags had been cut/pasted around to different places, with
slightly different forms. That's really sort of a mess, as sanitizer
support was only ever support with host toolchains for native_posix
(and AFAICT no one anywhere has made this work on cross compilers in
an embedded environment). And the separate "gcc" vs. "llvm" layers
were silly, as there has only ever been one API for this feature (from
LLVM, then picked up compatibly by gcc).
Pull this stuff out and just do it in one place in the posix arch for
simplicity.
Also recent sanitizers are trying to add instrumentation padding
around data that we use linker trickery to pack tightly
(c.f. SYS_INIT, STRUCT_SECTION_ITERABLE) and we need a way
("__noasan") to turn that off. Actually for gcc, it was enough to
just make the records const (already true for most of them, except a
native_posix init struct), but clang apparently isn't smart enough.
Finally, add an ASAN_RECOVER kconfig that enables the use of
"halt_on_error=0" in $ASAN_OPTIONS, which continues execution past the
first error.
Signed-off-by: Andy Ross <andyross@google.com>
On Debian, llvm-obj{copy,dump} tools are installed with a version
suffix. Look first for a version that matches our compiler when
probing for tool paths before trying the bare version, or falling back
to GNU binutils.
Signed-off-by: Andy Ross <andyross@google.com>
There's no point to doing this when the host OS clears all memory at
mapping time. And as it turns out, the __bss_end symbol it was
relying on actually comes from the host toolchain's linker, not our
own linker scripts (making it semi-dangerous to rely on). And it's
not present in clang/lld output anyway.
Signed-off-by: Andy Ross <andyross@google.com>
Removes references to the label property in devicetree, replacing
them with node label where appropriate.
Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
The gpio-leds binding is meant for LED drivers, not GPIO. As in Linux,
move the binding to the led folder.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
gpio-keys binding has been used in Zephyr to describe random push
buttons in boards. On Linux, it is used by a keyboard input driver,
while in Zephyr is, in most cases, used directly in applications out of
the device driver model. This should likely be _fixed_ if one day we
have a proper input device class. Still, we can align a few things:
- Inherit from base.yaml (we need status, compatible, etc defined there)
- Remove the requirement of a label in child nodes
- Fix child nodes label description
- Move to dts/bindings/input
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Don't import the label prop from base.yaml as it is marked deprecated.
This lets the various tests that still use DT_LABEL() to work properly.
Signed-off-by: Kumar Gala <galak@kernel.org>
Mark 'label' property as deprecated in base.yaml. 'label' is still
defined and valid for specific bindings to specify like gpio-keys.yaml
or fixed-partitions.yaml.
Signed-off-by: Kumar Gala <galak@kernel.org>
Rename the can_state enumerations to contain the word STATE to make their
meaning more clear:
- CAN_ERROR_ACTIVE => CAN_STATE_ERROR_ACTIVE
- CAN_ERROR_WARNING => CAN_STATE_ERROR_WARNING
- CAN_ERROR_PASSIVE => CAN_STATE_ERROR_PASSIVE
- CAN_BUS_OFF => CAN_STATE_BUS_OFF
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Expand the error return values reported by the CAN timing calculation
functions to be able to distinguish between an an out of range
bitrate/sample point, an unsupported bitrate, and a resulting sample point
outside the guard limit.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Move the check for the maximum allowed CAN bitrate to the corresponding
can_calc_timing()/can_calc_timing_data() function.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The test case "samples/boards/mec15xxevb_assy6853/power_management" could
always pass until commit 5f60164 was merged in. This patch changes the sem
take timeout value from 50ms to forever of the log thread, it will make the
idle thread run longer and takes more stack memory. Analyzed the coredump
of the failed test case, it can be found that the test case stucks at
z_idle_stacks. The test case used default CONFIG_IDLE_STACK_SIZE = 256 in
kernel/Kconfig, now we increase the value to 512 in prj.conf for this test
only. With this change, the test case can pass with the commit of 5f60164.
Fixes#47987
Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
The bluetooth/controller/ctrl_cte_req wrongly defaulted to old Ztest API
after the introduction of the new unit_testing board.
Enforce use of CONFIG_ZTEST_NEW_API to get test working again.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This is a follow-up to commit e1c0a494b3.
The `tca954x_transfer()` function cannot call `i2c_transfer_dt()`,
because the I2C device address used in the transaction must be the one
passed as the `addr` parameter, not the address of the TCA954xA switch
itself. Hence, this commit restores the call to `i2c_transfer()`.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
There is a typo in argument for the STATS_NAME_INIT_PARMS macro.
This causes an error during build.
The correct reference should be "pm_stats".
Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
Previous versions were using, incorrectly, the host in/out regblock size
of 40 bytes for all peripherals when in fact the link in/out regblock size
is 20 bytes in size.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
The `off_t` type, which is specified by the POSIX standard as a signed
integer type representing file sizes, was defined as `long` or `int`
depending on the target architecture without a clear explanation on why
it was defined as such.
While the POSIX standard does not specify the size requirement of the
`off_t` type, it generally corresponds to the size of a pointer in
practice, mainly because the optimal file handling size is closely tied
to the native pointer size.
For this reason, this commit removes the per-architecture `off_t`
definition and defines it as `intptr_t` such that its size always
matches the native pointer size.
Note that the toolchain-defined `__INTPTR_TYPE__` macro is used instead
of the `intptr_t` typedef as per the common convention used in the C
standard library headers.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Extend the existing documentation by documenting the command itself and
the format of the module.yml blobs section.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The `<module>/zephyr/blobs/` folder, as well as any additional
sub-folders that might be required under `blobs/` may not exist when
fetching a blob. Ensure that the folder exists, create it if it doesn't.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The new "clean" blobs sub-command deletes any blobs present on the
filesystem.
Also improve the help text for sub-commands.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
To align with other commands, such as "west update", convert the
accumulative -m option into an nargs="*"-type one that takes the list of
modules directly without a flag.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Instead of both listing and fetching only the blobs in the
modules listed by the user in the command-line, default to
listing/fetching them all for ease-of-use and consistency with other
commands. Remove the --all options since it's meaningless now.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This adds the bits so that we can use qemu_x86_tiny for
coverage, as this is currently the only board that can do
demand paging.
This uses the board revision as a way to specify the RAM
size as coverage requires more memory available to store
the coverage data. By piggybacking onto board revision,
this avoids adding another board config just for coverage.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
When coverage is enabled, some boards require more stack space
for the custom threads created in main(). Since this "samples"
already has CONFIG_TEST enabled, we can pad the stack size
with CONFIG_TEST_EXTRA_STACK_SIZE.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the bits to pin the GCOV sections to the pinned
sections so they can be accessed during boot when demand
paging is enabled. Or else accessing them would result in
page faults.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds an ALIGN statement to the rodata linker snippet
for coverage. Without this, sometimes the section is not
aligned, but __init_array_start indicates an aligned
address, resulting in incorrect function pointers.
So align it.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds an extra layer to match the revision part where this
needs to be of permitted patterns as described in.
cmake/modules/extensions.cmake. Without this, the matching
may produce undesirable results. For example, if there is
a file named qemu_x86_tiny_1.conf, the testplan will create
a board name qemu_x86@tiny.1 (which is definitely not correct).
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fix a call that writes Register 29 - Accelerometer Configuration 2.
Due to an obvious copy-paste mistake in the code, this register was
written with a DLPF setting from devicetree intended for gyroscope,
not for accelerometer (and the latter was effectively ignored).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The two macros are the same in this context. But an SoC may
redefine the GROUP_LINK_IN() macro which could introduce an
unintended change in this part of the linker script.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Currently __rom_region_end points to the virtual memory address, while
__rom_region_start points to the load memory address. In most cases the
two address spaces will be the same. In the case of the infineon xmc4xxx
series they can be different because flash can be read via a different
cachable address space.
Evaluate __rom_region_end as an offset from __rom_region_start to fix this
possible issue.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
If the rom region can be accessed via a virtual memory address,
then __rodata_region_end will point to the vma, while __rom_region_start
is the lma. This patch makes sure the two values are in the vma address
space.
This is in prepartion for a future patch which will allow the rom to be
accessed via a virtual memory address.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This is needed when the flash can be accessed via a different vma
address as in the case of the infineon xmc4xxx series where 0xc000000
is the uncached start address and 0x8000000 is the cached start address.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit removes CONFIG defines from main.c and instead uses the
proper Kconfig handling of specifying extra Kconfig options in
testcase.yaml.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With Kconfig support in unittest the bluetooth ctrl_data_length_update
test fails because the symbols being configured are promptless or
disabled because of dependencies.
Add a Kconfig file to make needed symbols visible in unittest mode.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With the support of Kconfig in unittest CMake module then prj.conf is
now supported.
Add a prj.conf with ZTEST config settings and remove hardcoded values
from CMakeLists.txt file.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Remove boilerplate code:
> if (NOT BOARD STREQUAL unit_testing)
> message(FATAL_ERROR "This project can only be used with...")
> endif()
as that is now handled by boards.cmake when validating the board.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit introduces a dedicated unit testing board.
Today, a dedicated Zephyr unit testing scheme exists but is different
from how a Zephyr build generally works.
For example Kconfig is not possible, resulting on various different
hacks to pass Kconfig settings from test cases / testcase.yaml through
CMake to the code.
Some directly as compile definitions, some as header files with forced
inclusion on sources, some with wrapper flags which again results in
different define being enabled. There is even cases where a second
forced header inclusion undefines previous defines.
Unit test often does a manual check for the right boards, like this:
> if (NOT BOARD STREQUAL unit_testing)
> message(FATAL_ERROR "This project can only be used with...")
> endif()
Introducing a dedicated unit_testing board under `tests/root` allows
us to use Kconfig in unit test samples, and thus proper `prj.conf` and
extra Kconfig fragments.
Generation of autoconf.h so the overall architecture follows regular
Zephyr builds.
Proper and uniform error messages when invalid board is selected.
The unit_testing board and arch is located under: `subsys/testsuite` so
that it is only available when find_package(Zephyr COMPONENTS unittest)
is used, and not available for regular Zephyr builds.
Kconfig generates autoconf.h which is applied as compile flag to
test binary which means that kconfig defines placed in ztest.h can now
be removed.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Changing $(ARCH_DIR)/common/Kconfig to arch/common/Kconfig.
The use of ARCH_DIR at this place is wrong, as it suddenly requires out
of tree archs to support a common/Kconfig file, which may make no sense
to them.
If an out of tree arch wants to place common Kconfig code in a common
Kconfig file, that's their choice and they should source such file
themselves.
Instead just source the Zephyr arch common file directly.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Change sourcing of generated Kconfig.module to be optional.
It should be possible to run parse the Zephyr Kconfig tree even if the
Kconfig.modules file has not been generated.
This can be useful in testing where you may wish to run without Zephyr
modules present, and thus not load the Zephyr module CMake module.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The Zephyr CMake module kconfig.cmake will create files inside
KCONFIG_BINARY_DIR.
In a default Zephyr build setup, this directory is created by Zephyr
CMake module zephyr_module.cmake. But Zephyr CMake modules are modular
and thus it must be possible to use kconfig module without
zephyr_module.
Thus kconfig.cmake must set and create KCONFIG_BINARY_DIR if it does not
already exists.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Remove ZEPHYR_BASE as default root in list_boards.py.
This allows list_boards.py to be used to only print boards at given
root(s) without printing Zephyr default boards.
Secondly it remove the need in list_boards.py to have any knowledge of
ZEPHYR_BASE.
The `west boards` command already has ZEPHYR_BASE knowledge and can
easily add ZEPHYR_BASE to the list of roots it is already constructing,
thus removing the need for knowing that ZEPHYR_BASE is always added.
Update boards.cmake to pass ZEPHYR_BASE as an additional arch root, as
arch.cmake has not yet been processed,which means ZEPHYR_BASE is missing
in ARCH_ROOT list at this point in time.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Move gpio_cmsdk_ahb.h out of drivers/gpio and into include/drivers/gpio.
This is used by few board files so it should be in include.
This allows to remove few odd
"zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)".
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>