Commit Graph

60729 Commits

Author SHA1 Message Date
Torsten Rasmussen 96b3e4d0c4 cmake: create a root.cmake CMake module
The root.cmake CMake module remove boilerplate code and place
it inside a dedicated root.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen bdb99a330f cmake: create a kernel.cmake CMake module
The kernel.cmake CMake module remove boilerplate code and place
it inside a dedicated kernel.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 9bb162d1d5 cmake: create a configuration_files.cmake CMake module
The configuration_files.cmake CMake module remove boilerplate code and
place it inside a dedicated configuration_files.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen d2b11174f3 cmake: create a user_cache.cmake CMake module
The user_cache.cmake CMake module remove boilerplate code and place it
inside a dedicated user_cache.cmake CMake module.

The user cache functions has been moved to the new Zephyr CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 5504096560 cmake: boards and shields cmake files repurposed
The boards.cmake and shields.cmake has been repurposed to do board and
shield validation so that such validation code can be re-factored out
of boilerplate itself.

The boards.cmake and shields.cmake will both perform validation and
printing errors when validation fails.

Also it will specify the boards and shields build targets.

This ensures that validation code, message printing and target
specification for boards and shields are located logically together.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen de34b67c45 cmake: move CMAKE_<lang>_COMPILER_FORCED into toolchain code.
To prepare for more modular approach move the compiler forced out of
boilerplate and into the specific toolchain cmake code (generic/target).

Code is added to both generic and target toolchain modules to allow
future use of one module without requiring a load of the other module.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 254e35d61d cmake: create an arch.cmake module
The arch.cmake CMake module remove boilerplate code and place it inside
a dedicated arch.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 7f6bb02287 cmake: create a soc.cmake module
The soc.cmake CMake module remove boilerplate code and place it inside
a dedicated soc.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 0a9a3c0a79 cmake: default value for KCONFIG_BINARY_DIR moved to zephyr_modules
This is a cleanup commit moves the default setting of KCONFIG_BINARY_DIR
from boilerplate.cmake to zephyr_modules.cmake to prepare for better
re-usability.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen a5d0b2f734 cmake: Move default value for AUTOCONF_H to kconfig.cmake
This is a cleanup commit moves the setting of AUTOCONF_H from
boilerplate.cmake to kconfig.cmake for better re-usability.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Fabio Baltieri b3daa58ee0 boards: arm: add missing memory-region compatible to stm32h7b3i_dk
Add missing compatible = "zephyr,memory-region" to the sdram2 node for
stm32h7b3i_dk.dts. This is required since 18ffcdcf74.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-02-22 12:43:42 -05:00
Tomasz Bursztyka 0c9ce49d2a arch/x86: Fix MSI MAP destination
When Zephyr runs directly on actual hardware, it will be always
directing MSI messages to BSP (BootStrap Processor). This was fine until
Zephyr could be ran on virtualizor that may NOT run it on BSP.

So directing MSI messages on current processor. If Zephyr runs on actual
hardware, it will be BSP since such setup is always made at boot time by
the BSP. On other use case it will be whatever is relevant at that time.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-02-22 10:35:39 -05:00
Tomasz Bursztyka 0affb29572 arch/x86: Add a CPUID function to get initial APIC ID
Depending on whether X2APIC is enabled or not, it will be safer to grab
such ID from the right place.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-02-22 10:35:39 -05:00
Tomasz Bursztyka 7ea9b169f7 arch/x86: Have a dedicated place for CPUID related functions
This will centralize CPUID related accessors. There was no need for it
so far, but this is going to change.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-02-22 10:35:39 -05:00
Tomislav Milkovic 52bf19b59b boards: arm: add support for stm32h7b3i_dk board
Add device trees for board and arduino connector, Kconfig and docs

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Tomislav Milkovic b2231c9d85 drivers: clock_control: stm32h7: select max clock freq for STM32H7B3
STM32H7B3 supports max SYSCLK and AHB clock frequencies of 280 MHz,
and max APB frequency of 140 MHz

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Tomislav Milkovic a0bc0672b8 soc: arm: stm32h7: add support for stm32h7b3xx and stm32h7b3xxq
Add SoC Kconfig configurations

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Tomislav Milkovic 72cc823e07 dts: arm: st: h7b3: add support for stm32h7b3
Add device tree support for STM32H7B3 line

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Henrik Brix Andersen de45e8ec72 drivers: can: use separate log modules for each driver
Use separate log modules for each CAN driver similar to other
sub-systems/driver classes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-22 10:34:04 -05:00
Lukasz Maciejonczyk c9effd0ff9 net: openthread: filter ipv6 fragments
If OPENTHREAD_IP6_FRAGM is enabled the IPv6 fragments are handled in
OpenThread stack but also forwarder unconditionally to the Zephyr
uplayers. It causes additional packets processing and leads to errors
like unrecognized next header type or duplicate ping reply. What more
these errors generate additional traffic which jam channel and decrease
latency for packets required fragmentation.
This commit add filtering IPv6 fragments when data fragmentation and
reassembling is enabled in OpenThread.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2022-02-22 10:33:47 -05:00
Eduardo Montoya be742f925e net: openthread: fix received frame flags
Uninitialized memory would report wrong value for
`mAckedWithSecEnhAck` flag in the received frame, making the
OpenThread stack to update the frame counter for the neighbor
wrongly.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-02-22 10:33:23 -05:00
Trond Einar Snekvik c1d5e1fda0 Bluetooth: Mesh: Disable pb_adv_reprovision
pb_adv_reprovision is failing in CI, but the error cannot be reproduced
locally. Disable the test as a hotfix for main, so we can determine the
issue and re-enable the test in a separate PR.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-22 09:53:41 -05:00
Krzysztof Chruscinski 3e551d658c tests: logging: log_stack: Fix Kconfig option
Renaming:
- CONFIG_TEST_EXTRA_STACKSIZE -> CONFIG_TEST_EXTRA_STACK_SIZE
- CONFIG_ZTEST_STACKSIZE -> CONFIG_ZTEST_STACK_SIZE

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 09:09:24 -05:00
Nicolas Pitre 3617398f1d kernel/init.c: missing memset() to early_memset() conversion
Commit 678b76e4b0 ("kernel/init.c: allow for memset/memcpy
alternatives during early boot") and commit da28829b64 ("kernel:
zero the bss section of OCM memory at boot time") were created
independently and missed changes from each other.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-02-22 09:05:40 -05:00
Krzysztof Chruscinski ec963aa134 doc: logging: Add section about stack usage
Add information about logging stack usage.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Krzysztof Chruscinski a43d41483b tests: logging: Add test for stack usage characterization
Added test which estimates stack usage of few types of logging
messages in various modes, with and without optimization. Test
was used to determine usage for various architectures and is expected
to be used to detect stack usage increase since it fails when
stack usage in given configuration goes beyond the hardcoded limit.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Krzysztof Chruscinski c5a065e3b8 debug: thread_analyzer: Use bigger stack in certain configurations
When immediate logging is used and optimization is off then bigger
stack is needed for thread analyzer. Adjusting the value.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Krzysztof Chruscinski 402c9b8895 tests: logging: log_api: Add test for argument evaluation
Added test which checks that log argument is evaluated only
once when log message is created.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Krzysztof Chruscinski a662e69cad logging: Prevent multiple arguments evaluation
Logging v2 is utilizing complex preprocessing operations to
prepare message at compile time. Multiple operations are peformed
on log message arguments. However, it is expected that argument
will be evaluated only once (e.g. it can be a call to a function
with side effects). Adding additional layer which creates copies
of user arguments on stack and passes them to further processing.

Updated test for log_msg2 which is using internal macro which
got renamed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Krzysztof Chruscinski 154ca8526c logging: Use runtime packaging in immediate mode
Always use runtime packaging in immediate mode. Removing attempt to
package on stack if possible. It would be done only to speed up
logging but that is not a requirement in immediate mode where
packaging time is fractional compared to backend processing. Using
runtime packaging also reduces stack usage in the context which calls
log message.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Carles Cufi e83a13aabf kconfig: Rename the TEST_EXTRA stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Carles Cufi 4b8f1c04ab kconfig: Rename the ZTEST stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Dominik Ermel d7db973b04 fs/fat_fs: Allow configuration of number of root entries
The commit adds FS_FATFS_MAX_ROOT_ENTRIES Kconfig option that allows
to select number of root node entries that will be allocated while
creating FAT file system on a device.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-02-22 08:14:20 -05:00
Ryan McClelland 2eaede53af drivers: adc: add ads1x1x driver
This adds support for the ads101x (ads1013, ads1014, ads1015) and
ads111x (ads1113, ads1114, ads1115) family of i2c adc devices.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-02-22 10:49:39 +01:00
Moritz Fischer aa283e5439 samples: modules: canopennode: Add stm32f072b_disco support
Add support for the stm32f072rb discovery board.

Signed-off-by: Moritz Fischer <moritzf@google.com>
2022-02-22 10:25:08 +01:00
Dominik Ermel a30698a148 mgmt/mcumgr: Remove redundant memcpy from buf processing
The commit removes redundant memcpy operations and switches from
using TinyCBOR provided byte order converters to sys_be, native
to Zephyr.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-02-22 10:24:44 +01:00
Casper Bonde 86574107dd Bluetooth: BAP: Unicast client sample accept EXT_ADV
Minor change to let the client accept EXT_ADV reports
when connecting.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
2022-02-22 10:23:44 +01:00
Szymon Janc c631469539 tests/bluetooth/tester: Allocate L2CAP channel only when needed
This fix leaking channels when autorization or key size are tested.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-22 10:23:33 +01:00
Szymon Janc 4b40915004 test/bluetooth/tester: Don't clear auth requirements on L2CAP server
We have single server but it can accept multiple connections so
keep same requirements for all connection attempts.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-22 10:23:33 +01:00
Carlo Caione 240c975ad4 core: z_data_copy does not depend on CONFIG_XIP
When XIP is not enabled, z_data_copy() already falls back to an empty
function. No need to ifdef it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-22 10:22:53 +01:00
Jan Zyczkowski c7295aa6a6 board: thingy53_nrf5340: Add option to set PMIC to PWM mode
Add dts node for thingy53 board to forcibly set
PMIC to PWM mode by setting GPIO pin high.

Signed-off-by: Jan Zyczkowski <jan.zyczkowski@nordicsemi.no>
2022-02-22 10:20:58 +01:00
Anas Nashif 49d08c25fe Revert "logging: Use spin lock"
This reverts commit dfe9561d9b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-22 00:29:17 -05:00
Anas Nashif 421dcc8dcd Revert "testsuite: ztress: Add test skipping if system clock is too high"
This reverts commit 913868b6c4.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-22 00:29:17 -05:00
Anas Nashif b4d28a8186 Revert "tests: logging: Add stress test"
This reverts commit 12f9b4b31c.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-22 00:29:17 -05:00
Sebastian Bøe 85c4f5dd55 kconfig: drivers: crypto: Remove EXPERIMENTAL
The crypto driver API is 6 years old, has 5 different implementations,
and is widely used.

Remove the EXPERIMENTAL marking from the API. Each implementation may
still choose to mark itself as EXPERIMENTAL.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-02-21 22:20:51 -05:00
Krzysztof Chruscinski 12f9b4b31c tests: logging: Add stress test
Add stress test for logging to validate that logging is coherent:
All message are processed by the logger or dropped and no message
is lost.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-21 22:19:00 -05:00
Krzysztof Chruscinski 913868b6c4 testsuite: ztress: Add test skipping if system clock is too high
When system clock is set globally for the test which is executed
on various qemu platforms it may happen that clock is set too
high compared to CPU clock frequency. In that case test may stuck.
Added check and test skipping in that case.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-21 22:19:00 -05:00
Krzysztof Chruscinski dfe9561d9b logging: Use spin lock
Updated log_core to use spin lock instead of irq_lock.
Refactored z_log_msg_post_finalize function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-21 22:19:00 -05:00
Seppo Takalo f1e0b5413c net: lwm2m: Allow changing the protocol version to 1.1
This is a bare minimal changes to tell the server that we are using
LwM2M 1.1 version. Queue-mode parameter has changed between 1.0 and
1.1 so it must be changed in the same time.

Other 1.1 features may follow on separate commits. This is still
an experimental feature that allows developing and testing of
1.1 features.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-02-21 22:18:34 -05:00
Dawid Niedzwiecki abb090094d i2c_emul: init i2c config
Initialize the i2c config of the emulator based on the clock_frequency
property.

The emulator can be used without calling the i2c_configure function, but
the i2c_get_config would return an error. With this change, it is
possible to get the config prior to the i2c_configure call.

Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
2022-02-21 22:18:16 -05:00