Commit graph

69531 commits

Author SHA1 Message Date
Gerard Marull-Paretas
79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Gerard Marull-Paretas
a6fb18541d samples: net: lldp: remove duplicate include
<zephyr/zephyr.h> was included twice.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Fabio Baltieri
47d13fc9a0 west: update littlefs module
Update the littlefs west module to the v2.5 commit.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-05 13:41:19 +00:00
Fabio Baltieri
6114a72c38 modules: littlefs: use ##__VA_ARGS__ for littlefs log wrappers
LittleFS has some macros resolving to the Zephyr LOG_* ones, use
the ##__VA_ARGS__ for these so that they don't leave a trailing comma if
called with a single argument.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-05 13:41:19 +00:00
Sylvio Alves
8bd369953a west.yml: update hal_espressif to fix redefinition issue
`unlikely`and `likely` definitions are causing build failure
due to redefinition in Zephyr. This fixes that by removing from
hal_espressif.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-09-05 09:31:27 -04:00
Krzysztof Chruscinski
64ab22bf43 shell: Add option to format logging timestamp
Add option to control formatting of the logging timestamp. By default
formatting is enabled which maintains backward compatibility.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-05 14:27:00 +02:00
Michal Narajowski
5c27067dcd Bluetooth: Mesh: Align Config Client API with Health Client API
This PR adds a `*_cli_*` infix to the Config Client API to match
the changes in Health Client. The old API is marked as deprecated.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2022-09-05 13:56:25 +03:00
Krzysztof Chruscinski
6f022f582b tests: logging: log_api: Add test for LOG_RAW
Add test for LOG_RAW macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-05 06:26:54 -04:00
Krzysztof Chruscinski
dbda37ddf0 logging: Add LOG_RAW macro
Add macro for logging raw formatted string. It is similar to
LOG_PRINTK macro but contrary to LOG_PRINTK it should not append
carriage return character to any new line character found in the
string. LOG_PRINTK processed by log_output module has that to
mimic printk behavior.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-05 06:26:54 -04:00
Ahmed Moheb
c7d37d956e bluetooth: host: keys: Rename bt_keys_foreach() to bt_keys_foreach_type()
Use the name bt_keys_foreach_type() to be more descriptive.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-05 12:22:13 +02:00
Ahmed Moheb
f1884e5083 bluetooth: host: keys: Remove CONFIG_BT_MAX_CONN from key in use check
Eliminate key in use check dependency on (CONFIG_BT_MAX_CONN > 1).

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-05 12:22:13 +02:00
Ahmed Moheb
eea982e91e bluetooth: host: keys: Check if returned key matches keys pool item
bt_keys_find_addr() is used to find key by both ID and address.
Following checks must continue to compare ID and address as well.
Or, we can compare key references which is faster.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-05 12:22:13 +02:00
Ahmed Moheb
21882c5779 bluetooth: host: keys: Add assertions to check arguments
Check arguments passed to APIs with assertions.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-05 12:22:13 +02:00
Ahmed Moheb
ad5b154250 bluetooth: host: keys: Add APIs docs
Add API documentation to describe behavior, args and return value.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-05 12:22:13 +02:00
Krzysztof Chruscinski
89de6d19af logging: log_output: Use \r\n instead of \n\r for printk
Replace order to be compatible with printk and other logging outputs.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-05 06:18:17 -04:00
Stephanos Ioannidis
857f42570c tests: kernel: gen_isr_table: Disable RISC-V direct ISR test
This commit disables the RISC-V direct ISR test due to the broken
`vectors` section placement with the IRQ vector table enabled,
introduced by the commit d2f8ec70235208f4a70e371ccb1ed8dfe0f573c5.

For more details, refer to the GitHub issue #49903 tracking this bug.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-09-05 19:15:24 +09:00
Enjia Mai
250f354c22 tests: drivers: move the maxim_ds3231 counter test to new ztest API
Migrate the testsuite tests/drivers/counter/maxim_ds3231_api to
the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-05 10:13:43 +00:00
Enjia Mai
a567d7e0e8 tests: drivers: move the counter fixed top test to new ztest API
Migrate the testsuite tests/drivers/counter/counter_nrf_rtc/fixed_top
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-05 10:13:43 +00:00
Enjia Mai
0051a3abaa tests: drivers: move the counter basic test to new ztest API
Migrate the testsuite tests/drivers/counter/counter_basic_api
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-05 10:13:43 +00:00
Enjia Mai
e6b72b547b tests: drivers: move the counter_seconds test to new ztest API
Migrate the testsuite tests/drivers/counter/counter_seconds to
the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-05 10:13:43 +00:00
Meng xianglin
9882ae8ace tests: stm32u5_devices: move to new ztest API
test cases in
tests/drivers/clock_control/stm32_clock_configuration/stm32u5_devices
are move to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
f8f667e91c tests: stm32u5_core: move to new ztest API
test cases in
tests/drivers/clock_control/stm32_clock_configuration/stm32u5_core
are moved to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
0ef8aae92b tests: stm32h7_devices: move to new ztest API
test cases in
tests/drivers/clock_control/stm32_clock_configuration/stm32h7_devices
are moved to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
45c5c7ba91 tests: stm32h7_core: move to new ztest API
test cases in
tests/drivers/clock_control/stm32_clock_configuration/stm32h7_core
are moved to new zest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
4e2da2e58f tests: stm32_common_devices: move to new ztest API
test cases in
tests/drivers/clock_control/stm32_clock_configuration/stm32_common_devices
are moved to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
bfd5118f53 tests: stm32_common_core: move to new ztest API
test cases in
tests/dirvers/clock_control/stm32_clock_configuration/stm32_common_core
are moved to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
13d281b683 tests: onoff: move to new ztest API
test cases in tests/drivers/clock_control/onoff are moved to new
ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
22d62cf28d tests: nrf_onof_and_bt: move to new ztest API
test cases in tests/drivers/clock_control/nrf_onoff_and_bt are moved
to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
13d22e0937 tests: nrf_lf_clock_start: move to new ztest API
test cases in tests/drivers/clock_control/nrf_lf_clock_start are
move to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
dae9bb4705 tests: nrf_clock_calibration: move to new ztest API
test cases in tests/drivers/clock_control/nrf_clck_calibration
are moved to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
d22f52a306 tests: clock_control_api: move to new ztest API
test cases in tests/drivers/clock_control/clock_control_api are
moved to new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Meng xianglin
fc2e86011b tests: cavs_clock: move to new ztest API
test cases in tests/drivers/clock_control/cavs_clock are moved to
new ztest API

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-09-05 10:13:27 +00:00
Gerard Marull-Paretas
f7c13df36c include: dt-bindings: reset: gd32f3x0: fix ADDAPT1RST_OFFSET
The ADDAPB1RST_OFFSET was incorrectly set to 0xE0, but it is 0xFC in
this series.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-05 09:36:04 +00:00
Gerard Marull-Paretas
30f50e5171 dts: gigadevice: gd32vf103: add missing i2c0 reset entry
i2c0 did not have the resets property set, required by the binding.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-05 09:36:04 +00:00
Gerard Marull-Paretas
f323f6b921 dts: gigadevice: gd32f3x0: s/dma0/dma
There is only a single DMA in GD32F3X0. It is referenced as DMA in
datasheet, not DMA0 as in series that have > 1.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-05 09:36:04 +00:00
Francois Ramu
89c7ad3428 test: drivers: spi stm32 loopback test running on the stm32f746 nucleo
Define the overlay to run the tests/drivers/spi/spi_loopback/
on the nucleo_f746zg board.
The DMA 2 is used for spi1 transfer.
Like on nucleo_f767zi, connect pin D11 to D12 (SPI1 MOSI to MISO)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-05 09:31:07 +00:00
Francois Ramu
007f449353 tests: drivers: spi loopback running on stm32f7x nucleo
This commit remove the use of the Dcache for stm32f7x
boards when running the tests on SPI with DMA.
Add the -- -DOVERLAY_CONFIG=overlay-stm32-spi-dma.conf
to run the test and connect SPI MOSI to MISO on the hw.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-05 09:31:07 +00:00
Martin Jäger
e5b049249e samples: net: sockets: can: unconditionally include can.h
This header is also needed for struct can_filter, so it should not
only be included if one wants to set the device into loopback mode.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-09-05 08:57:16 +00:00
Fabio Baltieri
d215c262de MAINTAINERS: update maintainers for hal_nuvoton
The nuvoton HAL module is for the Numicro platform, not NPCX. Update the
list of maintainers accordingly.

Link: https://github.com/zephyrproject-rtos/zephyr/issues/49678#issuecomment-1233666614
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-05 08:56:38 +00:00
Torsten Rasmussen
abc3be5965 cmake: remove obsolete CONFIG_ZTEST_NEW_API from CMakeLists.txt
Follow-up: #49243, #48732

With the introduction of Kconfig for unit_testing board and setting
ZTEST_NEW_API in testcase.yaml, the need and support of setting this
directly in CMakeLists.txt is obsolete.

Remove the code line.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-09-05 10:24:10 +02:00
Torsten Rasmussen
b066ae906b cmake: fix improper use of separate_arguments
The use of `separate_arguments()` in extra_flags.cmake and
unittest.cmake prevents the use of proper CMake lists.

A CMake list can be specified on command line as:
`-DMY_LIST="itemA;itemB;itemC"`

Users are expected to be able to provide extra compile flags using CMake
lists, like `-DEXTRA_CFLAGS="--flag1;--flag2"` but also using space
separated lists, like: `-DEXTRA_CFLAGS="--flag1 --flag2"`.

However, the way FLAGS was passed to separate_arguments() would result
in a list being treated as extra arguments to the function and thus
result in a CMake error.

To allow the use of CMake lists, the length of the argument as a CMake
list is tested. This ensures that when the argument contains a
single `;` then the length is >1 and no conversion is needed.

This allows a user to freely choose between the two forms:
- `-DFLAGS="--flag1 --flag2"`
- `-DFLAGS="--flag1;--flag2"`

or when passing flags which themselves contains spaces, like:
- `-DFLAGS="--flag1 \"val1 val2\""`
- `-DFLAGS="--flag1;val1 val2"`

Note that the extra escaped qouting is no longer needed for proper CMake
lists as the `;` itself informs the system that spaces are to be kept as
spaces.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-09-05 10:22:05 +02:00
Fabio Baltieri
1ecd016e6a sample: smp_svr: fix test name mcumg -> mcumgr
The test names are missing an "r" from "mcumgr" for some reason. Add it
back.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-05 10:18:10 +02:00
Ruibin Chang
692054aaee tests/kernel/timer/timer_api: modify logic for longer real time
SYS_CLOCK_TICKS_PER_SEC of it8xxx2 is 4096 (244us).
Running test_sleep_abs item on it8xxx2 and we get
k_us_to_ticks_ceil32(250) = 2 and late = 2, so it failed.
After we enable the CONFIG_PM, it needs more time to resume
from low power mode, so I modify the logic to <= for passing
the test.

fixes #49605

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2022-09-05 10:17:43 +02:00
Emil Gydesen
0753ec558d Bluetooth: Shell: Remove nRF board overlays
The board overlays were added to increase the baud rate,
which was useful when scanning when there were many devices.

For that scenario it is probably better to use the
scan filters.

The changed baudrate in the overlays made it harder
to easily switch between e.g. the BT shell and other
applications, as the default baudrate is different, and
you'd need to restablish a connection to the boards UART
to handle the changes.

The other values in the overlays also do not really
provide any advantage to have for just the shell
application.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-09-05 10:17:31 +02:00
Erwan Gouriou
54302ac67d drivers: flash: stm32 ospi: Limit bytes read from DT SFDP table
In case SFDP table is provided via device tree, take care not reading
more than expected by the function caller as the result is written
in a structure which size is predefined by one specific byte in the
table, and could be smaller than the table size.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-09-05 10:17:21 +02:00
Jiafei Pan
62fa415fe1 west.yml: update hal_nxp module
This update for hal_nxp includes some update to enable ARM64 support.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2022-09-05 10:17:13 +02:00
Jiafei Pan
9c0c2e1320 CODEOWNERS: imx8m/p/n: update codeowner
Add me to be codeowner of platform imx8mm/p/n ARM64
platforms.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2022-09-05 10:17:13 +02:00
Jiafei Pan
8700d925b3 drivers: serial: remove soc.h from iuart
soc.h has been removed for ARM64 SoC platforms and it is also needed by
ARM32, so remove it from related drivers.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2022-09-05 10:17:13 +02:00
Jiafei Pan
1cf9858b4f drivers: pinctrl: remove soc.h from pinctrl_imx
soc.h has been removed for ARM64 SoC platforms and it is also needed by
ARM32, so remove it from related drivers.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2022-09-05 10:17:13 +02:00
Jiafei Pan
af0c47f7d8 drivers: clock_control: remove soc.h from mcux_ccm
soc.h has been removed for ARM64 SoC platforms and it is also needed by
ARM32, so remove it from related drivers.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2022-09-05 10:17:13 +02:00