Previously, passing K_FOREVER to k_sleep() would return
immediately.
Forever is a long time. Even if woken up at some point,
we still had forever to sleep, so return K_FOREVER in this
case.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Entering irq_offload() on multiple CPUs can cause
difficult to debug/reproduce crashes. Demote irq_offload()
to non-inline (it never needed to be inline anyway) and
wrap the arch call in a semaphore.
Some tests which were unnecessarily killing threads
have been fixed; these threads exit by themselves anyway
and we won't leave the semaphore dangling.
The definition of z_arch_irq_offload() moved to
arch_interface.h as it only gets called by kernel C code.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit converts the existing hcm5883l 3-axis magnetometer
driver to use device tree for the I2C and GPIO selection.
It also adds a basic sample application for this sensor, using the
frdm-k64f development board to demonstrate how the interrupt
GPIO pin and I2C bus can be selected.
Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
Re-enable flash, ADC, and CAN related shell commands in the
board_shell test application.
This fixes commit 965aac39b6.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Update calls to nrfx HAL functions to reflect API changes introduced in
nrfx 2.0.0. All these functions are now called with the first parameter
pointing to the structure of registers of the relevant peripheral.
Also a few functions got renamed:
- nrf_gpiote_int_is_enabled to nrf_gpiote_int_enable_check
- nrf_gpiote_event_is_set to nrf_gpiote_event_check
- nrf_rng_event_get to nrf_rng_event_check
- nrf_rng_int_get to nrf_rng_int_enable_check
- nrf_rtc_event_pending to nrf_rtc_event_check
- nrf_rtc_int_is_enabled to nrf_rtc_int_enable_check
- nrf_timer_cc_read to nrf_timer_cc_get
- nrf_timer_cc_write to nrf_timer_cc_set
Default configuration values were removed from nrfx_config files,
so the drivers pwm_nrfx and spi_nrfx_spis no longer can use those.
Function nrfx_pwm_init() now takes one more parameter - context pointer
that is passed to the event handler, not used in the pwm_nrfx driver.
HALs for UART and UARTE now allow configuration of the parity type
and the number of stop bits, for SoCs that provide the corresponding
registers.
Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Convert bmg160 sensor driver and sample app to utilize device tree.
Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert bmm150 sensor driver and sample app to utilize device tree.
Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert max44009 sensor driver and sample app to utilize device tree.
Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert mcp9808 sensor driver and sample app to utilize device tree.
Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert sx9500 sensor driver and sample app to utilize device tree.
Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert tmp112 sensor driver and sample app to utilize device tree.
Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert th02 sensor driver and sample app to utilize device tree.
Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Mark the old time conversion APIs deprecated, leave compatibility
macros in place, and replace all usage with the new API.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The new conversion API has a ton of generated utilities. Test it via
enumerating each one of them and throwing a selection of both
hand-picked and random numbers at it. Works by using slightly
different math to compute the expected result and assuming that we
don't have symmetric bugs in both.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Promote the private z_arch_* namespace, which specifies
the interface between the core kernel and the
architecture code, to a new top-level namespace named
arch_*.
This allows our documentation generation to create
online documentation for this set of interfaces,
and this set of interfaces is worth treating in a
more formal way anyway.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Adding a Kconfig option for this test to configure the SPI in LOOP
mode. This saves physical wiring for hardware that support it.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Making CONFIG_SPI_ASYNC optional allows the test to be run on devices
where the feature is not yet supported in the driver.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Add EEPROM API test suite.
The test suite is written to run in userspace but it is currently only
whitelisted for native_posix and native_posix_64 boards which do not
support userspace.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Update the board overlays used in the i2c_slave_api tests to match the
new device tree bindings for atmel,at24 I2C EEPROMs.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
We add a new test-case for the mem_protect and userspace tests,
to test the ARMv8-M MPU driver without the skipping of full SRAM
partitioning (i.e. gap filling).
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit refactors kernel and arch headers to establish a boundary
between private and public interface headers.
The refactoring strategy used in this commit is detailed in the issue
This commit introduces the following major changes:
1. Establish a clear boundary between private and public headers by
removing "kernel/include" and "arch/*/include" from the global
include paths. Ideally, only kernel/ and arch/*/ source files should
reference the headers in these directories. If these headers must be
used by a component, these include paths shall be manually added to
the CMakeLists.txt file of the component. This is intended to
discourage applications from including private kernel and arch
headers either knowingly and unknowingly.
- kernel/include/ (PRIVATE)
This directory contains the private headers that provide private
kernel definitions which should not be visible outside the kernel
and arch source code. All public kernel definitions must be added
to an appropriate header located under include/.
- arch/*/include/ (PRIVATE)
This directory contains the private headers that provide private
architecture-specific definitions which should not be visible
outside the arch and kernel source code. All public architecture-
specific definitions must be added to an appropriate header located
under include/arch/*/.
- include/ AND include/sys/ (PUBLIC)
This directory contains the public headers that provide public
kernel definitions which can be referenced by both kernel and
application code.
- include/arch/*/ (PUBLIC)
This directory contains the public headers that provide public
architecture-specific definitions which can be referenced by both
kernel and application code.
2. Split arch_interface.h into "kernel-to-arch interface" and "public
arch interface" divisions.
- kernel/include/kernel_arch_interface.h
* provides private "kernel-to-arch interface" definition.
* includes arch/*/include/kernel_arch_func.h to ensure that the
interface function implementations are always available.
* includes sys/arch_interface.h so that public arch interface
definitions are automatically included when including this file.
- arch/*/include/kernel_arch_func.h
* provides architecture-specific "kernel-to-arch interface"
implementation.
* only the functions that will be used in kernel and arch source
files are defined here.
- include/sys/arch_interface.h
* provides "public arch interface" definition.
* includes include/arch/arch_inlines.h to ensure that the
architecture-specific public inline interface function
implementations are always available.
- include/arch/arch_inlines.h
* includes architecture-specific arch_inlines.h in
include/arch/*/arch_inline.h.
- include/arch/*/arch_inline.h
* provides architecture-specific "public arch interface" inline
function implementation.
* supersedes include/sys/arch_inline.h.
3. Refactor kernel and the existing architecture implementations.
- Remove circular dependency of kernel and arch headers. The
following general rules should be observed:
* Never include any private headers from public headers
* Never include kernel_internal.h in kernel_arch_data.h
* Always include kernel_arch_data.h from kernel_arch_func.h
* Never include kernel.h from kernel_struct.h either directly or
indirectly. Only add the kernel structures that must be referenced
from public arch headers in this file.
- Relocate syscall_handler.h to include/ so it can be used in the
public code. This is necessary because many user-mode public codes
reference the functions defined in this header.
- Relocate kernel_arch_thread.h to include/arch/*/thread.h. This is
necessary to provide architecture-specific thread definition for
'struct k_thread' in kernel.h.
- Remove any private header dependencies from public headers using
the following methods:
* If dependency is not required, simply omit
* If dependency is required,
- Relocate a portion of the required dependencies from the
private header to an appropriate public header OR
- Relocate the required private header to make it public.
This commit supersedes #20047, addresses #19666, and fixes#3056.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Running the test under valgrind identified three places where an
uninitialized stack buffer was used as the source of data over which a
CRC was incidently calculated, causing an uninitialized value warning
in the CRC calculation. Zero out the source buffers before using them
as a data source.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit limits the data length code to eight.
DLC > 8 returns a newly introduced CAN_TX_EINVAL error code.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
Replace CONFIG_WDT_0_NAME with DT_ALIAS_WATCHDOG_0_LABEL in samples and
test code. Now that all drivers are DT aware we don't ever set the
Kconfig option.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Update lis3mdl-magn dts binding to include GPIO interrupt pin and change
driver code to get the GPIO pin and controller info from DT instead of
Kconfig.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Parse output of test to verify success, this was previously treated as a
test and now it is using the console handler, so we need to verify
success using regex.
Fixes: #20177
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Previous defconfig for dma is DMA_STM32F4X in this board, while the new
generic driver uses DMA_STM32 to enable DMA support, and also dma driver
of stm32 now needs HEAP_MEM_POOL_SIZE to be big enough to hold dma
stream instances.
Additional .conf files are added for also adding HEAP_MEM_POOL_SIZE
configuration to two test cases.
Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
Tests fail with the default 512 byte main stack size. Increase it
just as the idle stack size has been increased over default.
Closes#20202
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Updated tests/crypto/rand32/ to include cryptographic test cases.
Added config file for rand32_ctr_drbg generator.
Signed-off-by: David Leach <david.leach@nxp.com>
Use this short header style in all Kconfig files:
# <description>
# <copyright>
# <license>
...
Also change all <description>s from
# Kconfig[.extension] - Foo-related options
to just
# Foo-related options
It's clear enough that it's about Kconfig.
The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)
git ls-files '*Kconfig*' | \
xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
convert sample and test yaml filters that utilize a DT_ define to
instead use a dt_ function. The intent is to remove the Kconfig
generated DT defines and just make directy queries into the device tree.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Using a device with a kernel clock below 1MHz (e.g. nRF52) resulted in
a division by zero. Added support for such devices by multiplying
before dividing.
Signed-off-by: Mario Noseda <mario.noseda@zhaw.ch>
Some cleanup in tests code as after duplicates filtering
was introduced there is no need to interpret 0-length readout in
settings h_set handler
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added a Kconfig option to disable Zephyrs cpp implementation for
operator new, delete, pure virtual functions and vtables.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
Confirm that std::make_unique<> functions as intended. This is an
indirect test of new/delete using best-practices API.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
the following compile warning will fail the CI:
/zephyr/tests/kernel/fp_sharing/generic/src/float_regs_arc_gcc.h:
41:8: error: /unused variable 'temp' [-Werror=unused-variable]
/zephyr/tests/kernel/fp_sharing/generic/src/float_regs_arc_gcc.h:
75:8: error: /unused variable 'temp' [-Werror=unused-variable]
cc1: all warnings being treated as errors
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>