Add test for a proprietary HCI Vendor-Specific event.
In the test the controller is replaced with a small stub controller,
with limited support of the initialization flow from the host.
After initialization, a HCI prop event callback is registered and an
prop event is triggered and sent to the host. It is then verified that
the registered callback is called.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Add LiteX timer driver with bindings for this device.
Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
Add an option for building with newlib-nano library.
The newlib-nano library for ARM embedded processors is a part of the
GNU Tools for ARM Embedded Processors.
Add mem_alloc tests with newlib nano.
Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
Reduced Kconfig for counter with nRF TIMER and RTC. Added overlays
for TIMER and RTC configuration in the counter test.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The implementation of the <misc/math_extras.h> functions will use the
portable C code when PORTABLE_MISC_MATH_EXTRAS is defined before
including the header.
Use this feature macro to make sure that the unit test always tests the
portable functions in addition to the ones using builtins for the
current compiler.
Signed-off-by: Jakob Olesen <jolesen@fb.com>
Add a <misc/math_extras.h> header file with portable implementations of
a number of commonly used math and bit counting operations that are not
available in the C programming language.
The math_extras functions fall into two groups:
1. Unsigned integer arithmetic with overflow detection. Addition and
multiplication are provides for the u32_t, u64_t, and size_t types.
This commit doesn't include subtraction and division, and there are
no signed operations. These could be added later if there is a need.
2. Bit-counting operations like clz, ctz, and ffs. These are provided
for u32_t and u64_t only. I don't see a need for size_t operations,
but they could be added if needed.
A follow-on commit will add more efficient implementations using
compiler builtins for those compilers that support it.
Another commit will replace other uses of "naked" compiler builtins with
calls to these functions.
Signed-off-by: Jakob Olesen <jolesen@fb.com>
Enable the counter capability in the board and add a .conf file for the
nRF52810 running on the PCA10040 board.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit adds support for board: nrf52811_PCA10056.
The nRF52840 DK: PCA10056 is the recommend development kit, it emulates
the nRF52811, and can be used as a starting point for development
before moving over to a custom board.
Please note that this development kit does not support Bluetooth
Direction Finding. What is more it cannot be used with most of Arduino
shields because of PCA10056 PIN layout.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Added basic tests for the NVS file system. One of the tests covers power
down during the flash write operation.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Define DT_CAN_1_NAME as an empty string if it is not defined.
This is useful for buildtest where no HW is available.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit extends the CAN api can_send function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between sent masseges
when they use the same callback.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit extends the CAN api attach_isr function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between filter matches
when they use the same callback.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
During the write abort test, a second write is started then quickly
aborted. This means that the number of bytes sent is relative
to that second write. So when comparing it against the number
of bytes received which is NOT reset, the first (completed)
send of five bytes has to be accounted for. The current
nrfx implementations abort quick enough that no bytes are reported
sent, so this wasn't currently being exercised (i.e. the short
circuit of zero bytes sent was taken).
Tested on nrf52840_pca10056.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
Some configuration for the boards have to be added into test_adc.c file
so user can test driver with the test cases. Several nucleo boards are
added including F091RC/F103RB/F207ZG/F302R8/F401RE/F746ZG/L073RZ/L476RG.
And also ADC dts and pinmux configuration are added into boards own
pinmux.c and dts file.
Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
According to POSIX, that's the header which defines this function.
Similarly, nothing in POSIX indicates that <time.h> should have
access to struct timeval, so it's removed (it's made accessible
to <sys/time.h> via <sys/_timeval.h> introduced earlier).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
It is convenient to have a blocking version of
`mqtt_read_publish_payload` function, for cases when it is called from
the event handler. Therefore, extend the 'mqtt_read_publish_payload'
argument list with information whether the call should block or not.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This adds generic support for any board using the SAM0 ADC driver.
The test selects the internal input from the scaled I/O voltage,
which is always available on the ADC.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
There were various flaws in it that motivated its removal:
- No hash collision handling mechanism. In case that would happen, the
behavior of the network connection would be unknown. This is the main
drawback
- The lookup is not that much more efficient than the default one. The
only difference of gain is in connection comparison (a u32t comparison
vs a full connection compare). But the list handling is the same. It's
made worse by the presence of a negatives match array which can be
easily filled in and becomes then fully usless, appart from consuming
CPU. As well as adding a new connection: it requires the whole cache
to be cleared which is unefficient.
- Not memory efficient, even compared to a proper hash table.
Two arrays instead of one etc...
All of this could be fixed by using a proper hash table, though it
remains to be seen if such object could fit in Zephyr core.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Inside function test_net_pkt_basics_of_rw result of function call
net_pkt_read_be16 is not checked which might result performance
of the program and cause errors.
Coverity-CID 198003
Fixes#15776
Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
Fixes the compile errors in various platforms like:
* sam_e70_xplained (too few network buffers)
* galileo, cc3220sf_launchxl and mps2_an385 (missing random number
generator configuration options)
Fixes#15878
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This test uses ztest anyway, the default should be fine
just like any other test running under ztest.
k_thread_create() uses a lot of stack, and the main
stack size is very small if ztest is enabled. Do it in
another ztest task instead.
We don't need to mess with the main thread's priority,
just have the alt thread run cooperatively.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
net_if_ipv6_calc_reachable_time() requires sys_rand32_get().
Enable the test random number generator so the build doesn't
fail.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
There are limits to CMSIS stack sizes, we can't just
add a number to it. Use the configured maximum.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Set to same default as regular stacks. This doesn't use
any extra memory until CMSIS_V2_THREAD_DYNAMIC_MAX_COUNT
is set. 0 is not a valid default if that is set.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The various struct pipe_sequence were not located in memory
accessible to user mode. With optimization turned on, they
weren't in memory at all, but with code coverage enabled
the arrays were actually being read, resulting in memory
access failures from user mode.
Fix them by placing in ROM, they never get modified.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
device_get_binding() compares pointers first before doing strcmp().
However, enabling coverage forces -O0 to disable any compiler
optimizations. There would be multiple copies of the same string,
and the code pathing doing pointer comparsion would not be tested
at all. So add this flag to merge string constants such that
the pointer comparison would be exercised.
This also adds a bad driver which fails initialization. This is
to make sure that execution path is covered.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
As the getaddrinfo() test is suppose to be self contained, then
we will need to install handler for the sent DNS query. After we
receive the query in process_dns() thread, we verify that the
query was sent properly. We do not return DNS reply back to
the caller in this case as we do not want to create DNS server
just for this simple test application. This can be changed later
if we get DNS server functionality in Zephyr network stack.
Fixes#15193
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>