Commit Graph

6800 Commits

Author SHA1 Message Date
Daniel Leung bb595a85f1 kernel: mem_domain: add/remove partition funcs to return errors
This changes both k_mem_domain_add_partition() and
k_mem_domain_remove_partition() to return errors instead of
asserting when errors are encountered. This gives the application
chance to recover.

The arch_mem_domain_parition_add()/_remove() will be modified
later together with all the other arch_mem_domain_*() changes
since the architecture code for partition addition and removal
functions usually cannot be separately changed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Daniel Leung fb91ce2e21 kernel: mem_domain: init function to return error values
This changes k_mem_domain_init() to return error values
instead of asserting when errors are encountered.
This gives applications a chance to recover if needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Daniel Leung 2ffd49310a tests: mem_protect/mem_protect: more tables for QEMU Cortex A53
For qemu_cortex_a53 on the mem_protect test, the test
test_mem_domain_init_fail() fails due to not having enough
translation tables. However, since ARM64 MMU asserts on such
condition, and k_mem_domain_init() also asserts when fails,
there is no way to distinguish these two assertions at runtime,
thus the test was considered passing. Fix this by allocating
a few more tables so the test will actually fail on
k_mem_domain_init().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Andries Kruithof 9a9ccfec15 tests: edtt run gap and gatt tests with new LLCP
For consistency we run the gatt and gap tests also with the new
LLCP. The test lists for legacy and new LLCP are identical
and therefor no separate test lists have been introduced

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-20 11:59:04 -05:00
Krzysztof Chruscinski cc94cfd113 tests: logging: log_benchmark: Prevent flushing logs by ztest
Test is using logging in a different way and flushing logs
after each test case would not work.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-20 11:58:40 -05:00
Andrei Emeltchenko 89becd0b87 ibecc: tests: Increase test coverage
Increase test coverage with simulation of reading  IBECC_ECC_ERROR_LOG
and IBECC_PARITY_ERROR_LOG.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andrei Emeltchenko d11fae6d06 edac: ibecc: Return -ENODATA on zero log
Return -ENODATA when we read zero log.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andrei Emeltchenko 0feb432b8e ibecc: tests: Update test logging
Make logging more clear.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andrei Emeltchenko 6c6645bf47 edac: tests: Add more coverage tests
Add more test for better coverage of some static functions.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andries Kruithof 9191dd77da tests: controller: give mock-file same name as in BT controller
Rename the mockup file from ull_periph.c into ull_peripheral.c
so that it has the same name as its equivalent in the BT
controller

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-20 08:01:14 -05:00
Wealian Liao eb5f711b7b test: driver: buildall: Add NCT38XX gpio
Add support NCT38XX I2C-based GPIO in build all test.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-11-20 08:00:38 -05:00
Szymon Janc d268c99266 test/bluetooth/tester: Re-pair on lost bond
If IUT is acting as a central device and peer lost bond we need
to re-pair to restore bond. PTS is not sending any WID for this
so bonding needs to be initiated implicitly by IUT.

This was affecting GAP/SEC/AUT/BV-25-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-19 20:11:34 +01:00
Tomasz Bursztyka f6be2835bd drivers: Apply SPI API change to relevant places
Mostly drivers, but also one sample and one test.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-19 11:50:38 +01:00
Gerard Marull-Paretas a6a296d050 tests: posix: common: increase main stack for TLS tests
Increase main stack size (in 128 bytes) to make these tests run
successfully on qemu_x86 platform.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Gerard Marull-Paretas 39f21dc116 tests: pm: use new PM macros
Use PM_DEVICE_STATE_DEFINE to define PM state.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Gerard Marull-Paretas 1832d68e01 tests: lib: devicetree: add tests for DT_INST_ENUM_IDX(_OR)
Add tests for the instance based enum macros DT_INST_ENUM_IDX and
DT_INST_ENUM_IDX_OR.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-18 19:12:07 -05:00
Andries Kruithof 9ee28afe9f tests: controller: remove outdated comment
The comment 'kconfig cheats' is outdated and misleading
and thus it must be removed

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-18 19:03:43 -05:00
Vinayak Kariappa Chettimada 640e20204c tests: Bluetooth: bsim: Use host BIG Sync APIs
Use the host BIG Sync APIs to test the BIG Sync establish
and Sync Terminate implementation in the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada 000833e427 tests: Bluetooth: bsim: Updates related to BIG Create Sync
Updates related to BIG Create Sync testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada d5489837cf tests: bluetooth: bsim: Receive the BIG Info callback
Added implementation to receive the BIG Info callback.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada 91be9f1001 tests: Bluetooth: bsim: Fix test_iso to sync periodic advertising
Fix the bsim test_iso application so as to sync with periodic
adveritising. Increase the timeout so that the test passes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada 71e15176e1 Bluetooth: controller: BIGInfo in ACAD with mandatory parameters
Construction of BIGInfo with mandatory parameters and
placing it in the ACAD of Periodic Advertising PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada 136bb35111 tests: Bluetooth: bsim: Check ISO allocation release on terminate
Added tests to check Broadcast ISO allocations are released
on terminate, and new Broadcast ISO create is successful.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Johann Fischer c77903996b tests: remove usage of CONFIG_USB_UART_CONSOLE
Remove option CONFIG_USB_UART_CONSOLE where it has no influence
or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking
a detour through CONFIG_USB_UART_CONSOLE.

Check the compatibility of chosen property instead
of usage of CONFIG_USB_UART_CONSOLE option.
Align how to wait for the readiness of CDC ACM UART.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-18 14:29:18 +01:00
Thomas Stranger 9e852644a8 tests: drivers: flash: change integration_platforms
drivers.flash.nrf_qspi_nor and drivers.flash.soc_flash_nrf:
keep nrf52840dk_nrf52840 as integration_platform

drivers.flash.default:
Use mimxrt1060_evk instead as integration_platform,
this is the only platform allowed.

drivers.flash.stm32:
Add a bunch of boards as integration_platforms for
this test configuration.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-11-17 11:06:59 -05:00
Andries Kruithof f023b5f611 Bluetooth: controller: push topic branch to main
Pushes all work done in the topic-ble-llcp branch into main branch
This is a refactoring of the LL control procedures; the refactored
control procedures are hidden behind a KConfig option and
per default disabled

Goal of the refactoring:

close issue Link Layer Control Procedure overhaul #15256
make it easier to add/update control procedures
Refactoring consists in principal of writing explicit state machines
for the control procedures.
To reduce the risk of regression errors unit-tests have been added

Following control procedures are implemented:

Connection update procedure
Channel map update procedure
Encryption procedure
Feature exchange procedure
Version exchange procedure
ACL termination procedure
Connection parameters request procedure
LE Ping procedure
Data Length Update procedure
PHY update procedure
Min. nr. Of channels used procedure
Constant Tone extension request procedure

This is a joined work by the people listed in the signed-off-by
list (in alphabetical order)

Signed-off-by: Andries Kruithof Andries.Kruithof@nordicsemi.no
Signed-off-by: Erik Brockhoff erbr@oticon.com
Signed-off-by: Piotr Pryga piotr.pryga@nordicsemi.no
Signed-off-by: Szymon Janc szymon.janc@codecoup.pl
Signed-off-by: Thomas Ebert Hansen thoh@oticon.com
Signed-off-by: Tommie Skriver tosk@demant.com

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-16 21:24:37 -05:00
Alexandre Bourdiol 022bb25691 tests: drivers: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Francois Ramu eeb6921f34 tests: spi: spi loopback test running on the stm32f767zi nucleo
Add support of the tests/drivers/spi/spi_loopabck
with dma (V1).
Connect MISO pin (D12) to MOSI (D11) pin on the board
to pass the test.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-16 10:12:39 -05:00
Francois Ramu dfc6611a31 tests: spi: loopback testing with NOCACHE MEMORY buffers for DMA
This patch is defining Tx buffers in NON CACHE memory for using
with DMA transfers. This requires the CONFIG_NOCACHE_MEMORY=y
flag when mcu is using CACHE.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-16 10:12:39 -05:00
Christopher Friedt ed7eec4c94 tests: kernel: atomics: expand atomic operations to 64-bit
This change updates the atomic tests to validate 32-bits on
32-bit architectures and 64-bits on 64-bit architectures.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt 3e86c627f7 kernel: atomics: update print specifiers for atomic_t
The print specifier for `atomic_t` should be updated
to `%ld`, `%lu`, or `%lx` to account for the type
change of `atomic_t` to `long`.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Enjia Mai 9ed986ae64 tests: logging: adjust the structure of logging test cases
Adjust the logging test case code to make them the same as other test
cases which deal with the CONFIG_USERSPACE used. It does not change
the original test logic, but just the file structure changed.

It also corrects the duplicated testsuite name of logging testcases.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2021-11-15 10:17:25 +01:00
Emil Gydesen 7b73472139 Bluetooth: shell: Enable ISO for the BT shell
Enable ISO (unicast and broadcast) for the BT shell.
This allows users to use the ISO features (if supported by
the controller) in the shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-13 08:00:16 -05:00
Herman Berget 49c2c37417 tests: bluetooth: tester: Reading multiple variable length
Adds support for reading multiple variable length characteristics.
Previously read_multiple() always set the variable flag to false.

This is used by GATT/CL/GAT/BV-03-C.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2021-11-13 07:54:27 -05:00
Lixin Guo 21e1e8cf23 tests: work_queue: add a test case for coverage
Add a test case for k_work_poll_cancel() API.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2021-11-12 11:56:23 -05:00
Vinayak Kariappa Chettimada 6820141a3b tests: Bluetooth: bsim: Check duplicate Periodic Adv Sync create
Add test to check duplicate Periodic Advertiser Sync Create
is not permitted.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-12 14:08:19 +01:00
Chen Peng1 f4cf484ac6 tests: heap: validate sys_heap_runtime_stats_get API
Add CONFIG_SYS_HEAP_RUNTIME_STATS in existing heap tests
to enable validation for sys_heap_runtime_stats_get API.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-11-11 16:21:43 -05:00
Martí Bolívar 7ff74e0ab9 Bluetooth: controller: support FEMs via devicetree
A FEM in this case is an external Front-End Module. This is basically
a range booster with some extra amplification in the TX and RX paths.

This feature is supported for the Nordic open source controller. See
the changes to the ubx_bmd345eval_nrf52840 board for a quick summary
of what you have to do to take advantage of this.

(This patch doesn't actually remove the feature in the openisa HAL,
though, because that never implemented the required GPIO handling
routines.)

We are using the 'fem' property previously added to the
nordic,nrf-radio's devicetree binding, which points to the FEM that is
in use. If you have this property and the node it points to is
enabled, the controller subsystem respects it. Otherwise, FEM support
is disabled.

This obsoletes the following Kconfig options, which are now unused:

- CONFIG_BT_CTLR_GPIO_PA
- CONFIG_BT_CTLR_GPIO_PA_PIN
- CONFIG_BT_CTLR_GPIO_PA_POL_INV
- CONFIG_BT_CTLR_GPIO_PA_OFFSET

- CONFIG_BT_CTLR_GPIO_LNA
- CONFIG_BT_CTLR_GPIO_LNA_PIN
- CONFIG_BT_CTLR_GPIO_LNA_POL_INV
- CONFIG_BT_CTLR_GPIO_LNA_OFFSET

- CONFIG_BT_CTLR_FEM_NRF21540
- CONFIG_BT_CTLR_GPIO_PDN_PIN
- CONFIG_BT_CTLR_GPIO_PDN_POL_INV
- CONFIG_BT_CTLR_GPIO_CSN_PIN
- CONFIG_BT_CTLR_GPIO_CSN_POL_INV
- CONFIG_BT_CTLR_GPIO_PDN_CSN_OFFSET

The PA and LNA pins are now specified via fem-specific devicetree
properties in the FEM node:

- The "generic" PA/LNA case is handled with the ctx-gpios and
  crx-gpios properties of the generic-fem-two-ctrl-pins compatible,
  respectively.

- If the fem is an nRF21540, use the tx-en-gpios and rx-en-gpios
  properties instead (and also respectively). This allows us to specify
  FEM properties in a way that makes sense for the hardware datasheet,
  while still handling them in a uniform way within the controller.

We support this in the nRF5 HAL with a new radio_nrf5_fem.h
sub-header, which pulls in radio_nrf5_fem_generic.h or
radio_nrf5_fem_nrf21540.h depending on the fem node's compatible, if
one is defined. These in turn let us replace the implementation
routines in radio.c with DT equivalents.

Keep in-tree users and devicetree binding documentation up to date.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-11-11 21:52:24 +01:00
Piotr Pryga f758daa14b Bluetooth: controller: add missing ADI support in per adv chains
Recently there was added ADI support to periodic advertising.
There was missing implementation of ADI for periodic advertising
chained PDUs and direction finding. Also unit tests for periodic
advertising chains required update to handle ADI field.

The commit provides missing implementation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-11 18:36:54 +01:00
Nicolas Pitre e3144ca68a sys: util: improve IS_EMPTY() implementation
The current implementation relies on preprocessor concatenation to
work. This makes it incompatible with any content which expansion
is not a valid preprocessor token such as strings, pointers, etc.
and therefore limits its usefulness. Replace it with an implementation
that can cope with all cases.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-11-11 09:31:57 -05:00
Asbjørn Sæbø 3a7f6e843c Bluetooth: Audio: Media control BabbleSim tests
This commit add the BabbleSim tests for the media control client, the
media control service and the media proxy.  This is a part of the
upmerge of the le-audio media control files.

These tests have been developed and maintained along with the media
control functionality.  The tests are believed to cover all
implemented media control functionality.

The commit is a pure copy of the files and content in the
topic-le-audio branch, with the exception that some include paths have
been modified to correspond to new locations of files and that the
tests have been guarded with ifdefs.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>

test guards
2021-11-11 15:31:37 +01:00
Asbjørn Sæbø 3fb8761c4f Bluetooth: Audio: Add build tests for media control
Add entries for media control builds to testcase list.  This is a part
of the upmerge of media control from the topic-le-audio branch.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-11-11 15:31:37 +01:00
Asbjørn Sæbø 251d939015 Bluetooth: Audio: Media control project settings
Upmerge of the project settings for media control from the
topic-le-audio branch.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>

audio.conf changes
2021-11-11 15:31:37 +01:00
Tomasz Bursztyka 32db35a721 net/tcp: Rename TCP2 to TCP
TCP2 is no longer needed as it is the unique implementation since the
legacy one has been removed.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-11 07:26:41 -05:00
Bartosz Bilas 203b474c4b tests: spi_loopback: enable GPIO driver for cy8ckit_062_ble_m0 board
Enable GPIO driver which is needed to handle CS GPIOS in SPI driver.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-11 07:25:45 -05:00
Bartosz Bilas 587d207244 tests: spi_loopback: enable GPIO driver for sam_v71* boards
Enable GPIO driver which is needed to handle CS GPIOS in SPI driver.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-11 07:25:45 -05:00
Torsten Rasmussen 1198087440 cmake: APPLICATION_CONFIG_DIR support implemented
With this commit a dedicated APPLICATION_CONFIG_DIR is added to the
Zephyr build system.

Currently, the APPLICATION_SOURCE_DIR is identical also the base
location of configuration files.

This is very practical for simple samples, but also has it limitations
for more complex setups.

Introducing a dedicated APPLICATION_CONFIG_DIR allows users more
customization options in Zephyr build system.
Especially in terms of custom build configuration files unknown to
Zephyr itself.

For example, instead of all configuration files being located directly
in the application source folder, a project might prefer to organize
their configuration files on a per board basis, for example:
<app>/boards/custom_board_A/prj.conf
<app>/boards/custom_board_A/app.overlay
<app>/boards/custom_board_A/custom_file.mine
<app>/boards/custom_board_B/prj.conf
<app>/boards/custom_board_B/app.overlay
<app>/boards/custom_board_B/custom_file.mine
...

instead of n-files located in the root of the sample.

If the user / sample specifies APPLICATION_CONFIG_DIR, then this folder
will always be used instead of the default configuration folder.

As part of this extension the behaviour of
`-DCONF_FILE=<relative-path>/prj_<build>.conf` and additional Kconfig
fragments automatic sourcing has been aligned with the default behavior
of `prj.conf`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-11-10 08:25:36 -05:00
Neil Armstrong 2825481747 devicetree: add tests for devicetree ranges API macros
Test cases for new APIs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-11-10 08:23:00 -05:00
Christopher Friedt 60cc117c9c tests: libc: minimal: Add tests for qsort()
This change adds tests for qsort().

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-10 07:00:36 -05:00
Lixin Guo bbe8f182c7 tests: timer: fix improper test identifier
The test identifier of timer error case in testcase.yaml is
exactly the same as timer api's test identifier.
So I fix this.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2021-11-09 22:42:12 -05:00