diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index dbf71e7b7b72..609292fd66f3 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -53,6 +53,8 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" git remote -v + # Sauce tag checks before rebasing + git log --oneline --first-parent origin/${BASE_REF}..HEAD | grep -E -v "\[nrf (mergeup|fromtree|fromlist|noup)\]" && { echo 'Sauce tag missing'; exit 1; } git rebase origin/${BASE_REF} # debug git log --pretty=oneline | head -n 10 @@ -69,7 +71,7 @@ jobs: # debug ls -la git log --pretty=oneline | head -n 10 - ./scripts/ci/check_compliance.py -m Codeowners -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m Kconfig -c origin/${BASE_REF}.. + ./scripts/ci/check_compliance.py -m Codeowners -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m KconfigBasic -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@master diff --git a/.github/workflows/devicetree_checks.yml b/.github/workflows/devicetree_checks.yml index 818876e9ad6a..0156e5f1c8c4 100644 --- a/.github/workflows/devicetree_checks.yml +++ b/.github/workflows/devicetree_checks.yml @@ -22,6 +22,9 @@ jobs: matrix: python-version: [3.6, 3.7, 3.8] os: [ubuntu-latest, macos-latest, windows-latest] + exclude: + - os: macos-latest + python-version: 3.6 steps: - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/west_cmds.yml b/.github/workflows/west_cmds.yml index 608dfe06f505..2bf4eef4388d 100644 --- a/.github/workflows/west_cmds.yml +++ b/.github/workflows/west_cmds.yml @@ -23,6 +23,9 @@ jobs: matrix: python-version: [3.6, 3.7, 3.8] os: [ubuntu-latest, macos-latest, windows-latest] + exclude: + - os: macos-latest + python-version: 3.6 steps: - name: checkout uses: actions/checkout@v2 diff --git a/.gitlint b/.gitlint index 7e0e5d3b5e63..b05227ed86f6 100644 --- a/.gitlint +++ b/.gitlint @@ -13,7 +13,7 @@ debug = false extra-path=scripts/gitlint [title-max-length-no-revert] -line-length=75 +line-length=120 [body-min-line-count] min-line-count=1 @@ -39,7 +39,7 @@ words=wip [max-line-length-with-exceptions] # B1 = body-max-line-length -line-length=72 +line-length=120 [body-min-length] min-length=3 diff --git a/CMakeLists.txt b/CMakeLists.txt index d41684ddfbe2..9e8a1fb17f76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1335,6 +1335,10 @@ set(logical_target_for_zephyr_elf ${logical_target_for_zephyr_elf} PARENT_SCOPE) # 2. it can be defined in Kconfig set_target_properties(${logical_target_for_zephyr_elf} PROPERTIES OUTPUT_NAME ${KERNEL_NAME}) +if (ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/s1.cmake) +endif() + set(post_build_commands "") set(post_build_byproducts "") @@ -1440,6 +1444,21 @@ if(CONFIG_BUILD_OUTPUT_BIN AND CONFIG_BUILD_OUTPUT_UF2) ) endif() +if(CONFIG_BUILD_OUTPUT_META) + list(APPEND + post_build_commands + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/zephyr_module.py + ${WEST_ARG} + ${ZEPHYR_MODULES_ARG} + ${ZEPHYR_EXTRA_MODULES_ARG} + --meta-out ${KERNEL_META_NAME} + ) + list(APPEND + post_build_byproducts + ${KERNEL_META_NAME} + ) +endif() + # Cleanup intermediate files if(CONFIG_CLEANUP_INTERMEDIATE_FILES) list(APPEND diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000000..3b9cf0022399 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +@Library("CI_LIB") _ + +def pipeline = new ncs.sdk_zephyr.Main() + +pipeline.run(JOB_NAME) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 0141bfde6490..0a50e6cae455 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -120,9 +120,7 @@ config FLASH_LOAD_SIZE endif # HAS_FLASH_LOAD_OFFSET config ROM_START_OFFSET - hex - prompt "ROM start offset" if !BOOTLOADER_MCUBOOT - default 0x200 if BOOTLOADER_MCUBOOT + hex "ROM start offset" default 0 help If the application is built for chain-loading by a bootloader this @@ -506,7 +504,30 @@ config MAKEFILE_EXPORTS Generates a file with build information that can be read by third party Makefile-based build systems. +config BUILD_OUTPUT_META + bool "Create a build meta file" + help + Create a build meta file in the build directory containing lists of: + - Zephyr: path and revision (if git repo) + - Zephyr modules: name, path, and revision (if git repo) + - West projects: path and revision + File extension is .meta + endmenu + +config EXPERIMENTAL + bool + help + Symbol that must be selected by a feature if it is considered to be + at an experimental implementation stage. + +config WARN_EXPERIMENTAL + bool + prompt "Warn on experimental usage" + help + Print a warning when the Kconfig tree is parsed if any experimental + features are enabled. + endmenu diff --git a/VERSION b/VERSION index 0c383cd56a72..bff8b1740e87 100644 --- a/VERSION +++ b/VERSION @@ -2,4 +2,4 @@ VERSION_MAJOR = 2 VERSION_MINOR = 7 PATCHLEVEL = 0 VERSION_TWEAK = 0 -EXTRAVERSION = rc3 +EXTRAVERSION = diff --git a/arch/Kconfig b/arch/Kconfig index de365d9a26fe..f7e246920171 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -845,6 +845,7 @@ menu "Floating Point Options" config FPU bool "Enable floating point unit (FPU)" depends on CPU_HAS_FPU + depends on !IS_SPM help This option enables the hardware Floating Point Unit (FPU), in order to support using the floating point registers and instructions. diff --git a/arch/arm/core/aarch32/mpu/arm_core_mpu.c b/arch/arm/core/aarch32/mpu/arm_core_mpu.c index 5f2e9d2cd21f..bc3b8ce8f392 100644 --- a/arch/arm/core/aarch32/mpu/arm_core_mpu.c +++ b/arch/arm/core/aarch32/mpu/arm_core_mpu.c @@ -278,7 +278,7 @@ void z_arm_configure_dynamic_mpu_regions(struct k_thread *thread) __ASSERT((uintptr_t)&z_priv_stacks_ram_start <= guard_start, "Guard start: (0x%lx) below privilege stacks boundary: (%p)", - guard_start, &z_priv_stacks_ram_start); + guard_start, z_priv_stacks_ram_start); } else #endif /* CONFIG_USERSPACE */ { diff --git a/boards/Kconfig b/boards/Kconfig index 03064790fb63..b295e23cad76 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -14,6 +14,13 @@ config QEMU_TARGET Mark all QEMU targets with this variable for checking whether we are running in an emulated environment. +config NET_DRIVERS + bool + default y if QEMU_TARGET && NETWORKING + help + When building for a qemu target then NET_DRIVERS will be default + enabled to allow for easy use of SLIP or PPP + # Note: $BOARD_DIR might be a glob pattern choice diff --git a/boards/arc/nsim/support/mdb_hs6x.args b/boards/arc/nsim/support/mdb_hs6x.args index 0b9984a33d9d..267f00d2bd73 100644 --- a/boards/arc/nsim/support/mdb_hs6x.args +++ b/boards/arc/nsim/support/mdb_hs6x.args @@ -10,7 +10,6 @@ -prop=nsim_isa_vec64=1 -dcache=65536,64,2,a -dcache_feature=2 - -dcache_uncached_region -dcache_mem_cycles=2 -icache=65536,64,4,a -icache_feature=2 diff --git a/boards/arc/nsim/support/mdb_hs6x_smp.args b/boards/arc/nsim/support/mdb_hs6x_smp.args index 2894c39d0667..cbde485b271b 100644 --- a/boards/arc/nsim/support/mdb_hs6x_smp.args +++ b/boards/arc/nsim/support/mdb_hs6x_smp.args @@ -10,7 +10,6 @@ -prop=nsim_isa_vec64=1 -dcache=65536,64,2,a -dcache_feature=2 - -dcache_uncached_region -dcache_mem_cycles=2 -icache=65536,64,4,a -icache_feature=2 diff --git a/boards/arm/arduino_nano_33_ble/Kconfig.board b/boards/arm/arduino_nano_33_ble/Kconfig.board index ebf4b156c455..ba2beb5a70d7 100644 --- a/boards/arm/arduino_nano_33_ble/Kconfig.board +++ b/boards/arm/arduino_nano_33_ble/Kconfig.board @@ -13,7 +13,6 @@ config BOARD_ARDUINO_NANO_33_BLE_EN_USB_CONSOLE select CONSOLE select PRINTK select UART_INTERRUPT_DRIVEN - select USB_UART_CONSOLE config BOARD_ARDUINO_NANO_33_BLE_INIT_SENSORS bool "Initializes the internal I2C sensors on the board" diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig index ba8eeee9315c..5fbe4ccdfb08 100644 --- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig +++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig @@ -11,7 +11,6 @@ CONFIG_HW_STACK_PROTECTION=y # enable peripherals CONFIG_GPIO=y CONFIG_SERIAL=y -CONFIG_CONSOLE=y # enable sam-ba bootloader on legacy mode CONFIG_BOOTLOADER_BOSSA=y diff --git a/boards/arm/b_u585i_iot02a/doc/index.rst b/boards/arm/b_u585i_iot02a/doc/index.rst index 24bccc3c2a85..02256bff2b91 100644 --- a/boards/arm/b_u585i_iot02a/doc/index.rst +++ b/boards/arm/b_u585i_iot02a/doc/index.rst @@ -255,9 +255,9 @@ Debugging STM32U5 support is not currently supported in openocd. As a temporary workaround, user can use `STMicroelectronics customized version of OpenOCD`_ to debug the the B_U585I_IOT02A Discovery kit. -For this you need to fetch this repo and build openocd following the instructions -provided in the README of the project. Then, build zephyr project indicating the -openocd location in west build command. +For this you need to fetch this repo, checkout branch "openocd-cubeide-r3" and +build openocd following the instructions provided in the README of the project. +Then, build zephyr project indicating the openocd location in west build command. Here is an example for the :ref:`blinky-sample` application. @@ -269,24 +269,18 @@ Here is an example for the :ref:`blinky-sample` application. Then, indicate openocd as the chosen runner in flash and debug commands: -.. zephyr-app-commands:: - :zephyr-app: samples/basic/blinky - :board: b_u585i_iot02a - :gen-args: -r openocd - :goals: flash -.. zephyr-app-commands:: - :zephyr-app: samples/basic/blinky - :board: nucleo_u575zi_q - :gen-args: -r openocd - :goals: debug + .. code-block:: console + + $ west flash -r openocd + $ west debug -r openocd .. _B U585I IOT02A Discovery kit website: https://www.st.com/en/evaluation-tools/b-u585i-iot02a.html .. _B U585I IOT02A board User Manual: - https://www.st.com/resource/en/user_manual/dm00698410.pdf + https://www.st.com/resource/en/user_manual/um2839-discovery-kit-for-iot-node-with-stm32u5-series-stmicroelectronics.pdf .. _STM32U585 on www.st.com: https://www.st.com/en/microcontrollers-microprocessors/stm32u575-585.html diff --git a/boards/arm/bl654_usb/Kconfig.defconfig b/boards/arm/bl654_usb/Kconfig.defconfig index 56125667cbb3..3ce20bab1f72 100644 --- a/boards/arm/bl654_usb/Kconfig.defconfig +++ b/boards/arm/bl654_usb/Kconfig.defconfig @@ -25,9 +25,6 @@ config FLASH_LOAD_OFFSET if USB_DEVICE_STACK -config USB_UART_CONSOLE - default y - config UART_LINE_CTRL default y diff --git a/boards/arm/degu_evk/Kconfig.defconfig b/boards/arm/degu_evk/Kconfig.defconfig index 8728d10f8443..ebd494384d9f 100644 --- a/boards/arm/degu_evk/Kconfig.defconfig +++ b/boards/arm/degu_evk/Kconfig.defconfig @@ -13,9 +13,6 @@ if USB_DEVICE_STACK config USB_DEVICE_PRODUCT default "Degu Evaluation Kit" -config USB_UART_CONSOLE - default y - config UART_INTERRUPT_DRIVEN default y diff --git a/boards/arm/lpcxpresso54114/lpcxpresso54114_m0_defconfig b/boards/arm/lpcxpresso54114/lpcxpresso54114_m0_defconfig index 6333c49bc3e0..8c272dc10052 100644 --- a/boards/arm/lpcxpresso54114/lpcxpresso54114_m0_defconfig +++ b/boards/arm/lpcxpresso54114/lpcxpresso54114_m0_defconfig @@ -7,7 +7,6 @@ CONFIG_SOC_LPC54114_M0=y CONFIG_SOC_SERIES_LPC54XXX=y CONFIG_BOARD_LPCXPRESSO54114_M0=y -CONFIG_CONSOLE=y CONFIG_USE_SEGGER_RTT=y CONFIG_SERIAL=n CONFIG_CORTEX_M_SYSTICK=y diff --git a/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig b/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig index 37b621689bab..1ceb2a20bce1 100644 --- a/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig +++ b/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig @@ -13,9 +13,6 @@ CONFIG_HW_STACK_PROTECTION=y # enable GPIO CONFIG_GPIO=y -# enable console -CONFIG_CONSOLE=y - # additional board options CONFIG_GPIO_AS_PINRESET=y CONFIG_NFCT_PINS_AS_GPIOS=y diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig index 13168d41880a..8d98a2710404 100644 --- a/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig +++ b/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig @@ -12,7 +12,10 @@ config BOARD # force building with TF-M as the Secure Execution Environment. config BUILD_WITH_TFM - default y if BOARD_NRF5340DK_NRF5340_CPUAPP_NS + # Temporarily disable building Non-Secure images with TF-M support by + # default. + # default y if BOARD_NRF5340DK_NRF5340_CPUAPP_NS + default n if BUILD_WITH_TFM diff --git a/boards/arm/nrf9160dk_nrf9160/Kconfig.defconfig b/boards/arm/nrf9160dk_nrf9160/Kconfig.defconfig index f288d027cef8..bcc979da7eab 100644 --- a/boards/arm/nrf9160dk_nrf9160/Kconfig.defconfig +++ b/boards/arm/nrf9160dk_nrf9160/Kconfig.defconfig @@ -8,12 +8,6 @@ if BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160_NS config BOARD default "nrf9160dk_nrf9160" -# By default, if we build for a Non-Secure version of the board, -# force building with TF-M as the Secure Execution Environment. - -config BUILD_WITH_TFM - default y if BOARD_NRF9160DK_NRF9160_NS - if BUILD_WITH_TFM # By default, if we build with TF-M, instruct build system to diff --git a/boards/arm/nucleo_l073rz/Kconfig.defconfig b/boards/arm/nucleo_l073rz/Kconfig.defconfig index 6a73209134a8..b165c4ae0021 100644 --- a/boards/arm/nucleo_l073rz/Kconfig.defconfig +++ b/boards/arm/nucleo_l073rz/Kconfig.defconfig @@ -12,4 +12,10 @@ config SPI_STM32_INTERRUPT default y depends on SPI +# FIXME: LSE not working as LPTIM clock source. Use LSI instead. +choice STM32_LPTIM_CLOCK + default STM32_LPTIM_CLOCK_LSI + depends on STM32_LPTIM_TIMER +endchoice + endif # BOARD_NUCLEO_L073RZ diff --git a/boards/arm/nucleo_u575zi_q/doc/nucleou575zi_q.rst b/boards/arm/nucleo_u575zi_q/doc/nucleou575zi_q.rst index 681f59017a33..1141a2a31962 100644 --- a/boards/arm/nucleo_u575zi_q/doc/nucleou575zi_q.rst +++ b/boards/arm/nucleo_u575zi_q/doc/nucleou575zi_q.rst @@ -240,9 +240,9 @@ Debugging STM32U5 support is not currently supported in openocd. As a temporary workaround, user can use `STMicroelectronics customized version of OpenOCD`_ to debug the the Nucleo U575ZI Q. -For this you need to fetch this repo and build openocd following the instructions -provided in the README of the project. Then, build zephyr project indicating the -openocd location in west build command. +For this you need to fetch this repo, checkout branch "openocd-cubeide-r3" and +build openocd following the instructions provided in the README of the project. +Then, build zephyr project indicating the openocd location in west build command. Here is an example for the :ref:`blinky-sample` application. @@ -254,17 +254,11 @@ Here is an example for the :ref:`blinky-sample` application. Then, indicate openocd as the chosen runner in flash and debug commands: -.. zephyr-app-commands:: - :zephyr-app: samples/basic/blinky - :board: nucleo_u575zi_q - :gen-args: -r openocd - :goals: flash -.. zephyr-app-commands:: - :zephyr-app: samples/basic/blinky - :board: nucleo_u575zi_q - :gen-args: -r openocd - :goals: debug + .. code-block:: console + + $ west flash -r openocd + $ west debug -r openocd .. _STM32 Nucleo-144 board User Manual: diff --git a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpunet_defconfig b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpunet_defconfig index aa0fb99d0a2f..33dc6fbdeddd 100644 --- a/boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpunet_defconfig +++ b/boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpunet_defconfig @@ -12,6 +12,3 @@ CONFIG_HW_STACK_PROTECTION=y # Enable GPIO CONFIG_GPIO=y - -# Enable console -CONFIG_CONSOLE=y diff --git a/boards/x86/acrn/doc/ACRN-Hybrid.png b/boards/x86/acrn/doc/ACRN-Hybrid.png new file mode 100644 index 000000000000..9eb466d636c2 Binary files /dev/null and b/boards/x86/acrn/doc/ACRN-Hybrid.png differ diff --git a/boards/x86/acrn/doc/index.rst b/boards/x86/acrn/doc/index.rst index 1c73f8da0a8b..63968d9a0c24 100644 --- a/boards/x86/acrn/doc/index.rst +++ b/boards/x86/acrn/doc/index.rst @@ -5,6 +5,28 @@ Zephyr's is capable of running as a guest under the x86 ACRN hypervisor (see https://projectacrn.org/). The process for getting this to work is somewhat involved, however. +ACRN hypervisor supports a hybrid scenario where Zephyr runs in a so- +called "pre-launched" mode. This means Zephyr will access the ACRN +hypervisor directly without involving the SOS VM. This is the most +practical user scenario in the real world because Zephyr's real-time +and safety capability can be assured without influence from other +VMs. The following figure from ACRN's official documentation shows +how a hybrid scenario works: + +.. figure:: ACRN-Hybrid.png + :align: center + :alt: ACRN Hybrid User Scenario + :figclass: align-center + :width: 80% + + ACRN Hybrid User Scenario + +In this tutorial, we will show you how to build a minimal running instance of Zephyr +and ACRN hypervisor to demonstrate that it works successfully. To learn more about +other features of ACRN, such as building and using the SOS VM or other guest VMs, +please refer to the Getting Started Guide for ACRN: +https://projectacrn.github.io/latest/tutorials/using_hybrid_mode_on_nuc.html + Build your Zephyr App ********************* @@ -15,6 +37,10 @@ normally would, selecting an appropriate board: west build -b acrn_ehl_crb samples/hello_world +In this tutorial, we will use the Intel Elkhart Lake Reference Board +(`EHL`_ CRB) since it is one of the suggested platform for this +type of scenario. Use ``acrn_ehl_crb`` as the target board parameter. + Note the kconfig output in ``build/zephyr/.config``, you will need to reference that to configure ACRN later. @@ -31,6 +57,9 @@ First you need the source code, clone from: git clone https://github.com/projectacrn/acrn-hypervisor +We suggest that you use versions v2.5.1 or later of the ACRN hypervisor +as they have better support for SMP in Zephyr. + Like Zephyr, ACRN favors build-time configuration management instead of runtime probing or control. Unlike Zephyr, ACRN has single large configuration files instead of small easily-merged configuration @@ -102,10 +131,51 @@ many CPUs in the ```` tag. For example: .. code-block:: xml - - 0 - 1 - + + SAFETY_VM + ACRN PRE-LAUNCHED VM0 + + 0 + + + 0 + 1 + + ... + + 0 + 0 + + ... + + +To use SMP, we have to change the pcpu_id of VM0 to 0 and 1. +This configures ACRN to run Zephyr on CPU0 and CPU1. The ACRN hypervisor +and Zephyr application will not boot successfully without this change. +If you plan to run Zephyr with one CPU only, you can skip it. + +Since Zephyr is using CPU0 and CPU1, we also have to change +VM1's configuration so it runs on CPU2 and CPU3. If your ACRN set up has +additional VMs, you should change their configurations as well. + + .. code-block:: xml + + + SOS_VM + ACRN SOS VM + + 0 + + + 2 + 3 + + + 0 + 0 + + ... + Note that these indexes are physical CPUs on the host. When configuring multiple guests, you probably don't want to overlap these @@ -228,3 +298,6 @@ command: ----- Entering VM 0 Shell ----- *** Booting Zephyr OS build v2.6.0-rc1-324-g1a03783861ad *** Hello World! acrn + + +.. _EHL: https://www.intel.com/content/www/us/en/products/docs/processors/embedded/enhanced-for-iot-platform-brief.html diff --git a/cmake/app/boilerplate.cmake b/cmake/app/boilerplate.cmake index 25bccc37dae3..b867acd0a9a4 100644 --- a/cmake/app/boilerplate.cmake +++ b/cmake/app/boilerplate.cmake @@ -424,6 +424,17 @@ please check your installation. ARCH roots searched: \n\ ${ARCH_ROOT}") endif() +if(DEFINED APPLICATION_CONFIG_DIR) + string(CONFIGURE ${APPLICATION_CONFIG_DIR} APPLICATION_CONFIG_DIR) + if(NOT IS_ABSOLUTE ${APPLICATION_CONFIG_DIR}) + get_filename_component(APPLICATION_CONFIG_DIR ${APPLICATION_CONFIG_DIR} ABSOLUTE) + endif() +else() + # Application config dir is not set, so we default to the application + # source directory as configuration directory. + set(APPLICATION_CONFIG_DIR ${APPLICATION_SOURCE_DIR}) +endif() + if(DEFINED CONF_FILE) # This ensures that CACHE{CONF_FILE} will be set correctly to current scope # variable CONF_FILE. An already current scope variable will stay the same. @@ -441,14 +452,9 @@ if(DEFINED CONF_FILE) # Need the file name to look for match. # Need path in order to check if it is absolute. get_filename_component(CONF_FILE_NAME ${CONF_FILE} NAME) - get_filename_component(CONF_FILE_DIR ${CONF_FILE} DIRECTORY) if(${CONF_FILE_NAME} MATCHES "prj_(.*).conf") set(CONF_FILE_BUILD_TYPE ${CMAKE_MATCH_1}) set(CONF_FILE_INCLUDE_FRAGMENTS true) - - if(NOT IS_ABSOLUTE ${CONF_FILE_DIR}) - set(CONF_FILE_DIR ${APPLICATION_SOURCE_DIR}/${CONF_FILE_DIR}) - endif() endif() endif() elseif(CACHED_CONF_FILE) @@ -459,21 +465,19 @@ elseif(CACHED_CONF_FILE) elseif(DEFINED ENV{CONF_FILE}) set(CONF_FILE $ENV{CONF_FILE}) -elseif(EXISTS ${APPLICATION_SOURCE_DIR}/prj_${BOARD}.conf) - set(CONF_FILE ${APPLICATION_SOURCE_DIR}/prj_${BOARD}.conf) +elseif(EXISTS ${APPLICATION_CONFIG_DIR}/prj_${BOARD}.conf) + set(CONF_FILE ${APPLICATION_CONFIG_DIR}/prj_${BOARD}.conf) -elseif(EXISTS ${APPLICATION_SOURCE_DIR}/prj.conf) - set(CONF_FILE ${APPLICATION_SOURCE_DIR}/prj.conf) +elseif(EXISTS ${APPLICATION_CONFIG_DIR}/prj.conf) + set(CONF_FILE ${APPLICATION_CONFIG_DIR}/prj.conf) set(CONF_FILE_INCLUDE_FRAGMENTS true) endif() if(CONF_FILE_INCLUDE_FRAGMENTS) - if(NOT CONF_FILE_DIR) - set(CONF_FILE_DIR ${APPLICATION_SOURCE_DIR}) - endif() - zephyr_file(CONF_FILES ${CONF_FILE_DIR}/boards KCONF CONF_FILE BUILD ${CONF_FILE_BUILD_TYPE}) + zephyr_file(CONF_FILES ${APPLICATION_CONFIG_DIR}/boards KCONF CONF_FILE BUILD ${CONF_FILE_BUILD_TYPE}) endif() +set(APPLICATION_CONFIG_DIR ${APPLICATION_CONFIG_DIR} CACHE INTERNAL "The application configuration folder") set(CACHED_CONF_FILE ${CONF_FILE} CACHE STRING "If desired, you can build the application using\ the configuration settings specified in an alternate .conf file using this parameter. \ These settings will override the settings in the application’s .config file or its default .conf file.\ @@ -482,23 +486,20 @@ The CACHED_CONF_FILE is internal Zephyr variable used between CMake runs. \ To change CONF_FILE, use the CONF_FILE variable.") unset(CONF_FILE CACHE) -zephyr_file(CONF_FILES ${APPLICATION_SOURCE_DIR}/boards DTS APP_BOARD_DTS) +zephyr_file(CONF_FILES ${APPLICATION_CONFIG_DIR}/boards DTS APP_BOARD_DTS) # The CONF_FILE variable is now set to its final value. zephyr_boilerplate_watch(CONF_FILE) if(DTC_OVERLAY_FILE) # DTC_OVERLAY_FILE has either been specified on the cmake CLI or is already - # in the CMakeCache.txt. This has precedence over the environment - # variable DTC_OVERLAY_FILE -elseif(DEFINED ENV{DTC_OVERLAY_FILE}) - set(DTC_OVERLAY_FILE $ENV{DTC_OVERLAY_FILE}) + # in the CMakeCache.txt. elseif(APP_BOARD_DTS) set(DTC_OVERLAY_FILE ${APP_BOARD_DTS}) -elseif(EXISTS ${APPLICATION_SOURCE_DIR}/${BOARD}.overlay) - set(DTC_OVERLAY_FILE ${APPLICATION_SOURCE_DIR}/${BOARD}.overlay) -elseif(EXISTS ${APPLICATION_SOURCE_DIR}/app.overlay) - set(DTC_OVERLAY_FILE ${APPLICATION_SOURCE_DIR}/app.overlay) +elseif(EXISTS ${APPLICATION_CONFIG_DIR}/${BOARD}.overlay) + set(DTC_OVERLAY_FILE ${APPLICATION_CONFIG_DIR}/${BOARD}.overlay) +elseif(EXISTS ${APPLICATION_CONFIG_DIR}/app.overlay) + set(DTC_OVERLAY_FILE ${APPLICATION_CONFIG_DIR}/app.overlay) endif() set(DTC_OVERLAY_FILE ${DTC_OVERLAY_FILE} CACHE STRING "If desired, you can \ @@ -613,6 +614,7 @@ set(KERNEL_S19_NAME ${KERNEL_NAME}.s19) set(KERNEL_EXE_NAME ${KERNEL_NAME}.exe) set(KERNEL_STAT_NAME ${KERNEL_NAME}.stat) set(KERNEL_STRIP_NAME ${KERNEL_NAME}.strip) +set(KERNEL_META_NAME ${KERNEL_NAME}.meta) include(${BOARD_DIR}/board.cmake OPTIONAL) @@ -659,6 +661,10 @@ set_property(TARGET app PROPERTY ARCHIVE_OUTPUT_DIRECTORY app) add_subdirectory(${ZEPHYR_BASE} ${__build_dir}) +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() + # Link 'app' with the Zephyr interface libraries. # # NB: This must be done in boilerplate.cmake because 'app' can only be diff --git a/cmake/extensions.cmake b/cmake/extensions.cmake index 1e506c3572dc..f864b8f286e6 100644 --- a/cmake/extensions.cmake +++ b/cmake/extensions.cmake @@ -1309,6 +1309,66 @@ function(pow2round n) set(${n} ${${n}} PARENT_SCOPE) endfunction() +# Function to create a build string based on BOARD, BOARD_REVISION, and BUILD +# type. +# +# This is a common function to ensure that build strings are always created +# in a uniform way. +# +# Usage: +# zephyr_build_string( +# BOARD +# [BOARD_REVISION ] +# [BUILD ] +# ) +# +# : Output variable where the build string will be returned. +# BOARD : Board name to use when creating the build string. +# BOARD_REVISION : Board revision to use when creating the build string. +# BUILD : Build type to use when creating the build string. +# +# Examples +# calling +# zephyr_build_string(build_string BOARD alpha BUILD debug) +# will return the string `alpha_debug` in `build_string` parameter. +# +# calling +# zephyr_build_string(build_string BOARD alpha BOARD_REVISION 1.0.0 BUILD debug) +# will return the string `alpha_1_0_0_debug` in `build_string` parameter. +# +function(zephyr_build_string outvar) + set(single_args BOARD BOARD_REVISION BUILD) + + cmake_parse_arguments(BUILD_STR "" "${single_args}" "" ${ARGN}) + if(BUILD_STR_UNPARSED_ARGUMENTS) + message(FATAL_ERROR + "zephyr_build_string(${ARGV0} ...) given unknown arguments:" + " ${BUILD_STR_UNPARSED_ARGUMENTS}" + ) + endif() + + if(DEFINED BUILD_STR_BOARD_REVISION AND NOT BUILD_STR_BOARD) + message(FATAL_ERROR + "zephyr_build_string(${ARGV0} BOARD_REVISION ${BUILD_STR_BOARD_REVISION} ...)" + " given without BOARD argument, please specify BOARD" + ) + endif() + + set(${outvar} ${BUILD_STR_BOARD}) + + if(DEFINED BUILD_STR_BOARD_REVISION) + string(REPLACE "." "_" revision_string ${BUILD_STR_BOARD_REVISION}) + set(${outvar} "${${outvar}}_${revision_string}") + endif() + + if(BUILD_STR_BUILD) + set(${outvar} "${${outvar}}_${BUILD_STR_BUILD}") + endif() + + # This updates the provided outvar in parent scope (callers scope) + set(${outvar} ${${outvar}} PARENT_SCOPE) +endfunction() + ######################################################## # 2. Kconfig-aware extensions ######################################################## @@ -2075,6 +2135,8 @@ endfunction() # Issue an error for any relative path not specified # by user with `-D` # +# returns an updated list of absolute paths +# # CONF_FILES : Find all configuration files in path and return them in a # list. Configuration files will be: # - DTS: Overlay files (.overlay) @@ -2096,7 +2158,6 @@ endfunction() # BUILD debug, will look for _debug.conf # and _debug.overlay, instead of .conf # -# returns an updated list of absolute paths function(zephyr_file) set(file_options APPLICATION_ROOT CONF_FILES) if((ARGC EQUAL 0) OR (NOT (ARGV0 IN_LIST file_options))) @@ -2112,7 +2173,7 @@ Please provide one of following: APPLICATION_ROOT, CONF_FILES") cmake_parse_arguments(FILE "" "${single_args}" "" ${ARGN}) if(FILE_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "zephyr_file(${ARGV0} ...) given unknown arguments: ${FILE_UNPARSED_ARGUMENTS}") + message(FATAL_ERROR "zephyr_file(${ARGV0} ...) given unknown arguments: ${FILE_UNPARSED_ARGUMENTS}") endif() @@ -2167,15 +2228,22 @@ Relative paths are only allowed with `-D${ARGV1}=`") endif() endif() - set(FILENAMES ${FILE_BOARD}) + zephyr_build_string(filename + BOARD ${FILE_BOARD} + BUILD ${FILE_BUILD} + ) + set(filename_list ${filename}) - if(DEFINED FILE_BOARD_REVISION) - string(REPLACE "." "_" revision_string ${FILE_BOARD_REVISION}) - list(APPEND FILENAMES "${FILE_BOARD}_${revision_string}") - endif() + zephyr_build_string(filename + BOARD ${FILE_BOARD} + BOARD_REVISION ${FILE_BOARD_REVISION} + BUILD ${FILE_BUILD} + ) + list(APPEND filename_list ${filename}) + list(REMOVE_DUPLICATES filename_list) if(FILE_DTS) - foreach(filename ${FILENAMES}) + foreach(filename ${filename_list}) if(EXISTS ${FILE_CONF_FILES}/${filename}.overlay) list(APPEND ${FILE_DTS} ${FILE_CONF_FILES}/${filename}.overlay) endif() @@ -2186,11 +2254,7 @@ Relative paths are only allowed with `-D${ARGV1}=`") endif() if(FILE_KCONF) - foreach(filename ${FILENAMES}) - if(FILE_BUILD) - set(filename "${filename}_${FILE_BUILD}") - endif() - + foreach(filename ${filename_list}) if(EXISTS ${FILE_CONF_FILES}/${filename}.conf) list(APPEND ${FILE_KCONF} ${FILE_CONF_FILES}/${filename}.conf) endif() @@ -2702,24 +2766,26 @@ function(dt_num_regs var) endfunction() # Usage: -# dt_reg_addr( PATH [INDEX ]) +# dt_reg_addr( PATH [INDEX ] [NAME ]) # -# Get the base address of the register block at index . -# If is omitted, then the value at index 0 will be returned. +# Get the base address of the register block at index , or with +# name . If and are both omitted, the value at +# index 0 will be returned. Do not give both and . # # The value will be returned in the parameter. # # Results can be: # - The base address of the register block # - will be undefined if node does not exists or does not have a register -# block at the requested index. +# block at the requested index or with the requested name # # : Return variable where the address value will be stored # PATH : Node path -# INDEX : Index number +# INDEX : Register block index number +# NAME : Register block name function(dt_reg_addr var) set(req_single_args "PATH") - set(single_args "INDEX") + set(single_args "INDEX;NAME") cmake_parse_arguments(DT_REG "" "${req_single_args};${single_args}" "" ${ARGN}) if(${ARGV0} IN_LIST req_single_args) @@ -2734,8 +2800,16 @@ function(dt_reg_addr var) endif() endforeach() - if(NOT DEFINED DT_REG_INDEX) + if(DEFINED DT_REG_INDEX AND DEFINED DT_REG_NAME) + message(FATAL_ERROR "dt_reg_addr(${ARGV0} ...) given both INDEX and NAME") + elseif(NOT DEFINED DT_REG_INDEX AND NOT DEFINED DT_REG_NAME) set(DT_REG_INDEX 0) + elseif(DEFINED DT_REG_NAME) + _dt_reg_get_index(DT_REG_INDEX "${DT_REG_PATH}" "${DT_REG_NAME}") + if(DT_REG_INDEX EQUAL "-1") + set(${var} PARENT_SCOPE) + return() + endif() endif() get_target_property(${var}_list devicetree_target "DT_REG|${DT_REG_PATH}|ADDR") @@ -2750,19 +2824,21 @@ function(dt_reg_addr var) endfunction() # Usage: -# dt_reg_size( PATH [INDEX ]) +# dt_reg_size( PATH [INDEX ] [NAME ]) # -# Get the size of the register block at index . -# If INDEX is omitted, then the value at index 0 will be returned. +# Get the size of the register block at index , or with +# name . If and are both omitted, the value at +# index 0 will be returned. Do not give both and . # # The value will be returned in the parameter. # # : Return variable where the size value will be stored # PATH : Node path -# INDEX : Index number +# INDEX : Register block index number +# NAME : Register block name function(dt_reg_size var) set(req_single_args "PATH") - set(single_args "INDEX") + set(single_args "INDEX;NAME") cmake_parse_arguments(DT_REG "" "${req_single_args};${single_args}" "" ${ARGN}) if(${ARGV0} IN_LIST req_single_args) @@ -2777,8 +2853,16 @@ function(dt_reg_size var) endif() endforeach() - if(NOT DEFINED DT_REG_INDEX) + if(DEFINED DT_REG_INDEX AND DEFINED DT_REG_NAME) + message(FATAL_ERROR "dt_reg_size(${ARGV0} ...) given both INDEX and NAME") + elseif(NOT DEFINED DT_REG_INDEX AND NOT DEFINED DT_REG_NAME) set(DT_REG_INDEX 0) + elseif(DEFINED DT_REG_NAME) + _dt_reg_get_index(DT_REG_INDEX "${DT_REG_PATH}" "${DT_REG_NAME}") + if(DT_REG_INDEX EQUAL "-1") + set(${var} PARENT_SCOPE) + return() + endif() endif() get_target_property(${var}_list devicetree_target "DT_REG|${DT_REG_PATH}|SIZE") @@ -2792,6 +2876,17 @@ function(dt_reg_size var) set(${var} ${${var}} PARENT_SCOPE) endfunction() +# Internal helper for dt_reg_addr/dt_reg_size; not meant to be used directly +function(_dt_reg_get_index var path name) + dt_prop(reg_names PATH "${path}" PROPERTY "reg-names") + if(NOT DEFINED reg_names) + set(index "-1") + else() + list(FIND reg_names "${name}" index) + endif() + set("${var}" "${index}" PARENT_SCOPE) +endfunction() + # Usage: # dt_has_chosen( PROPERTY ) # diff --git a/cmake/kconfig.cmake b/cmake/kconfig.cmake index 71668d0fe8aa..a3de2156f964 100644 --- a/cmake/kconfig.cmake +++ b/cmake/kconfig.cmake @@ -199,13 +199,14 @@ foreach(f ${merge_config_files}) if(IS_ABSOLUTE ${f}) set(path ${f}) else() - set(path ${APPLICATION_SOURCE_DIR}/${f}) + set(path ${APPLICATION_CONFIG_DIR}/${f}) endif() list(APPEND merge_config_files_with_absolute_paths ${path}) endforeach() +set(merge_config_files ${merge_config_files_with_absolute_paths}) -foreach(f ${merge_config_files_with_absolute_paths}) +foreach(f ${merge_config_files}) if(NOT EXISTS ${f} OR IS_DIRECTORY ${f}) message(FATAL_ERROR "File not found: ${f}") endif() @@ -214,7 +215,7 @@ endforeach() # Calculate a checksum of merge_config_files to determine if we need # to re-generate .config set(merge_config_files_checksum "") -foreach(f ${merge_config_files_with_absolute_paths}) +foreach(f ${merge_config_files}) file(MD5 ${f} checksum) set(merge_config_files_checksum "${merge_config_files_checksum}${checksum}") endforeach() diff --git a/cmake/zephyr_module.cmake b/cmake/zephyr_module.cmake index d0e8b85f7fc1..21850f908fa1 100644 --- a/cmake/zephyr_module.cmake +++ b/cmake/zephyr_module.cmake @@ -80,6 +80,20 @@ if(WEST OR ZEPHYR_MODULES) endforeach() endif() + if(EXISTS ${CMAKE_BINARY_DIR}/zephyr_modules.txt) + file(STRINGS ${CMAKE_BINARY_DIR}/zephyr_modules.txt ZEPHYR_MODULES_TXT + ENCODING UTF-8) + + set(ZEPHYR_MODULE_NAMES) + foreach(module ${ZEPHYR_MODULES_TXT}) + # Match "":"" for each line of file, each corresponding to + # one module. The use of quotes is required due to CMake not supporting + # lazy regexes (it supports greedy only). + string(REGEX REPLACE "\"(.*)\":\".*\":\".*\"" "\\1" module_name ${module}) + list(APPEND ZEPHYR_MODULE_NAMES ${module_name}) + endforeach() + endif() + foreach(root ${MODULE_EXT_ROOT}) if(NOT EXISTS ${root}) message(FATAL_ERROR "No `modules.cmake` found in module root `${root}`.") @@ -88,11 +102,7 @@ if(WEST OR ZEPHYR_MODULES) include(${root}/modules/modules.cmake) endforeach() - if(EXISTS ${CMAKE_BINARY_DIR}/zephyr_modules.txt) - file(STRINGS ${CMAKE_BINARY_DIR}/zephyr_modules.txt ZEPHYR_MODULES_TXT - ENCODING UTF-8) - set(ZEPHYR_MODULE_NAMES) - + if(DEFINED ZEPHYR_MODULES_TXT) foreach(module ${ZEPHYR_MODULES_TXT}) # Match "":"" for each line of file, each corresponding to # one module. The use of quotes is required due to CMake not supporting @@ -102,8 +112,6 @@ if(WEST OR ZEPHYR_MODULES) string(REGEX REPLACE "\".*\":\"(.*)\":\".*\"" "\\1" module_path ${module}) string(REGEX REPLACE "\".*\":\".*\":\"(.*)\"" "\\1" cmake_path ${module}) - list(APPEND ZEPHYR_MODULE_NAMES ${module_name}) - zephyr_string(SANITIZE TOUPPER MODULE_NAME_UPPER ${module_name}) if(NOT ${MODULE_NAME_UPPER} STREQUAL CURRENT) set(ZEPHYR_${MODULE_NAME_UPPER}_MODULE_DIR ${module_path}) diff --git a/doc/application/index.rst b/doc/application/index.rst index 73d6b2e40a36..2aab6c129378 100644 --- a/doc/application/index.rst +++ b/doc/application/index.rst @@ -579,6 +579,29 @@ documentation `runningcmake`_ . Application Configuration ************************* +.. _application-configuration-directory: + +Application Configuration Directory +=================================== + +Zephyr will use configuration files from the application's configuration +directory except for files with an absolute path provided by the arguments +described earlier, for example ``CONF_FILE``, ``OVERLAY_CONFIG``, and +``DTC_OVERLAY_FILE``. + +The application configuration directory is defined by the +``APPLICATION_CONFIG_DIR`` variable. + +``APPLICATION_CONFIG_DIR`` will be set by one of the sources below with the +highest priority listed first. + +1. If ``APPLICATION_CONFIG_DIR`` is specified by the user with + ``-DAPPLICATION_CONFIG_DIR=`` or in a CMake file before + ``find_package(Zephyr)`` then this folder is used a the application's + configuration directory. + +2. The application's source directory. + .. _application-kconfig: Kconfig Configuration @@ -605,6 +628,28 @@ The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration options. +Experimental features +********************* + +Zephyr is a project under constant development and thus there are features that +are still in early stages of their development cycle. Such features will be +marked ``[EXPERIMENTAL]`` in their Kconfig title. + +The :kconfig:`CONFIG_WARN_EXPERIMENTAL` setting can be used to enable warnings +at CMake configure time if any experimental feature is enabled. + +.. code-block:: none + + CONFIG_WARN_EXPERIMENTAL=y + +For example, enabling experimental warnings and building a sample which enables +:kconfig:`CONFIG_BT_EXT_ADV` will print the following warning at CMake +configure time. + +.. code-block:: shell + + warning: Experimental symbol BT_EXT_ADV is enabled. + Devicetree Overlays =================== diff --git a/doc/getting_started/toolchain_3rd_party_x_compilers.rst b/doc/getting_started/toolchain_3rd_party_x_compilers.rst index e9701ad937a8..15341610a381 100644 --- a/doc/getting_started/toolchain_3rd_party_x_compilers.rst +++ b/doc/getting_started/toolchain_3rd_party_x_compilers.rst @@ -8,14 +8,14 @@ external organization. Several of these are available. .. _toolchain_gnuarmemb: -GNU ARM Embedded +GNU Arm Embedded **************** .. warning:: Do not install the toolchain into a path with spaces. -#. Download and install a `GNU ARM Embedded`_ build for your operating system +#. Download and install a `GNU Arm Embedded`_ build for your operating system and extract it on your file system. .. note:: @@ -61,6 +61,57 @@ GNU ARM Embedded - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``gnuarmemb``. - Set :envvar:`GNUARMEMB_TOOLCHAIN_PATH` to the brew installation directory (something like ``/usr/local``) +.. _toolchain_armclang: + +Arm Compiler 6 +************** + +#. Download and install a development suite containing the `Arm Compiler 6`_ + for your operating system. + +#. :ref:`Set these environment variables `: + + - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``armclang``. + - Set :envvar:`ARMCLANG_TOOLCHAIN_PATH` to the toolchain installation + directory. + +#. The Arm Compiler 6 needs the :envvar:`ARMLMD_LICENSE_FILE` environment + variable to point to your license file or server. + +For example: + + .. code-block:: console + + # Linux, macOS, license file: + export ARMLMD_LICENSE_FILE=//license_armds.dat + # Linux, macOS, license server: + export ARMLMD_LICENSE_FILE=8224@myserver + + # Windows, license file: + > set ARMLMD_LICENSE_FILE=c:\\license_armds.dat + # Windows, license server: + > set ARMLMD_LICENSE_FILE=8224@myserver + +#. If the Arm Compiler 6 was installed as part of an Arm Development Studio, then + you must set the :envvar:`ARM_PRODUCT_DEF` to point to the product definition file: + See also: `Product and toolkit configuration `_. + For example if the Arm Development Studio is installed in: + ``/opt/armds-2020-1`` with a Gold license, then set :envvar:`ARM_PRODUCT_DEF` + to point to ``/opt/armds-2020-1/gold.elmap``. + + .. note:: + + The Arm Compiler 6 uses ``armlink`` for linking. This is incompatible + with Zephyr's linker script template, which works with GNU ld. Zephyr's + Arm Compiler 6 support Zephyr's CMake linker script generator, which + supports generating scatter files. Basic scatter file support is in + place, but there are still areas covered in ld templates which are not + fully supported by the CMake linker script generator. + + Some Zephyr subsystems or modules may also contain C or assembly code + that relies on GNU intrinsics and have not yet been updated to work fully + with ``armclang``. + Intel oneAPI Toolkit ********************* @@ -159,5 +210,6 @@ You can build toolchains from source code using crosstool-NG. $ echo $XTOOLS_TOOLCHAIN_PATH /Volumes/CrossToolNGNew/build/output/ -.. _GNU ARM Embedded: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm +.. _GNU Arm Embedded: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm .. _crosstool-ng site: http://crosstool-ng.org +.. _Arm Compiler 6: https://developer.arm.com/tools-and-software/embedded/arm-compiler/downloads/version-6 diff --git a/doc/guides/arch/arc-support-status.rst b/doc/guides/arch/arc-support-status.rst index 9d58da5c4389..77c901aa2e1d 100644 --- a/doc/guides/arch/arc-support-status.rst +++ b/doc/guides/arch/arc-support-status.rst @@ -41,7 +41,7 @@ Legend: +---------------------------------------------------------------------+------------+-------------+--------+------------+ | Hardware floating point unit (FPU) | Y | Y | N | TBD | +---------------------------------------------------------------------+------------+-------------+--------+------------+ -| Symmetric multiprocessing (SMP) support, switch-based | N/A | Y | TBD | WIP | +| Symmetric multiprocessing (SMP) support, switch-based | N/A | Y | TBD | Y | +---------------------------------------------------------------------+------------+-------------+--------+------------+ | Hardware-assisted stack checking | Y | Y | TBD | N | +---------------------------------------------------------------------+------------+-------------+--------+------------+ diff --git a/doc/guides/build/kconfig/setting.rst b/doc/guides/build/kconfig/setting.rst index 41ed19c0bd07..fa919f625660 100644 --- a/doc/guides/build/kconfig/setting.rst +++ b/doc/guides/build/kconfig/setting.rst @@ -154,18 +154,26 @@ The application configuration can come from the sources below. By default, :file:`boards/_.conf` is used. 3. Otherwise, :file:`prj_.conf` is used if it exists in the application - directory. + configuration directory. 4. Otherwise, if :file:`boards/.conf` exists in the application - directory, the result of merging it with :file:`prj.conf` is used. + configuration directory, the result of merging it with :file:`prj.conf` is + used. 5. Otherwise, if board revisions are used and :file:`boards/_.conf` exists in the application - directory, the result of merging it with :file:`prj.conf` and + configuration directory, the result of merging it with :file:`prj.conf` and :file:`boards/.conf` is used. 6. Otherwise, :file:`prj.conf` is used if it exists in the application - directory + configuration directory + +All configuration files will be taken from the application's configuration +directory except for files with an absolute path that are given with the +``CONF_FILE`` argument. + +See :ref:`Application Configuration Directory ` +on how the application configuration directory is defined. If a symbol is assigned both in :file:`_defconfig` and in the application configuration, the value set in the application configuration takes diff --git a/doc/guides/device_mgmt/dfu.rst b/doc/guides/device_mgmt/dfu.rst index e39150e30f64..4ab96c0e964d 100644 --- a/doc/guides/device_mgmt/dfu.rst +++ b/doc/guides/device_mgmt/dfu.rst @@ -36,11 +36,21 @@ In order to use MCUboot with Zephyr you need to take the following into account: 1. You will need to define the flash partitions required by MCUboot; see :ref:`flash_map_api` for details. -2. Your application's :file:`.conf` file needs to enable the +2. You will have to specify your flash parition as the chosen code partition + +.. code-block:: devicetree + + / { + chosen { + zephyr,code-partition = &slot0_partition; + }; + }; + +3. Your application's :file:`.conf` file needs to enable the :kconfig:`CONFIG_BOOTLOADER_MCUBOOT` Kconfig option in order for Zephyr to be built in an MCUboot-compatible manner -3. You need to build and flash MCUboot itself on your device -4. You might need to take precautions to avoid mass erasing the flash and also +4. You need to build and flash MCUboot itself on your device +5. You might need to take precautions to avoid mass erasing the flash and also to flash the Zephyr application image at the correct offset (right after the bootloader) diff --git a/doc/guides/dts/howtos.rst b/doc/guides/dts/howtos.rst index 39a118bc9e0e..c0edaaa4ff98 100644 --- a/doc/guides/dts/howtos.rst +++ b/doc/guides/dts/howtos.rst @@ -210,7 +210,6 @@ Here are some ways to set it: (``-DDTC_OVERLAY_FILE="file1.overlay;file2.overlay"``) #. with the CMake ``set()`` command in the application ``CMakeLists.txt``, before including zephyr's :file:`boilerplate.cmake` file -#. using a ``DTC_OVERLAY_FILE`` environment variable (deprecated) #. create a ``boards/_.overlay`` file in the application folder for the current board revision. This requires that the board supports multiple revisions, see :ref:`porting_board_revisions`. diff --git a/doc/guides/test/twister.rst b/doc/guides/test/twister.rst index dd5f584de826..ff0802171409 100644 --- a/doc/guides/test/twister.rst +++ b/doc/guides/test/twister.rst @@ -41,8 +41,8 @@ To run the script in the local tree, follow the steps below: $ source zephyr-env.sh $ ./scripts/twister -If you have a system with a large number of cores, you can build and run -all possible tests using the following options: +If you have a system with a large number of cores and plenty of free storage space, +you can build and run all possible tests using the following options: :: @@ -512,21 +512,24 @@ Executing tests on a single device To use this feature on a single connected device, run twister with the following new options:: - scripts/twister --device-testing --device-serial /dev/ttyACM0 -p \ - frdm_k64f -T tests/kernel + scripts/twister --device-testing --device-serial /dev/ttyACM0 \ + --device-serial-baud 9600 -p frdm_k64f -T tests/kernel The ``--device-serial`` option denotes the serial device the board is connected to. This needs to be accessible by the user running twister. You can run this on only one board at a time, specified using the ``--platform`` option. +The ``--device-serial-baud`` option is only needed if your device does not run at +115200 baud. + Executing tests on multiple devices =================================== To build and execute tests on multiple devices connected to the host PC, a hardware map needs to be created with all connected devices and their -details such as the serial device and their IDs if available. Run the following -command to produce the hardware map:: +details such as the serial device, baud and their IDs if available. +Run the following command to produce the hardware map:: ./scripts/twister --generate-hardware-map map.yml @@ -558,12 +561,16 @@ this example we are using a reel_board and an nrf52840dk_nrf52840:: product: DAPLink CMSIS-DAP runner: pyocd serial: /dev/cu.usbmodem146114202 + baud: '9600' - connected: true id: 000683759358 platform: nrf52840dk_nrf52840 product: J-Link runner: nrfjprog serial: /dev/cu.usbmodem0006837593581 + baud: '9600' + +The baud entry is only needed if not running at 115200. If the map file already exists, then new entries are added and existing entries will be updated. This way you can use one single master hardware map and update diff --git a/doc/index.rst b/doc/index.rst index 2046f6071671..b43a7eab5312 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -117,7 +117,6 @@ Sections Indices and Tables ****************** -* :ref:`configuration_options` * :ref:`glossary` * :ref:`genindex` diff --git a/doc/reference/bluetooth/mesh/access.rst b/doc/reference/bluetooth/mesh/access.rst index e2acbc2fe2e9..acfb98cda9ef 100644 --- a/doc/reference/bluetooth/mesh/access.rst +++ b/doc/reference/bluetooth/mesh/access.rst @@ -100,6 +100,16 @@ populate the :c:member:`bt_mesh_model_pub.update` callback. The message is published, allowing the model to change the payload to reflect its current state. +By setting :c:member:`bt_mesh_model_pub.retr_update` to 1, the model can +configure the :c:member:`bt_mesh_model_pub.update` callback to be triggered +on every retransmission. This can, for example, be used by models that make +use of a Delay parameter, which can be adjusted for every retransmission. +The :c:func:`bt_mesh_model_pub_is_retransmission` function can be +used to differentiate a first publication and a retransmission. +The :c:macro:`BT_MESH_PUB_MSG_TOTAL` and :c:macro:`BT_MESH_PUB_MSG_NUM` macros +can be used to return total number of transmissions and the retransmission +number within one publication interval. + Extended models =============== diff --git a/doc/reference/bluetooth/mesh/shell.rst b/doc/reference/bluetooth/mesh/shell.rst index 4f5e7eae5895..48162942bc51 100644 --- a/doc/reference/bluetooth/mesh/shell.rst +++ b/doc/reference/bluetooth/mesh/shell.rst @@ -11,7 +11,7 @@ The Bluetooth mesh shell interface provides access to most Bluetooth mesh featur Prerequisites ************* -The Bluetooth mesh shell subsystem depends on the :ref:`bluetooth_mesh_models_cfg_cli` and :ref:`bluetooth_mesh_models_health_cli` models. +The Bluetooth mesh shell subsystem depends on the application to create the composition data and do the mesh initialization. Application *********** @@ -125,7 +125,7 @@ General configuration ``mesh init`` ------------- - Initialize the mesh. This command must be run before any other mesh command. + Initialize the mesh shell. This command must be run before any other mesh command. ``mesh reset `` @@ -298,7 +298,7 @@ Provisioning Configuration Client model ========================== -The Bluetooth mesh shell module instantiates a Configuration Client model for configuring itself and other nodes in the mesh network. +The Configuration Client model is an optional mesh subsystem that can be enabled through the :kconfig:`CONFIG_BT_MESH_CFG_CLI` configuration option. If included, the Bluetooth mesh shell module instantiates a Configuration Client model for configuring itself and other nodes in the mesh network. The Configuration Client uses the general messages parameters set by ``mesh dst`` and ``mesh netidx`` to target specific nodes. When the Bluetooth mesh shell node is provisioned, the Configuration Client model targets itself by default. When another node has been provisioned by the Bluetooth mesh shell, the Configuration Client model targets the new node. The Configuration Client always sends messages using the Device key bound to the destination address, so it will only be able to configure itself and mesh nodes it provisioned. @@ -583,7 +583,7 @@ The Configuration Client uses the general messages parameters set by ``mesh dst` Health Client model =================== -The Bluetooth mesh shell module instantiates a Health Client model for configuring itself and other nodes in the mesh network. +The Health Client model is an optional mesh subsystem that can be enabled through the :kconfig:`CONFIG_BT_MESH_HEALTH_CLI` configuration option. If included, the Bluetooth mesh shell module instantiates a Health Client model for configuring itself and other nodes in the mesh network. The Health Client uses the general messages parameters set by ``mesh dst`` and ``mesh netidx`` to target specific nodes. When the Bluetooth mesh shell node is provisioned, the Health Client model targets itself by default. When another node has been provisioned by the Bluetooth mesh shell, the Health Client model targets the new node. The Health Client always sends messages using the Device key bound to the destination address, so it will only be able to configure itself and mesh nodes it provisioned. diff --git a/doc/reference/devicetree/api.rst b/doc/reference/devicetree/api.rst index 7f0cf233ebc5..651f85140fc1 100644 --- a/doc/reference/devicetree/api.rst +++ b/doc/reference/devicetree/api.rst @@ -254,6 +254,8 @@ channels (e.g. ADC or DAC channels) for conversion. .. doxygengroup:: devicetree-io-channels +.. _devicetree-pinctrl-api: + Pinctrl (pin control) ===================== diff --git a/doc/reference/kernel/data_passing/message_queues.rst b/doc/reference/kernel/data_passing/message_queues.rst index 7f7e450d59e4..5e8d43eb4f25 100644 --- a/doc/reference/kernel/data_passing/message_queues.rst +++ b/doc/reference/kernel/data_passing/message_queues.rst @@ -202,10 +202,11 @@ in an asynchronous manner. .. note:: A message queue can be used to transfer large data items, if desired. However, this can increase interrupt latency as interrupts are locked - while a data item is written or read. It is usually preferable to transfer - large data items by exchanging a pointer to the data item, rather than the - data item itself. The kernel's memory map and memory pool object types - can be helpful for data transfers of this sort. + while a data item is written or read. The time to write or read a data item + increases linearly with its size since the item is copied in its entirety + to or from the buffer in memory. For this reason, it is usually preferable + to transfer large data items by exchanging a pointer to the data item, + rather than the data item itself. A synchronous transfer can be achieved by using the kernel's mailbox object type. diff --git a/doc/reference/kernel/data_passing/pipes.rst b/doc/reference/kernel/data_passing/pipes.rst index ff78eab2b0c6..802ad41644fd 100644 --- a/doc/reference/kernel/data_passing/pipes.rst +++ b/doc/reference/kernel/data_passing/pipes.rst @@ -164,8 +164,7 @@ Use a pipe to send streams of data between threads. .. note:: A pipe can be used to transfer long streams of data if desired. However it is often preferable to send pointers to large data items to avoid - copying the data. The kernel's memory map and memory pool object types - can be helpful for data transfers of this sort. + copying the data. Configuration Options ********************* diff --git a/doc/reference/kernel/data_passing/stacks.rst b/doc/reference/kernel/data_passing/stacks.rst index 89c0ff5dc392..71c7783a632f 100644 --- a/doc/reference/kernel/data_passing/stacks.rst +++ b/doc/reference/kernel/data_passing/stacks.rst @@ -32,12 +32,12 @@ A stack must be initialized before it can be used. This sets its queue to empty. A data value can be **added** to a stack by a thread or an ISR. The value is given directly to a waiting thread, if one exists; otherwise the value is added to the LIFO's queue. -The kernel does *not* detect attempts to add a data value to a stack -that has already reached its maximum quantity of queued values. .. note:: - Adding a data value to a stack that is already full will result in - array overflow, and lead to unpredictable behavior. + If :kconfig:`CONFIG_NO_RUNTIME_CHECKS` is enabled, the kernel will *not* detect + and prevent attempts to add a data value to a stack that has already reached + its maximum quantity of queued values. Adding a data value to a stack that is + already full will result in array overflow, and lead to unpredictable behavior. A data value may be **removed** from a stack by a thread. If the stack's queue is empty a thread may choose to wait for it to be given. diff --git a/doc/reference/kernel/other/float.rst b/doc/reference/kernel/other/float.rst index 3ee0a243b839..ed8f2112c3b4 100644 --- a/doc/reference/kernel/other/float.rst +++ b/doc/reference/kernel/other/float.rst @@ -113,7 +113,7 @@ an extra 72 bytes of stack space where the callee-saved FP context can be saved. `Lazy Stacking -`_ +`_ is currently enabled in Zephyr applications on ARM Cortex-M architecture, minimizing interrupt latency, when the floating point context is active. diff --git a/doc/reference/kernel/scheduling/index.rst b/doc/reference/kernel/scheduling/index.rst index 7032d4045533..20a65bdd6f29 100644 --- a/doc/reference/kernel/scheduling/index.rst +++ b/doc/reference/kernel/scheduling/index.rst @@ -39,6 +39,15 @@ The kernel's scheduler selects the highest priority ready thread to be the current thread. When multiple ready threads of the same priority exist, the scheduler chooses the one that has been waiting longest. +A thread's relative priority is primarily determined by its static priority. +However, when both earliest-deadline-first scheduling is enabled +(:kconfig:`CONFIG_SCHED_DEADLINE`) and a choice of threads have equal +static priority, then the thread with the earlier deadline is considered +to have the higher priority. Thus, when earliest-deadline-first scheduling is +enabled, two threads are only considered to have the same priority when both +their static priorities and deadlines are equal. The routine +:c:func:`k_thread_deadline_set` is used to set a thread's deadline. + .. note:: Execution of ISRs takes precedence over thread execution, so the execution of the current thread may be replaced by an ISR diff --git a/doc/reference/kernel/synchronization/semaphores.rst b/doc/reference/kernel/synchronization/semaphores.rst index b2e1f704ef09..29eed5114853 100644 --- a/doc/reference/kernel/synchronization/semaphores.rst +++ b/doc/reference/kernel/synchronization/semaphores.rst @@ -37,6 +37,13 @@ Any number of threads may wait on an unavailable semaphore simultaneously. When the semaphore is given, it is taken by the highest priority thread that has waited longest. +.. note:: + You may initialize a "full" semaphore (count equal to limit) to limit the number + of threads able to execute the critical section at the same time. You may also + initialize an empty semaphore (count equal to 0, with a limit greater than 0) + to create a gate through which no waiting thread may pass until the semaphore + is incremented. All standard use cases of the common semaphore are supported. + .. note:: The kernel does allow an ISR to take a semaphore, however the ISR must not attempt to wait if the semaphore is unavailable. diff --git a/doc/reference/kernel/threads/index.rst b/doc/reference/kernel/threads/index.rst index 8947feab9444..7bf0bfd5f0ee 100644 --- a/doc/reference/kernel/threads/index.rst +++ b/doc/reference/kernel/threads/index.rst @@ -245,6 +245,10 @@ A thread's initial priority value can be altered up or down after the thread has been started. Thus it is possible for a preemptible thread to become a cooperative thread, and vice versa, by changing its priority. +.. note:: + The scheduler does not make heuristic decisions to re-prioritize threads. + Thread priorities are set and changed only at the application's request. + The kernel supports a virtually unlimited number of thread priority levels. The configuration options :kconfig:`CONFIG_NUM_COOP_PRIORITIES` and :kconfig:`CONFIG_NUM_PREEMPT_PRIORITIES` specify the number of priority @@ -269,9 +273,10 @@ When enabled (see :kconfig:`CONFIG_NUM_METAIRQ_PRIORITIES`), there is a special subclass of cooperative priorities at the highest (numerically lowest) end of the priority space: meta-IRQ threads. These are scheduled according to their normal priority, but also have the special ability -to preempt all other threads (and other meta-irq threads) at lower +to preempt all other threads (and other meta-IRQ threads) at lower priorities, even if those threads are cooperative and/or have taken a -scheduler lock. +scheduler lock. Meta-IRQ threads are still threads, however, +and can still be interrupted by any hardware interrupt. This behavior makes the act of unblocking a meta-IRQ thread (by any means, e.g. creating it, calling k_sem_give(), etc.) into the @@ -284,7 +289,7 @@ run before the current CPU returns into application code. Unlike similar features in other OSes, meta-IRQ threads are true threads and run on their own stack (which must be allocated normally), -not the per-CPU interrupt stack. Design work to enable the use of the +not the per-CPU interrupt stack. Design work to enable the use of the IRQ stack on supported architectures is pending. Note that because this breaks the promise made to cooperative diff --git a/doc/reference/usb/hid.rst b/doc/reference/usb/hid.rst new file mode 100644 index 000000000000..6590abd6e037 --- /dev/null +++ b/doc/reference/usb/hid.rst @@ -0,0 +1,61 @@ +.. _usb_device_hid: + +USB Human Interface Devices (HID) support +######################################### + +Since the USB HID specification is not only used by the USB subsystem, the USB HID API +is split into two header files :zephyr_file:`include/usb/class/hid.h` +and :zephyr_file:`include/usb/class/usb_hid.h`. The second includes a specific +part for HID support in the USB device stack. + +HID Item helpers +**************** + +HID item helper macros can be used to compose a HID Report Descriptor. +The names correspond to those used in the USB HID Specification. + +Example of a HID Report Descriptor: + +.. code-block:: c + + static const uint8_t hid_report_desc[] = { + HID_USAGE_PAGE(HID_USAGE_GEN_DESKTOP), + HID_USAGE(HID_USAGE_GEN_DESKTOP_UNDEFINED), + HID_COLLECTION(HID_COLLECTION_APPLICATION), + HID_LOGICAL_MIN8(0), + /* logical maximum 255 */ + HID_LOGICAL_MAX16(0xFF, 0x00), + HID_REPORT_ID(1), + HID_REPORT_SIZE(8), + HID_REPORT_COUNT(1), + HID_USAGE(HID_USAGE_GEN_DESKTOP_UNDEFINED), + /* HID_INPUT (Data, Variable, Absolute) */ + HID_INPUT(0x02), + HID_END_COLLECTION, + }; + + +HID items reference +******************* + +.. doxygengroup:: usb_hid_items + +HID types reference +******************* + +.. doxygengroup:: usb_hid_types + +HID Mouse and Keyboard report descriptors +***************************************** + +The pre-defined Mouse and Keyboard report descriptors can be used by +a HID device implementation or simply as examples. + +.. doxygengroup:: usb_hid_mk_report_desc + +HID Class Device API reference +****************************** + +USB HID devices like mouse, keyboard, or any other specific device use this API. + +.. doxygengroup:: usb_hid_device_api diff --git a/doc/reference/usb/index.rst b/doc/reference/usb/index.rst index 8fbe99af1ec1..5e5f866a3883 100644 --- a/doc/reference/usb/index.rst +++ b/doc/reference/usb/index.rst @@ -1,252 +1,13 @@ .. _usb_api: -USB device stack -################ +USB device support +################## -.. contents:: - :depth: 2 - :local: - :backlinks: top +.. toctree:: + :maxdepth: 1 -USB Vendor and Product identifiers -********************************** - -The USB Vendor ID for the Zephyr project is 0x2FE3. The default USB Product -ID for the Zephyr project is 0x100. The USB bcdDevice Device Release Number -represents the Zephyr kernel major and minor versions as a binary coded -decimal value. When a vendor integrates the Zephyr USB subsystem into a -product, the vendor must use the USB Vendor and Product ID assigned to them. -A vendor integrating the Zephyr USB subsystem in a product must not use the -Vendor ID of the Zephyr project. - -The USB maintainer, if one is assigned, or otherwise the Zephyr Technical -Steering Committee, may allocate other USB Product IDs based on well-motivated -and documented requests. - -Each USB sample has its own unique Product ID. -When adding a new sample, add a new entry in :file:`samples/subsys/usb/usb_pid.Kconfig` -and a Kconfig file inside your sample subdirectory. -The following Product IDs are currently used: - -* :kconfig:`CONFIG_USB_PID_CDC_ACM_SAMPLE` -* :kconfig:`CONFIG_USB_PID_CDC_ACM_COMPOSITE_SAMPLE` -* :kconfig:`CONFIG_USB_PID_HID_CDC_SAMPLE` -* :kconfig:`CONFIG_USB_PID_CONSOLE_SAMPLE` -* :kconfig:`CONFIG_USB_PID_DFU_SAMPLE` -* :kconfig:`CONFIG_USB_PID_HID_SAMPLE` -* :kconfig:`CONFIG_USB_PID_HID_MOUSE_SAMPLE` -* :kconfig:`CONFIG_USB_PID_MASS_SAMPLE` -* :kconfig:`CONFIG_USB_PID_TESTUSB_SAMPLE` -* :kconfig:`CONFIG_USB_PID_WEBUSB_SAMPLE` -* :kconfig:`CONFIG_USB_PID_BLE_HCI_H4_SAMPLE` - -USB device controller drivers -***************************** - -The Device Controller Driver Layer implements the low level control routines -to deal directly with the hardware. All device controller drivers should -implement the APIs described in file usb_dc.h. This allows the integration of -new USB device controllers to be done without changing the upper layers. - -USB Device Controller API -========================= - -.. doxygengroup:: _usb_device_controller_api - -USB device core layer -********************* - -The USB Device core layer is a hardware independent interface between USB -device controller driver and USB device class drivers or customer applications. -It's a port of the LPCUSB device stack. It provides the following -functionalities: - -* Responds to standard device requests and returns standard descriptors, - essentially handling 'Chapter 9' processing, specifically the standard - device requests in table 9-3 from the universal serial bus specification - revision 2.0. -* Provides a programming interface to be used by USB device classes or - customer applications. The APIs are described in the usb_device.h file. -* Uses the APIs provided by the device controller drivers to interact with - the USB device controller. - - -USB Device Core Layer API -========================= - -There are two ways to transmit data, using the 'low' level read/write API or -the 'high' level transfer API. - -Low level API - To transmit data to the host, the class driver should call usb_write(). - Upon completion the registered endpoint callback will be called. Before - sending another packet the class driver should wait for the completion of - the previous write. When data is received, the registered endpoint callback - is called. usb_read() should be used for retrieving the received data. - For CDC ACM sample driver this happens via the OUT bulk endpoint handler - (cdc_acm_bulk_out) mentioned in the endpoint array (cdc_acm_ep_data). - -High level API - The usb_transfer method can be used to transfer data to/from the host. The - transfer API will automatically split the data transmission into one or more - USB transaction(s), depending endpoint max packet size. The class driver does - not have to implement endpoint callback and should set this callback to the - generic usb_transfer_ep_callback. - -.. doxygengroup:: _usb_device_core_api - -USB device class drivers -************************ - -Zephyr USB Device Stack supports many standard classes, such as HID, MSC -Ethernet over USB, DFU, Bluetooth. - -Implementing non standard USB class -=================================== - -Configuration of USB Device is done in the stack layer. - -The following structures and callbacks need to be defined: - -* Part of USB Descriptor table -* USB Endpoint configuration table -* USB Device configuration structure -* Endpoint callbacks -* Optionally class, vendor and custom handlers - -For example, for USB loopback application: - -.. literalinclude:: ../../../subsys/usb/class/loopback.c - :language: c - :start-after: usb.rst config structure start - :end-before: usb.rst config structure end - :linenos: - -Endpoint configuration: - -.. literalinclude:: ../../../subsys/usb/class/loopback.c - :language: c - :start-after: usb.rst endpoint configuration start - :end-before: usb.rst endpoint configuration end - :linenos: - -USB Device configuration structure: - -.. literalinclude:: ../../../subsys/usb/class/loopback.c - :language: c - :start-after: usb.rst device config data start - :end-before: usb.rst device config data end - :linenos: - - -The vendor device requests are forwarded by the USB stack core driver to the -class driver through the registered vendor handler. - -For the loopback class driver, :c:func:`loopback_vendor_handler` processes -the vendor requests: - -.. literalinclude:: ../../../subsys/usb/class/loopback.c - :language: c - :start-after: usb.rst vendor handler start - :end-before: usb.rst vendor handler end - :linenos: - -The class driver waits for the :makevar:`USB_DC_CONFIGURED` device status code -before transmitting any data. - -.. _testing_USB_native_posix: - -Testing USB over USP/IP in native_posix -*************************************** - -Virtual USB controller implemented through USB/IP might be used to test USB -Device stack. Follow general build procedure to build USB sample for -the native_posix configuration. - -Run built sample with: - -.. code-block:: console - - west build -t run - -In a terminal window, run the following command to list USB devices: - -.. code-block:: console - - $ usbip list -r localhost - Exportable USB devices - ====================== - - 127.0.0.1 - 1-1: unknown vendor : unknown product (2fe3:0100) - : /sys/devices/pci0000:00/0000:00:01.2/usb1/1-1 - : (Defined at Interface level) (00/00/00) - : 0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00) - -In a terminal window, run the following command to attach USB device: - -.. code-block:: console - - $ sudo usbip attach -r localhost -b 1-1 - -The USB device should be connected to your Linux host, and verified with the following commands: - -.. code-block:: console - - $ sudo usbip port - Imported USB devices - ==================== - Port 00: at Full Speed(12Mbps) - unknown vendor : unknown product (2fe3:0100) - 7-1 -> usbip://localhost:3240/1-1 - -> remote bus/dev 001/002 - $ lsusb -d 2fe3:0100 - Bus 007 Device 004: ID 2fe3:0100 - -USB Human Interface Devices (HID) support -***************************************** - -HID Item helpers -================ - -HID item helper macros can be used to compose a HID Report Descriptor. -The names correspond to those used in the USB HID Specification. - -Example of a HID Report Descriptor: - -.. code-block:: c - - static const uint8_t hid_report_desc[] = { - HID_USAGE_PAGE(HID_USAGE_GEN_DESKTOP), - HID_USAGE(HID_USAGE_GEN_DESKTOP_UNDEFINED), - HID_COLLECTION(HID_COLLECTION_APPLICATION), - HID_LOGICAL_MIN8(0), - /* logical maximum 255 */ - HID_LOGICAL_MAX16(0xFF, 0x00), - HID_REPORT_ID(1), - HID_REPORT_SIZE(8), - HID_REPORT_COUNT(1), - HID_USAGE(HID_USAGE_GEN_DESKTOP_UNDEFINED), - /* HID_INPUT (Data, Variable, Absolute) */ - HID_INPUT(0x02), - HID_END_COLLECTION, - }; - - -.. doxygengroup:: usb_hid_items - -.. doxygengroup:: usb_hid_types - -HID Mouse and Keyboard report descriptors -========================================= - -The pre-defined Mouse and Keyboard report descriptors can be used by -a HID device implementation or simply as examples. - -.. doxygengroup:: usb_hid_mk_report_desc - -HID Class Device API -******************** - -USB HID devices like mouse, keyboard, or any other specific device use this API. - -.. doxygengroup:: usb_hid_device_api + udc.rst + uds.rst + uds_testing.rst + hid.rst + uds_cdc_acm.rst diff --git a/doc/reference/usb/udc.rst b/doc/reference/usb/udc.rst new file mode 100644 index 000000000000..e08ae1a4d899 --- /dev/null +++ b/doc/reference/usb/udc.rst @@ -0,0 +1,17 @@ +.. _udc_api: + +USB device controller driver API +################################ + +The USB Device Controller Driver Layer implements the low level control routines +to deal directly with the hardware. All device controller drivers should +implement the APIs described in :zephyr_file:`include/drivers/usb/usb_dc.h`. +This allows the integration of new USB device controllers to be done without +changing the upper layers. +With this API it is not possible to support more than one controller +instance at runtime. + +API reference +************* + +.. doxygengroup:: _usb_device_controller_api diff --git a/doc/reference/usb/uds.rst b/doc/reference/usb/uds.rst new file mode 100644 index 000000000000..11e8f0510321 --- /dev/null +++ b/doc/reference/usb/uds.rst @@ -0,0 +1,148 @@ +.. _usb_device_stack: + +USB device stack +################ + +The USB device stack is a hardware independent interface between USB +device controller driver and USB device class drivers or customer applications. +It is a port of the LPCUSB device stack and has been modified and expanded +over time. It provides the following functionalities: + +* Uses the APIs provided by the device controller drivers to interact with + the USB device controller. +* Responds to standard device requests and returns standard descriptors, + essentially handling 'Chapter 9' processing, specifically the standard + device requests in table 9-3 from the universal serial bus specification + revision 2.0. +* Provides a programming interface to be used by USB device classes or + customer applications. The APIs is described in + :zephyr_file:`include/usb/usb_device.h` + +The device stack has few limitations with which it is not possible to support +more than one controller instance at runtime, and only one USB device +configuration is supported. + +Supported USB classes: + +* USB Audio (experimental) +* USB CDC ACM +* USB CDC ECM +* USB CDC EEM +* RNDIS +* USB MSC +* USB DFU +* Bluetooth HCI over USB +* USB HID class + +:ref:`List` of samples for different purposes. +CDC ACM and HID samples have configuration overlays for composite configuration. + +Implementing a non-standard USB class +************************************* + +The configuration of USB Device is done in the stack layer. + +The following structures and callbacks need to be defined: + +* Part of USB Descriptor table +* USB Endpoint configuration table +* USB Device configuration structure +* Endpoint callbacks +* Optionally class, vendor and custom handlers + +For example, for the USB loopback application: + +.. literalinclude:: ../../../subsys/usb/class/loopback.c + :language: c + :start-after: usb.rst config structure start + :end-before: usb.rst config structure end + :linenos: + +Endpoint configuration: + +.. literalinclude:: ../../../subsys/usb/class/loopback.c + :language: c + :start-after: usb.rst endpoint configuration start + :end-before: usb.rst endpoint configuration end + :linenos: + +USB Device configuration structure: + +.. literalinclude:: ../../../subsys/usb/class/loopback.c + :language: c + :start-after: usb.rst device config data start + :end-before: usb.rst device config data end + :linenos: + + +The vendor device requests are forwarded by the USB stack core driver to the +class driver through the registered vendor handler. + +For the loopback class driver, :c:func:`loopback_vendor_handler` processes +the vendor requests: + +.. literalinclude:: ../../../subsys/usb/class/loopback.c + :language: c + :start-after: usb.rst vendor handler start + :end-before: usb.rst vendor handler end + :linenos: + +The class driver waits for the :makevar:`USB_DC_CONFIGURED` device status code +before transmitting any data. + +.. _testing_USB_native_posix: + +USB Vendor and Product identifiers +********************************** + +The USB Vendor ID for the Zephyr project is ``0x2FE3``. +This USB Vendor ID must not be used when a vendor +integrates Zephyr USB device support into its own product. + +Each USB sample has its own unique Product ID. +The USB maintainer, if one is assigned, or otherwise the Zephyr Technical +Steering Committee, may allocate other USB Product IDs based on well-motivated +and documented requests. + +When adding a new sample, add a new entry in :file:`samples/subsys/usb/usb_pid.Kconfig` +and a Kconfig file inside your sample subdirectory. +The following Product IDs are currently used: + +* :kconfig:`CONFIG_USB_PID_CDC_ACM_SAMPLE` +* :kconfig:`CONFIG_USB_PID_CDC_ACM_COMPOSITE_SAMPLE` +* :kconfig:`CONFIG_USB_PID_HID_CDC_SAMPLE` +* :kconfig:`CONFIG_USB_PID_CONSOLE_SAMPLE` +* :kconfig:`CONFIG_USB_PID_DFU_SAMPLE` +* :kconfig:`CONFIG_USB_PID_HID_SAMPLE` +* :kconfig:`CONFIG_USB_PID_HID_MOUSE_SAMPLE` +* :kconfig:`CONFIG_USB_PID_MASS_SAMPLE` +* :kconfig:`CONFIG_USB_PID_TESTUSB_SAMPLE` +* :kconfig:`CONFIG_USB_PID_WEBUSB_SAMPLE` +* :kconfig:`CONFIG_USB_PID_BLE_HCI_H4_SAMPLE` + +The USB device descriptor field ``bcdDevice`` (Device Release Number) represents +the Zephyr kernel major and minor versions as a binary coded decimal value. + +API reference +************* + +There are two ways to transmit data, using the 'low' level read/write API or +the 'high' level transfer API. + +Low level API + To transmit data to the host, the class driver should call usb_write(). + Upon completion the registered endpoint callback will be called. Before + sending another packet the class driver should wait for the completion of + the previous write. When data is received, the registered endpoint callback + is called. usb_read() should be used for retrieving the received data. + For CDC ACM sample driver this happens via the OUT bulk endpoint handler + (cdc_acm_bulk_out) mentioned in the endpoint array (cdc_acm_ep_data). + +High level API + The usb_transfer method can be used to transfer data to/from the host. The + transfer API will automatically split the data transmission into one or more + USB transaction(s), depending endpoint max packet size. The class driver does + not have to implement endpoint callback and should set this callback to the + generic usb_transfer_ep_callback. + +.. doxygengroup:: _usb_device_core_api diff --git a/doc/reference/usb/uds_cdc_acm.rst b/doc/reference/usb/uds_cdc_acm.rst new file mode 100644 index 000000000000..2e083575d145 --- /dev/null +++ b/doc/reference/usb/uds_cdc_acm.rst @@ -0,0 +1,105 @@ +.. _usb_device_cdc_acm: + +USB device stack CDC ACM support +################################ + +The CDC ACM class is used as backend for different subsystems in Zephyr. +However, its configuration may not be easy for the inexperienced user. +Below is a description of the different use cases and some pitfalls. + +The interface for CDC ACM user is :ref:`uart_api` driver API. +But there are two important differences in behavior to a real UART controller: + +* Data transfer is only possible after the USB device stack has been initialized and started, + until then any data is discarded +* If device is connected to the host, it still needs an application + on the host side which requests the data + +The devicetree compatible property for CDC ACM UART is +:dtcompatible:`zephyr,cdc-acm-uart`. +CDC ACM support is automatically selected when USB device support is enabled +and a compatible node in the devicetree sources is present. If necessary, +CDC ACM support can be explicitly disabled by :kconfig:`CONFIG_USB_CDC_ACM`. +About four CDC ACM UART instances can be defined and used, +limited by the maximum number of supported endpoints on the controller. + +CDC ACM UART node is supposed to be child of a USB device controller node. +Since the designation of the controller nodes varies from vendor to vendor, +and our samples and application should be as generic as possible, +the default USB device controller is usually assigned an ``zephyr_udc0`` +node label. Often, CDC ACM UART is described in a devicetree overlay file +and looks like this: + +.. code-block:: devicetree + + &zephyr_udc0 { + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + label = "CDC_ACM_0"; + }; + }; + +Samples :ref:`usb_cdc-acm` and :ref:`usb_hid-cdc` have similar overlay files. +And since no special properties are present, it may seem overkill to use +devicetree to describe CDC ACM UART. The motivation behind using devicetree +is the easy interchangeability of a real UART controller and CDC ACM UART +in applications. + +Console over CDC ACM UART +************************* + +With the CDC ACM UART node from above and ``zephyr,console`` property of the +chosen node, we can describe that CDC ACM UART is to be used with the console. +A similar overlay file is used by :ref:`cdc-acm-console`. + +.. code-block:: devicetree + + / { + chosen { + zephyr,console = &cdc_acm_uart0; + }; + }; + + &zephyr_udc0 { + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + label = "CDC_ACM_0"; + }; + }; + +Before the application uses the console, it is recommended to wait for +the DTR signal: + +.. code-block:: c + + const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); + uint32_t dtr = 0; + + if (usb_enable(NULL)) { + return; + } + + while (!dtr) { + uart_line_ctrl_get(dev, UART_LINE_CTRL_DTR, &dtr); + k_sleep(K_MSEC(100)); + } + + printk("nuqneH\n"); + +CDC ACM UART as backend +*********************** + +As for the console sample, it is possible to configure CDC ACM UART as +backend for other subsystems by setting :ref:`devicetree-chosen-nodes` +properties. + +List of few Zephyr specific chosen properties which can be used to select +CDC ACM UART as backend for a subsystem or application: + +* ``zephyr,bt-c2h-uart`` used in Bluetooth, + for example see :ref:`bluetooth-hci-uart-sample` +* ``zephyr,ot-uart`` used in OpenThread, + for example see :ref:`coprocessor-sample` +* ``zephyr,shell-uart`` used by shell for serial backend, + for example see :zephyr_file:`samples/subsys/shell/shell_module` +* ``zephyr,uart-mcumgr`` used by :ref:`smp_svr_sample` diff --git a/doc/reference/usb/uds_testing.rst b/doc/reference/usb/uds_testing.rst new file mode 100644 index 000000000000..34d80fddf475 --- /dev/null +++ b/doc/reference/usb/uds_testing.rst @@ -0,0 +1,50 @@ +.. _usb_device_testing: + +Testing USB device support +########################## + +Testing over USPIP in native_posix +*********************************** + +A virtual USB controller implemented through USBIP might be used to test the USB +Device stack. Follow the general build procedure to build the USB sample for +the native_posix configuration. + +Run built sample with: + +.. code-block:: console + + west build -t run + +In a terminal window, run the following command to list USB devices: + +.. code-block:: console + + $ usbip list -r localhost + Exportable USB devices + ====================== + - 127.0.0.1 + 1-1: unknown vendor : unknown product (2fe3:0100) + : /sys/devices/pci0000:00/0000:00:01.2/usb1/1-1 + : (Defined at Interface level) (00/00/00) + : 0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00) + +In a terminal window, run the following command to attach the USB device: + +.. code-block:: console + + $ sudo usbip attach -r localhost -b 1-1 + +The USB device should be connected to your Linux host, and verified with the following commands: + +.. code-block:: console + + $ sudo usbip port + Imported USB devices + ==================== + Port 00: at Full Speed(12Mbps) + unknown vendor : unknown product (2fe3:0100) + 7-1 -> usbip://localhost:3240/1-1 + -> remote bus/dev 001/002 + $ lsusb -d 2fe3:0100 + Bus 007 Device 004: ID 2fe3:0100 diff --git a/doc/reference/usermode/memory_domain.rst b/doc/reference/usermode/memory_domain.rst index 6bdafee7a13f..0d31909ff6ec 100644 --- a/doc/reference/usermode/memory_domain.rst +++ b/doc/reference/usermode/memory_domain.rst @@ -4,9 +4,9 @@ Memory Protection Design ######################## Zephyr's memory protection design is geared towards microcontrollers with MPU -(Memory Protection Unit) hardware. We do support some architectures which have -a paged MMU (Memory Management Unit), but in that case the MMU is used like -an MPU with an identity page table. +(Memory Protection Unit) hardware. We do support some architectures, such as x86, +which have a paged MMU (Memory Management Unit), but in that case the MMU is +used like an MPU with an identity page table. All of the discussion below will be using MPU terminology; systems with MMUs can be considered to have an MPU with an unlimited number of programmable @@ -46,7 +46,7 @@ text/ro-data, this is sufficient for the boot time configuration. Hardware Stack Overflow *********************** -``CONFIG_HW_STACK_PROTECTION`` is an optional feature which detects stack +:kconfig:`CONFIG_HW_STACK_PROTECTION` is an optional feature which detects stack buffer overflows when the system is running in supervisor mode. This catches issues when the entire stack buffer has overflowed, and not individual stack frames, use compiler-assisted :kconfig:`CONFIG_STACK_CANARIES` diff --git a/doc/releases/release-notes-2.7.rst b/doc/releases/release-notes-2.7.rst index f4636d0b9ea8..b058c0864f2f 100644 --- a/doc/releases/release-notes-2.7.rst +++ b/doc/releases/release-notes-2.7.rst @@ -2,12 +2,76 @@ .. _zephyr_2.7: -Zephyr 2.7.0 (Working draft) -############################ - -We are pleased to announce the release of Zephyr RTOS version 2.7.0. - - +Zephyr 2.7.0 +############ + +We are pleased to announce the release of Zephyr RTOS version 2.7.0 (LTS2). + +Major enhancements since v2.6.0 include: + +* Bluetooth Audio, Direction Finding, and Mesh improvements +* Support for Bluetooth Advertisement PDU Chaining +* Added support for armclang / armlinker toolchain +* Added support for MWDT C / C++ toolchain +* Update to CMSIS v5.8.0 (Core v5.5.0, DSP v1.9.0) +* Support for M-Profile Vector Extensions (MVE) on ARMv8.1-M +* Improved thread safety for Newlib and C++ on SMP-capable systems +* IEEE 802.15.4 Software Address Filtering +* New Action-based Power Management API +* USB Device Framework now includes all Chapter 9 defines and structures +* Generic System Controller (``syscon``) driver and emulator +* Linker Support for Tightly-Coupled Memory in RISC-V +* Additional Blocking API calls for LoRa +* Support for extended PCI / PCIe capabilities, improved MIS-X support +* Added Support for Service Type Enumeration (STE) with mDNS / DNS Service Discovery +* Added Zephyr Thread Awareness for OpenOCD to West +* EEPROM now can be emulated in flash +* Added both Ethernet MDIO and Ethernet generic PHY drivers + +Additional Major enhancements since v1.14.0 (LTS1) include: + +* The kernel now supports both 32- and 64-bit architectures +* We added support for SOCKS5 proxy +* Introduced support for 6LoCAN, a 6Lo adaption layer for Controller Area Networks +* We added support for Point-to-Point Protocol (PPP) +* We added support for UpdateHub, an end-to-end solution for over-the-air device updates +* We added support for ARM Cortex-R Architecture +* Normalized APIs across all architectures +* Expanded support for ARMv6-M architecture +* Added support for numerous new boards and shields +* Added numerous new drivers and sensors +* Added BLE support on Vega platform +* Memory size improvements to Bluetooth host stack +* We added initial support for 64-bit ARMv8-A architecture +* CANopen protocol support through 3rd party CANopenNode stack +* LoRa support was added along with the SX1276 LoRa modem driver +* A new Zephyr CMake package has been introduced +* A new Devicetree API which provides access to virtually all DT nodes and properties +* The kernel timeout API has been overhauled +* A new k_heap/sys_heap allocator, with improved performance +* Zephyr now integrates with the TF-M (Trusted Firmware M) PSA-compliant framework +* The Bluetooth Low Energy Host now supports LE Advertising Extensions +* The CMSIS-DSP library is now included and integrated +* Introduced initial support for virtual memory management +* Added Bluetooth host support for periodic advertisement and isochronous channels. +* Added a new TCP stack which improves network protocol testability +* Introduced a new toolchain abstraction with initial support for GCC and LLVM/Clang +* Moved to using C99 integer types and deprecate Zephyr integer types +* Introduced support for the SPARC architecture and the LEON implementation +* Added Thread Local Storage (TLS) support +* Added support for per thread runtime statistics +* Added support for building with LLVM on X86 +* Added new synchronization mechanisms using Condition Variables +* Add support for demand paging, initial support on X86 +* Logging subsystem overhauled +* Added support for 64-bit ARCv3 +* Split ARM32 and ARM64, ARM64 is now a top-level architecture +* Added initial support for Arm v8.1-m and Cortex-M55 +* Removed legacy TCP stack support which was deprecated in 2.4 +* Tracing subsystem overhaul / added support for Percepio Tracealyzer +* Device runtime power management (PM) completely overhauled +* Automatic SPDX SBOM generation has been added to West +* Added an example standalone Zephyr application The following sections provide detailed lists of changes by component. @@ -16,6 +80,12 @@ Security Vulnerability Related The following CVEs are addressed by this release: +More detailed information can be found in: +https://docs.zephyrproject.org/latest/security/vulnerabilities.html + +* CVE-2021-3510: `Zephyr project bug tracker GHSA-289f-7mw3-2qf4 + `_. + Known issues ************ @@ -135,6 +205,13 @@ Architectures * ARC + * Add SMP support to ARCv3 HS6x + * Add MWDT C library support + * Add basic C++ support with MWDT toolchain + * Add MPUv3 and MPUv6 support + * Remove dead PM code from ARC core interrupt controller driver + * Add updating arc connect debug mask dynamically + * ARM @@ -143,6 +220,7 @@ Architectures * Updated CMSIS version to 5.8.0 * Added support for FPU in QEMU for Cortex-M, allowing to build and execute tests in CI with FPU and FPU_SHARING options enabled. + * Added MPU support for Cortex-R * AARCH64 @@ -160,23 +238,64 @@ Architectures Bluetooth ********* +* Updated all APIs and internal implementation to be conformant with the new + inclusive terminology in version 5.3 of the Bluetooth Core Specification + * Audio + * Added the Microphone Input Control Service and client. + * Changed the connected isochronous API to use a group-based opaque struct + * Split the configuration options into connected and broadcast groups + * Added support for a new sent callback to be notified when an SDU has been + transmitted + +* Direction Finding + + * Added configurability for conditional CTE RX support + * Added support for CTE periodic advertising chain transmissions + * Host + * Added support for setting more than 251 bytes of advertising data + * Added new callbacks on ATT MTU update + * Added a new call to retrieve the handle of an advertising set + * Fixed key overwrite algorithm when working with multiple connections + * Added configuration support for GATT security re-establishment + * Added support for writing a long device name + * OTS: Added object name write capability + * Mesh * Added return value for opcode callback + * Added support for OOB Public Key in the provisionee role + * Added a new API to manually store pending RPL entries + * Added support for application access to mesh messages + * Refactored the Mesh Model Extensions * Bluetooth LE split software Controller + * Added support for advertising PDU chaining, implementing advertising trains + for Direction Finding + * Added support for adding or removing the ACAD field in Common Extended + Header Format to support BIGInfo + * Refactored the legacy, extended and periodic advertising time reservation + slot calculations + * Implemented CSA#2 in Extended Advertising and Broadcast ISO sub-events + * Added support for Extended Active Scanning + * Added support for advertising on the S2 and S8 coding schemes + * Added support for the Periodic Advertising channel map update indication + * HCI Driver + * Removed all ``CONFIG_BT_*_ON_DEV_NAME`` Kconfig options, use Devicetree + instead + Boards & SoC Support ******************** * Added support for these SoC series: + * Added STM32U5 basic SoC support * Removed support for these SoC series: @@ -192,13 +311,52 @@ Boards & SoC Support * Enabled Atmel SAM ``clock-frequency`` support from devicetree * Free Atmel SAM TRACESWO pin when unused * Enabled Cypress PSoC-6 Cortex-M4 support + * Added low power support to STM32L0, STM32G0 and STM32WL series + * STM32: Enabled ART Flash accelerator by default when available (F2, F4, F7, H7, L5) + * STM32: Added Kconfig option to enable STM32Cube asserts (CONFIG_USE_STM32_ASSERT) + * NXP FRDM-K82F: Added arduino_i2c and arduino_spi aliases + * NXP i.MX RT series: Added support for flash controller with XIP + * NXP i.MX RT series: Added TRNG support + * NXP i.MX RT1170: Added LPSPI driver support + * NXP i.MX RT1170: Added ADC driver support + * NXP i.MX RT1170: Enabled Segger RTT/SystemView + * NXP i.MX RT1170: Added MCUX FlexCan support + * NXP i.MX RT1064: Added watchdog driver support + * NXP i.MX RT1064: Added DMA driver support + * NXP i.MX RT600: Added arduino serial port + * NXP i.MX RT600: Add mcuboot flash partitions + * NXP i.MX RT600: Added counter support + * NXP i.MX RT600: Added PWM support + * NXP i.MX RT600: Added disk driver support + * NXP i.MX RT600: Added USB driver support + * NXP i.MX RT600: Added LPADC driver support + * NXP i.MX RT600: Added CTimer Counter support + * NXP KE1xF: Added SoC Power Management support + * NXP LPC55s69: Added USB driver support + * NXP LPC55s69: Added ctimer driver support + * NXP LPC55s69: Added I2S driver support * Changes for ARC boards: + * Implement 'run' command for SMP nSIM simulation board + * Enable upstream verification on QEMU ARCv3 HS6x board (qemu_arc_hs6x) + * Implement creg GPIO driver and add it to hsdk and em_starterkit boards + + +* Changes for ARM boards: + + * Added SPI support on Arduino standard SPI when possible * Added support for these ARM boards: + * Dragino NBSN95 NB-IoT Sensor Node + * Seeedstudio LoRa-E5 Dev Board + * ST B_U585I_IOT02A Discovery kit + * ST Nucleo F446ZE + * ST Nucleo U575ZI Q + * ST STM32H735G Discovery + * PJRC Teensy 4 Board * Added support for these ARM64 boards: @@ -229,18 +387,29 @@ Boards & SoC Support * Added support for these following shields: + * 4.2inch epaper display (GDEW042T2) + * X-NUCLEO-EEPRMA2 EEPROM memory expansion board Drivers and Sensors ******************* * ADC + * Added STM32WL ADC driver + * STM32: Added support for oversampling + * Added driver for Microchip MEC172x + +* Audio + + * Added DMIC driver for nRF PDM peripherals * Bluetooth * CAN + * Renesas R-Car driver added + * Clock Control @@ -251,35 +420,43 @@ Drivers and Sensors * Counter * Add Atmel SAM counter (TC) Driver + * Added STM32WL RTC counter driver +* Crypto + + * STM23: Add support for SOCs with AES hardware block (STM32G0, STM32L5 and STM32WL) * DAC * Added Atmel SAM DAC (DACC) driver * Added support for Microchip MCP4725 - + * Added support for STM32F3 series * Disk * Added SDMMC support on STM32L4+ + * STM32 SDMMC now supports SDIO enabled devices + * Added USDHC support for i.MX RT685 * Display * Added support for ST7735R -* Disk - - * DMA * Added Atmel SAM XDMAC reload support - * Added support on STM32G0 and STM32H7 + * Added support on STM32F3, STM32G0, STM32H7 and STM32L5 + * STM32: Reviewed bindings definitions, "st,stm32-dma-v2bis" introduced. * EEPROM * Added support for EEPROM emulated in flash. +* Entropy + + * Added support for STM32F2, STM32G0, STM32WB and STM32WL + * ESPI * Added support for Microchip eSPI SAF @@ -294,6 +471,9 @@ Drivers and Sensors * Flash + * Added STM32F2, STM32L5 and STM32WL Flash driver support + * STM32: Max erase time parameter was moved to device tree + * Added quad SPI support for STM32F4 * GPIO @@ -307,10 +487,13 @@ Drivers and Sensors * I2S * Added Atmel SAM I2S driver support to XDMAC reload - + * Added driver for nRF I2S peripherals * IEEE 802.15.4 +* IPM + + * STM32: Add HSEM based IPM driver for STM32H7 series * Interrupt Controller @@ -322,25 +505,66 @@ Drivers and Sensors * lora_send now blocks until the transmission is complete. lora_send_async can be used for the previous, non-blocking behaviour. + * Enabled support for STM32WL series + +* MEMC + + * Added STM32F4 support + * Modem * Added gsm_ppp devicetree support +* PCI/PCIe + + * Fixed an issue that MSI-X was used even though it is not available. + * Improved MBAR retrieval for MSI-X. + * Added ability to retrieve extended PCI/PCIe capabilities. * Pinmux * Added Atmel SAM0 pinctrl support + * STM32: Deprecated definitions like 'STM32F2_PINMUX_FUNC_PA0_UART4_TX' + are now removed. * PWM + * Property "st,prescaler" of binding "st,stm32-pwm" now defaults to "0". + * Added driver for ITE IT8XXX2 series + * Added driver for NXP LPC devices + * Added driver for Telink B91 * Sensor + * Refactored various drivers to use ``_dt_spec``. + * Refactored various drivers to support multiple instances. + * Enhanced TI HDC20XX driver to support DRDY/INT pin. + * Updated temperature conversion formula in TI HDC20XX driver. + * Enhanced MS5607 pressure sensor driver to support I2C. + * Fixed temperature compensation in MS5607 pressure sensor driver. + * Refactored ST LIS2DW12 driver to move range, power, and trigger + configuration from Kconfig to dts. + * Enhanced TI BQ274XX fuel gauge driver to support power management. + * Aligned ST sensor drivers to use STMEMC HAL I/F v2.00. + * Added Sensirion SGP40 multipixel gas sensor driver. + * Added Sensirion SHTCX humidity sensor driver. + * Added Sensirion SHT4X temperature and humidity sensor driver. + * Added SiLabs SI7270 hall effect magnetic position and temperature sensor + driver. + * Added ST I3G4250D gyroscope driver. + * Added TI INA219 and INA23X current/power monitor drivers. + * Added TI LM75 and LM77 temperature sensor drivers. + * Added TI HDC20XX humidity and temperature sensor driver. * Serial + * Added kconfig to disable runtime re-configuration of UART + to reduce footprint if so desired. + * Added ESP32-C3 polling only UART driver. + * Added ESP32-S2 polling only UART driver. + * Added Microchip XEC UART driver. * SPI @@ -350,11 +574,14 @@ Drivers and Sensors * USB - * Add Atmel SAM4L USBC device controller - + * Added Atmel SAM4L USBC device controller driver + * Added support for NXP LPC USB controller + * Adapted drivers use new USB framework header * Watchdog + * Added STM32L5 watchdog support + * WiFi @@ -362,63 +589,235 @@ Drivers and Sensors Networking ********** +* 802.15.4 L2: + + * Fixed a bug, where the net_pkt structure contained invalid LL address + pointers after being processed by 802.15.4 L2. + * Added an optional destination address filtering in the 802.15.4 L2. + * CoAP: + * Added ``user_data`` field to the :c:struct:`coap_packet` structure. + * Fixed processing of out-of-order notifications. + * Fixed :c:func:`coap_packet_get_payload` function. + * Converted CoAP test suite to ztest API. + * Improved :c:func:`coap_packet_get_payload` function to minimize number + of RNG calls. + * Fixed retransmissions in the ``coap_server`` sample. + * Fixed observer removal in the ``coap_server`` sample (on notification + timeout). * DHCPv4: + * Fixed a bug, where DHPCv4 library removed statically configured gateway + before obtaining a new one from the server. * DNS: + * Fixed a bug, where the same IP address was used to populate the result + address info entries, when multiple IP addresses were obtained from the + server. + +* DNS-SD: + + * Added Service Type Enumeration support (``_services._dns_sd._udp.local``) * HTTP: + * Switched the library to use ``zsock_*`` API, to improve compatibility with + various POSIX configurations. + * Fixed a bug, where ``HTTP_DATA_FINAL`` notification was triggered even for + intermediate response fragments. -* IPv4: +* IPv6: + * Multiple IPv6 fixes, addressing failures in IPv6Ready compliance tests. * LwM2M: + * Added support for notification timeout reporting to the application. + * Fixed a bug, where a multi instance resource with only one active instance + was incorrectly encoded on reads. + * Fixed a bug, where notifications were generated on changes to non-readable + resources. + * Added mutex protection for the state variable of the ``lwm2m_rd_client`` + module. + * Removed LWM2M_RES_TYPE_U64 type, as it's not possible to encode it properly + for large values. + * Fixed a bug, where large unsigned integers were incorrectly encoded in TLV. + * Multiple fixes for FLOAT type processing in the LwM2M engine and encoders. + * Fix a bug, where IPSO Push Button counter resource was not triggering + notification on incrementation. + * Fixed a bug, where Register failures were reported as success to the + application. * Misc: + * Added RX/TX timeout on a socket in ``big_http_download`` sample. + * Introduced :c:func:`net_pkt_remove_tail` function. + Added IEEE 802.15.4 security-related flags to the :c:struct:`net_pkt` + structure. + * Added bridging support to the Ethernet L2. + * Fixed a bug in mDNS, where an incorrect address type could be set as a + response destination. + * Added an option to suppress ICMP destination unreachable errors. + * Fixed possible assertion in ``net nbr`` shell command. + * Major refactoring of the TFTP library. + +* MQTT: + + * Added an option to register a custom transport type. + * Fixed a bug in :c:func:`mqtt_abort`, where the function could return without + releasing a lock. * OpenThread: + * Update OpenThread module up to commit ``9ea34d1e2053b6b2a80e1d46b65a6aee99fc504a``. + Added several new Kconfig options to align with new OpenThread + configurations. + * Added OpenThread API mutex protection during initialization. + * Converted OpenThread thread to a dedicated work queue. + * Implemented missing :c:func:`otPlatAssertFail` platform function. + * Fixed a bug, where NONE level OpenThread logs were not processed. + * Added possibility to disable CSL sampling, when used. + * Fixed a potential bug, where invalid error code could be returned by the + platform radio layer to OpenThread. + * Reworked UART configuration in the OpenThread Coprocessor sample. * Socket: + * Added microsecond accuracy in :c:func:`zsock_select` function. + * Reworked :c:func:`zsock_select` into a syscall. + * Fixed a bug, where :c:func:`poll` events were not signalled correctly + for socketpair sockets. + * Fixed a bug, where socket mutex could be used after being initialized by a + new owner after being deallocated in :c:func:`zsock_close`. + * Fixed a possible assert after enabling CAN sockets. + * Fixed IPPROTO_RAW usage in packet socket implementation. * TCP: + * Fixed a bug, where ``unacked_len`` could be set to a negative value. + * Fixed possible assertion failure in :c:func:`tcp_send_data`. + * Fixed a bug, where [FIN, PSH, ACK] was not handled properly in + TCP_FIN_WAIT_2 state. * TLS: + * Reworked TLS sockets to use secure random generator from Zephyr. + * Fixed busy looping during DTLS handshake with offloaded sockets. + * Fixed busy looping during TLS/DTLS handshake on non blocking sockets. + * Reset mbed TLS session on timed out DTLS handshake, to allow a retry without + closing a socket. + * Fixed TLS/DTLS :c:func:`sendmsg` implementation for larger payloads. + * Fixed TLS/DTLS sockets ``POLLHUP`` notification. + +* WebSocket: + + * Fixed :c:func:`poll` implementation for WebSocket, which did not work + correctly with offloaded sockets. + * Fixed :c:func:`ioctl` implementation for WebSocket, which did not work + correctly with offloaded sockets. USB *** +* Added new header file where all defines and structures from Chapter 9 + (USB Device Framework) should be included. +* Revised configuraiton of USB device support. + Removed Kconfig option ``CONFIG_USB`` and introduced Kconfig option + ``CONFIG_USB_DEVICE_DRIVER`` to enable USB device controller drivers, + which is selected when option ``CONFIG_USB_DEVICE_STACK`` is enabled. +* Enhanced verification of the control request in device stack, classes, and samples. +* Added support to store alternate interface setting. +* Added ``zephyr_udc0`` nodelabel to all boards with USB support to allow + generic USB device support samples to be build. +* Reworked descriptors, config, and data definitions macros in CDC ACM class. +* Changed CDC ACM UART implementation to get configuration from devicetree. + With this change, many ``CONFIG_*_ON_DEV_NAME`` options were removed and + applications revised. See :ref:`usb_device_cdc_acm` for more information. Build and Infrastructure ************************ +* Devicetree API + + * New "for-each" macros which work like existing APIs, but take variable + numbers of arguments: :c:macro:`DT_FOREACH_CHILD_VARGS`, + :c:macro:`DT_FOREACH_CHILD_STATUS_OKAY_VARGS`, + :c:macro:`DT_FOREACH_PROP_ELEM_VARGS`, + :c:macro:`DT_INST_FOREACH_CHILD_VARGS`, + :c:macro:`DT_INST_FOREACH_STATUS_OKAY_VARGS`, + :c:macro:`DT_INST_FOREACH_PROP_ELEM_VARGS` + + * Other new "for-each" macros: :c:macro:`DT_FOREACH_STATUS_OKAY`, + :c:macro:`DT_FOREACH_STATUS_OKAY_VARGS` + + * New macros for converting strings to C tokens: :c:macro:`DT_STRING_TOKEN`, + :c:macro:`DT_STRING_UPPER_TOKEN` + + * New :ref:`devicetree-pinctrl-api` helper macros + +* Devicetree tooling -* Devicetree + * Errors are now generated when invalid YAML files are discovered while + searching for bindings. See :ref:`dt-where-bindings-are-located` for + information on the search path. - * Various compatibles had incorrect vendor prefixes in their :ref:`compatible + * File names ending in ``.yml`` are now considered YAML files when searching + for bindings. + + * Errors are now generated if invalid node names are used. For example, the + node name ``node?`` now generates an error message ending in ``node?: Bad + character '?' in node name``. The valid node names are documented in + "2.2.2 Node Names" of the Devicetree specification v0.3. + + * Warnings are now generated if a :ref:`compatible property + ` in the ``vendor,device`` format uses an unknown + vendor prefix. This warning does not apply to the root node. + + Known vendor prefixes are defined in + :file:`dts/bindings/vendor-prefixes.txt` files, which may appear in any + directory in :ref:`DTS_ROOT `. + + These may be upgraded to errors using the edtlib Python APIs; Zephyr's CI + now generates such errors. + +* Devicetree bindings + + * Various bindings had incorrect vendor prefixes in their :ref:`compatible ` properties; the following changes were made to fix these. - * ``nios,i2c`` is now ``altr,nios2-i2c`` - * ``colorway,lpd8803`` is now ``greeled,lpd8803`` - * ``colorway,lpd8806`` is now ``greeled,lpd8806`` - * ``grove,light`` is now ``seeed,grove-light`` - * ``grove,temperature`` is now ``seeed,grove-temperature`` - * ``max,max30101`` is now ``maxim,max30101`` - * ``ublox,sara-r4`` is now ``u-blox,sara-r4`` - * ``xtensa,core-intc`` is now ``cdns,xtensa-core-intc`` - - Out of tree users of these compatibles will need to update their + .. list-table:: + :header-rows: 1 + + - * Old compatible + * New compatible + - * ``nios,i2c`` + * :dtcompatible:`altr,nios2-i2c` + - * ``cadence,tensilica-xtensa-lx4`` + * :dtcompatible:`cdns,tensilica-xtensa-lx4` + - * ``cadence,tensilica-xtensa-lx6`` + * :dtcompatible:`cdns,tensilica-xtensa-lx6` + - * ``colorway,lpd8803`` + * :dtcompatible:`greeled,lpd8803` + - * ``colorway,lpd8806`` + * :dtcompatible:`greeled,lpd8806` + - * ``grove,light`` + * :dtcompatible:`seeed,grove-light` + - * ``grove,temperature`` + * :dtcompatible:`seeed,grove-temperature` + - * ``max,max30101`` + * :dtcompatible:`maxim,max30101` + - * ``ublox,sara-r4`` + * :dtcompatible:`u-blox,sara-r4` + - * ``xtensa,core-intc`` + * :dtcompatible:`cdns,xtensa-core-intc` + - * ``vexriscv,intc0`` + * :dtcompatible:`vexriscv-intc0` + + Out of tree users of these bindings will need to update their devicetrees. You can support multiple versions of Zephyr with one devicetree by @@ -430,6 +829,60 @@ Build and Infrastructure ... }; + * Other new bindings in alphabetical order: :dtcompatible:`andestech,atcgpio100`, + :dtcompatible:`arm,gic-v3-its`, :dtcompatible:`atmel,sam0-gmac`, + :dtcompatible:`atmel,sam0-pinctrl`, :dtcompatible:`atmel,sam-dac`, + :dtcompatible:`atmel,sam-mdio`, :dtcompatible:`atmel,sam-usbc`, + :dtcompatible:`cdns,tensilica-xtensa-lx7`, + :dtcompatible:`espressif,esp32c3-uart`, + :dtcompatible:`espressif,esp32-intc`, + :dtcompatible:`espressif,esp32s2-uart`, :dtcompatible:`ethernet-phy`, + :dtcompatible:`fcs,fxl6408`, :dtcompatible:`ilitek,ili9341`, + :dtcompatible:`ite,it8xxx2-bbram`, :dtcompatible:`ite,it8xxx2-kscan`, + :dtcompatible:`ite,it8xxx2-pinctrl-conf`, :dtcompatible:`ite,it8xxx2-pwm`, + :dtcompatible:`ite,it8xxx2-pwmprs`, :dtcompatible:`ite,it8xxx2-watchdog`, + :dtcompatible:`lm75`, :dtcompatible:`lm77`, :dtcompatible:`meas,ms5607`, + :dtcompatible:`microchip,ksz8863`, :dtcompatible:`microchip,mcp7940n`, + :dtcompatible:`microchip,xec-adc-v2`, :dtcompatible:`microchip,xec-ecia`, + :dtcompatible:`microchip,xec-ecia-girq`, + :dtcompatible:`microchip,xec-gpio-v2`, + :dtcompatible:`microchip,xec-i2c-v2`, :dtcompatible:`microchip,xec-pcr`, + :dtcompatible:`microchip,xec-uart`, :dtcompatible:`nuvoton,npcx-bbram`, + :dtcompatible:`nuvoton,npcx-booter-variant`, + :dtcompatible:`nuvoton,npcx-ps2-channel`, + :dtcompatible:`nuvoton,npcx-ps2-ctrl`, :dtcompatible:`nuvoton,npcx-soc-id`, + :dtcompatible:`nxp,imx-ccm-rev2`, :dtcompatible:`nxp,lpc-ctimer`, + :dtcompatible:`nxp,lpc-uid`, :dtcompatible:`nxp,mcux-usbd`, + :dtcompatible:`nxp,sctimer-pwm`, :dtcompatible:`ovti,ov2640`, + :dtcompatible:`renesas,rcar-can`, :dtcompatible:`renesas,rcar-i2c`, + :dtcompatible:`reserved-memory`, :dtcompatible:`riscv,sifive-e24`, + :dtcompatible:`sensirion,sgp40`, :dtcompatible:`sensirion,sht4x`, + :dtcompatible:`sensirion,shtcx`, :dtcompatible:`silabs,si7055`, + :dtcompatible:`silabs,si7210`, :dtcompatible:`snps,creg-gpio`, + :dtcompatible:`st,i3g4250d`, :dtcompatible:`st,stm32-aes`, + :dtcompatible:`st,stm32-dma`, :dtcompatible:`st,stm32-dma-v2bis`, + :dtcompatible:`st,stm32-hsem-mailbox`, :dtcompatible:`st,stm32-nv-flash`, + :dtcompatible:`st,stm32-spi-subghz`, + :dtcompatible:`st,stm32u5-flash-controller`, + :dtcompatible:`st,stm32u5-msi-clock`, :dtcompatible:`st,stm32u5-pll-clock`, + :dtcompatible:`st,stm32u5-rcc`, :dtcompatible:`st,stm32wl-hse-clock`, + :dtcompatible:`st,stm32wl-subghz-radio`, :dtcompatible:`st,stmpe1600`, + :dtcompatible:`syscon`, :dtcompatible:`telink,b91`, + :dtcompatible:`telink,b91-flash-controller`, + :dtcompatible:`telink,b91-gpio`, :dtcompatible:`telink,b91-i2c`, + :dtcompatible:`telink,b91-pinmux`, :dtcompatible:`telink,b91-power`, + :dtcompatible:`telink,b91-pwm`, :dtcompatible:`telink,b91-spi`, + :dtcompatible:`telink,b91-trng`, :dtcompatible:`telink,b91-uart`, + :dtcompatible:`telink,b91-zb`, :dtcompatible:`ti,hdc2010`, + :dtcompatible:`ti,hdc2021`, :dtcompatible:`ti,hdc2022`, + :dtcompatible:`ti,hdc2080`, :dtcompatible:`ti,hdc20xx`, + :dtcompatible:`ti,ina219`, :dtcompatible:`ti,ina23x`, + :dtcompatible:`ti,tca9538`, :dtcompatible:`ti,tca9546a`, + :dtcompatible:`ti,tlc59108`, + :dtcompatible:`xlnx,gem`, :dtcompatible:`zephyr,bbram-emul`, + :dtcompatible:`zephyr,cdc-acm-uart`, :dtcompatible:`zephyr,gsm-ppp`, + :dtcompatible:`zephyr,native-posix-udc` + * West (extensions) * openocd runner: Zephyr thread awareness is now available in GDB by default @@ -474,8 +927,38 @@ Libraries / Subsystems together have allowed simplifying multiple device power management callback implementations. + * Introduced a new API to allow devices capable of wake up the system + register themselves was wake up sources. This permits applications to + select the most appropriate way to wake up the system when it is + suspended. Devices marked as wake up source are not suspended by the kernel + when the system is idle. It is possible to declare a device wake up capable + direct in devicetree like this example:: + + &gpio0 { + compatible = "zephyr,gpio-emul"; + gpio-controller; + wakeup-source; + }; + + * Removed ``PM_DEVICE_STATE_FORCE_SUSPEND`` device power state.because it + is an action and not a state. + + * Removed ``PM_DEVICE_STATE_RESUMING`` and ``PM_DEVICE_STATE_SUSPENDING``. + They were transitional states and only used in device runtime. Now the + subsystem is using device flag to keep track of a transition. + + * Implement constraint API as weak symbols so applications or platform + can override them. Platforms can have their own way to + set/release constraints in their drivers that are not part of + Zephyr code base. + + * Logging +* MODBUS + + * Changed server handler to copy Transaction and Protocol Identifiers + to response header. * Random @@ -528,3 +1011,969 @@ Issue Related Items These GitHub issues were addressed since the previous 2.6.0 tagged release: + +* :github:`39443` - Be more inclusive +* :github:`39419` - STM32WL55 not found st/wl/stm32wl55jcix-pinctrl.dtsi +* :github:`39413` - warnings when using newlibc and threads +* :github:`39409` - runners: canopen: program download fails with slow flash access and/or congested CAN nets +* :github:`39389` - http_get, big_http_download samples fails to build +* :github:`39388` - GSM Modem sample fails to build +* :github:`39378` - Garbage IQ Data Reports are generated if some check in hci_df_prepare_connectionless_iq_report fails +* :github:`39294` - noticing stm32 clock domain naming changes +* :github:`39291` - Bluetooth: Periodic advertising +* :github:`39284` - mdns + dns_sd: fix regression that breaks ptr queries +* :github:`39281` - Undefined references to k_thread_abort related tracing routines +* :github:`39270` - example-application CI build fails +* :github:`39263` - Bluetooth: controller: DF: wrong handling of max_cte_count +* :github:`39260` - [backport v2.7-branch] backport of #38292 failed +* :github:`39240` - ARC Kconfig allows so select IRQ configuration which isn't supported in SW +* :github:`39206` - lwm2m: send_attempts field does not seem to be used? +* :github:`39205` - drivers: wifi: esp_at: cannot connect to open (unsecure) WiFi networks +* :github:`39195` - USB: netusb: example echo_server not working as expected +* :github:`39190` - tests/subsys/logging/log_core_additional/logging.add.log2 fails +* :github:`39188` - tests/bluetooth/mesh/bluetooth.mesh.ext_adv fails +* :github:`39185` - tests/subsys/logging/log_core_additional/logging.add.user fails on several platforms +* :github:`39180` - samples/subsys/mgmt/osdp/peripheral_device & samples/subsys/mgmt/osdp/control_panel fail to build +* :github:`39170` - Can not run correctly on NXP MIMXRT1061 CVL5A. +* :github:`39135` - samples/compression/lz4 build failed (lz4.h: No such file or directory) +* :github:`39132` - subsys/net/ip/tcp2: Missing feature to decrease Receive Window size sent in the ACK messge +* :github:`39123` - ztest: Broken on NRF52840 Platform +* :github:`39115` - sensor: fdc2x1x: warnings and compilation errors when PM_DEVICE is used +* :github:`39086` - CMake warning during build - depracated roule CMP0079 +* :github:`39085` - Ordering of device_map() breaks PCIe config space mapping on ARM64 +* :github:`39075` - IPv6 address not set on loopback interface +* :github:`39051` - Zephyr was unable to find the toolchain. Is the environment misconfigured? +* :github:`39036` - Multicast packet forwarding not working for the coap_server sample and Openthread +* :github:`39022` - [backport v2.7-branch] backport of #38834 failed +* :github:`39011` - Bluetooth: Mesh: Model extensions walk stops before last model +* :github:`39009` - Nordic PWM causing lock up due to infinte loop +* :github:`39008` - tests: logging.add.user: build failure on STM32H7 targets +* :github:`38999` - [backport v2.7-branch] backport of #38407 failed +* :github:`38996` - There is no way to leave a ipv6 multicast group +* :github:`38994` - ARP: Replies are sent to multicast MAC address rather than senders MAC address. +* :github:`38970` - LWM2M Client Sample with DTLS enabled fail to connect +* :github:`38966` - Please add STM32F412VX +* :github:`38961` - tests: kernel: sched: schedule_api: instable on disco_l475_iot1 +* :github:`38959` - ITE RISCV I2C driver returning positive values for error instead of negative values +* :github:`38943` - west: update hal_espressif failure +* :github:`38938` - Bluetooth tester application should be able return L2CAP ECFC credits on demand +* :github:`38930` - Low Power mode not functional on nucleo_l073rz +* :github:`38924` - twister: cmake: Misleading error in Twister when sdk-zephyr 0.13.1 not used +* :github:`38904` - [backport v2.7-branch] backport of #38860 failed +* :github:`38902` - i2c_nrfx_twim: Error 0x0BAE0002 if sensor is set in trigger mode and reset with nrf device +* :github:`38899` - There is no valid date setting function in the RTC driver of the LL Library of STM32 +* :github:`38893` - g0b1re + spi_flash_at45 + flash_shell: First write always fails with ``CONFIG_PM_DEVICE`` +* :github:`38886` - devicetree/memory.h probably should not exist as-is +* :github:`38877` - Running the zephyr elf natively on an arm a53 machine (ThunderX2) with KVM emulation +* :github:`38870` - stm32f1: Button callback not fired +* :github:`38853` - Bluetooth: host: bt_unpair failed because function [bt_conn_set_state] wont work as expected +* :github:`38849` - drivers: i2c: nrf: i2c error with burst write +* :github:`38829` - net_buf issue leads to unwanted elem free +* :github:`38826` - tests/lib/cmsis_dsp: malloc failed on 128K SRAM targets +* :github:`38818` - driver display display_st7789v.c build error +* :github:`38815` - kernel/mem_domain: Remove dead case in check_add_partition() +* :github:`38807` - stm32: Missing header in power.c files +* :github:`38804` - tests\kernel\threads\thread_stack test fail with ARC +* :github:`38799` - BLE central_ht only receives 7 notifications +* :github:`38796` - Failure building the zephyr\tests\subsys\cpp\libcxx project +* :github:`38791` - Example code_relocation not compiling. +* :github:`38790` - SD FatFS Sample Build Failure +* :github:`38784` - stm32: pm: Debug mode not functional on G0 +* :github:`38782` - CONFIG_BT_CTLR_DATA_LENGTH_MAX=250 causes pairing compatibility issues with many devices +* :github:`38769` - mqtt: the size of a mqtt payload is limited +* :github:`38765` - samples: create an OLED example +* :github:`38764` - CBPRINTF_FP_SUPPORT does not work after NEWLIB_LIBC enabled +* :github:`38761` - Does zephyr_library_property defines -DTRUE in command-line? +* :github:`38756` - Twister: missing testcases with error in report +* :github:`38745` - Bluetooth when configured for extended advertising does not limit advertisement packet size if a non-extended avertisement is used +* :github:`38737` - drivers: syscon: missing implementation +* :github:`38735` - nucleo_wb55rg: Flash space left to M0 binary is not sufficient anymore +* :github:`38731` - test-ci: ptp_clock_test : test failure on frdm_k64f platform +* :github:`38727` - [RFC] Add hal_gigadevice to support GigaDevice SoC Vendor +* :github:`38716` - modem: HL7800: does not work with IPv6 +* :github:`38702` - Coap server not properly removing observers +* :github:`38701` - Observable resource of coap server seems to not support a restart of an observer +* :github:`38700` - Observable resource of coap server seems to not support 2 observers simultaneously +* :github:`38698` - stm32f4_disco: Socket CAN sample not working +* :github:`38697` - The coap_server sample is missing the actual send in the retransmit routine +* :github:`38694` - Disabling NET_CONFIG_AUTO_INIT does not require calling net_config_init() manually in application as mentioned in Zephyr Network Configuration Library documentation +* :github:`38692` - samples/tfm_integration: Compilation fails ("unexpected keyword argument 'rom_fixed'") +* :github:`38691` - MPU fault with mcumgr bluetooth FOTA started whilst existing FOTA is in progress +* :github:`38690` - Wrong initialisation priority on different display drivers (eg. ST7735r) cause exception when using lvgl. +* :github:`38688` - bt_gatt_unsubscribe does not remove subscription from internal list/returning BT_GATT_ITER_STOP causes bt_gatt_subscribe to return -ENOMEM / -12 +* :github:`38675` - DTS binding create devicetree_unfixed.h build error at v2.7.0 +* :github:`38673` - DNS-SD library does not support ``_services._dns-sd._udp.local`` meta-query for service enumeration +* :github:`38668` - ESP32‘s I2S +* :github:`38667` - ST LSM6DSO polling mode does not work on nRF52dk_nrf52832 +* :github:`38655` - Failing Tests for Regulator API +* :github:`38653` - drivers: modem: gsm_ppp: Add support for Quectel modems +* :github:`38646` - SIMD Rounding bug while running Assembly addps instruction on Zephyr +* :github:`38641` - Arm v8-M '_ns' renaming was applied inconsistently +* :github:`38635` - USDHC driver broken on RT10XX after 387e6a676f86c00d1f9ef018e4b2480e0bcad3c8 commit +* :github:`38622` - subsys/usb: CONFIG_USB_DEVICE_STACK resulted in 10kb increase in firmware size +* :github:`38621` - Drivers: spi: stm32: Transceive lock forever +* :github:`38620` - STM32 uart driver prevent system to go to deep sleep +* :github:`38617` - HL7800 PSM not working as intended +* :github:`38613` - BLE connection parameters updated with inconsistent values +* :github:`38612` - Fault with assertions enabled prevents detailed output because of ISR() assertion check in shell function +* :github:`38602` - modem gsm +* :github:`38601` - nucleo_f103rb: samples/posix/eventfd/ failed since "retargetable locking" addition +* :github:`38593` - using RTT console to print along with newlib C library in Zephyr +* :github:`38591` - nucleo_f091rc: Linking issue since "align __data_ram/rom_start/end linker" (65a2de84a9d5c535167951bf1cf610c4f7967ea5) +* :github:`38586` - olimexino_stm32: "no DEVICE_HANDLE_ENDS inserted" builld issue (samples/subsys/usb/audio/headphones_microphone) +* :github:`38581` - tests-ci : kernel: scheduler: multiq test failed +* :github:`38582` - tests-ci : kernel: scheduler: test failed +* :github:`38578` - STM32L0X ADC hangs +* :github:`38572` - Builds with macOS SDK are failing +* :github:`38571` - bug: drivers: ethernet: build as static library breaks frdm_k64f gptp sample application +* :github:`38563` - ISO broadcast cannot send with callback if CONFIG_BT_CONN=n +* :github:`38560` - log v2 with 64-bit integers and threads causes invalid 64-bit value output +* :github:`38559` - Shell log backend may hang on qemu_x86_64 +* :github:`38558` - CMake warning: CMP0079 +* :github:`38554` - tests-ci : kernel: scheduler: test failed +* :github:`38552` - stm32: g0b1: garbage output in log and suspected hard fault when configuring modem +* :github:`38536` - samples: tests: display: Sample for display.ft800 causes end in timeout +* :github:`38535` - drivers: modem: bg9x: Kconfig values compiled into ``autoconf.h`` even if it isn't being used +* :github:`38534` - lwm2m: add api to inspect observation state of resource/object +* :github:`38532` - samples: audio: tests: Twister fails on samples/drivers/audio/dmic +* :github:`38527` - lwm2m: re-register instead of removing observer on COAP reset answer to notification +* :github:`38520` - Bluetooth:Host:Scan: "bt_le_per_adv_list_add" function doesn't work +* :github:`38519` - stm32: g0b1re: Log/Shell subsys with serial uart buggy after #38432 +* :github:`38516` - subsys: net: ip: packet_socket: always returning of NET_CONTINUE caused access to unreferred pkt and causing a crash/segmentation fault +* :github:`38514` - mqtt azure sample failing with net_tcp "is waiting on connect semaphore" +* :github:`38512` - stm32f7: CAN: STM32F645VE CAN signal seems upside down. +* :github:`38500` - tests/kernel/device/kernel.device.pm fails to build on TI platforms +* :github:`38498` - net: ipv6: nbr_lock not initialized with CONFIG_NET_IPV6_ND=n +* :github:`38480` - Improve samples documentation +* :github:`38479` - "west flash" command exiting with error +* :github:`38477` - json: JSON Library Orphaned, Request to Become a Maintainer +* :github:`38474` - command exited with status 63: nrfjprog --ids +* :github:`38463` - check_compliance gives very many Kconfig warnings +* :github:`38452` - Some STM32 series require CONFIG_PM_DEVICE if CONFIG_PM=y +* :github:`38442` - test-ci: can: twr_ke18f: all can driver test fails with BUS Fault +* :github:`38438` - test-ci: test_flash_map:twr_ke18f: test failure +* :github:`38437` - stm32: g0b1re: Serial UART timing issue after MCU entered deep sleep +* :github:`38433` - gpio_pin_set not working on STM32 with CONFIG_PM_DEVICE_RUNTIME +* :github:`38428` - http_client response callback always reports final_data == HTTP_DATA_FINAL +* :github:`38427` - mimxrt1050_evk and mimxrt1020_evk boards fail to boot some sample applications +* :github:`38421` - HardFault regression detected on Cortex-M0+ following Cortex-R introduction +* :github:`38418` - twister: Remove toolchain-depandat filter for native_posix +* :github:`38417` - Add support for WeAct-F401CC board +* :github:`38414` - Build of http client fails if CONFIG_POSIX_API=y +* :github:`38405` - samples/philosophers/sample.kernel.philosopher.stacks fails on xtensa +* :github:`38403` - Cleanup ``No SOURCES given to Zephyr library`` warnings +* :github:`38402` - module: MCUboot module missing fixes available upstream +* :github:`38401` - Builds fail due to a proxy error by launchpadlibrarian +* :github:`38400` - mec15xxevb_assy6853: arm_ramfunc and arm_sw_vector_relay tests timeout after the build +* :github:`38398` - DT_N_INST error for TMP116 sample +* :github:`38396` - RISC-V privilege SoC initialisation code skips the __reset vector +* :github:`38382` - stm32 uart finishes Tx before going to PM +* :github:`38365` - drivers: gsm_ppp: gsm_ppp_stop fails to lock tx_sem after some time +* :github:`38362` - soc: ti cc13x2-cc26x2: PM standby + radio interaction regression +* :github:`38354` - stm32: stm32f10x JTAG realated gpio repmap didn't works +* :github:`38351` - Custom radio protocol +* :github:`38349` - XCC compilation fails on Intel cAVS platforms +* :github:`38348` - Bluetooth: Switch to inclusive terminology from the 5.3 specification +* :github:`38340` - Bluetooth:DirectionFinding: Disabling the MPU causes some compilation errors +* :github:`38332` - stm32g0: power hooks should be define as weak +* :github:`38323` - Can not generate code coverage report by running samples/subsys/tracing +* :github:`38316` - Synchronize multiple DF TX devices in the DF Connectionless RX Example "Periodic Advertising list" +* :github:`38309` - ARC context switch to interrupted thread busted with CONFIG_ARC_FIRQ=y and CONFIG_NUM_IRQ_PRIO_LEVELS=1 +* :github:`38303` - The current BabbleSim tests build system based on bash scripts hides warnings +* :github:`38290` - net_buf_add_mem() hard-faults when adding buffer from external SDRAM +* :github:`38279` - Bluetooth: Controller: assert LL_ASSERT(!radio_is_ready()) in lll_conn.c +* :github:`38277` - soc: stm32h7: Fails to boot with LDO power supply, if soc has SMPS support. +* :github:`38276` - LwM2M: RD Client: Wrong state if registration fails +* :github:`38273` - Support UART4 on STM32F303Xe +* :github:`38272` - "west flash" stopped working +* :github:`38271` - Expose emulator_get_binding function +* :github:`38264` - Modbus over RS485 on samd21g18a re-gpios turning on 1 byte too early +* :github:`38259` - subsys/shell: ``[JJ`` escape codes in logs after disabling colors +* :github:`38258` - newlib: first malloc call may fail on Xtensa depending on image size +* :github:`38246` - samples: drivers: flash_shell: fails on arduino_due due to compilation issue +* :github:`38245` - board: bl654_usb project: samples/basic/blinky does not blink LED +* :github:`38240` - Connected ISO does not disconnect gracefully +* :github:`38237` - [backport v2.6-branch] backport of #37479 failed +* :github:`38235` - Please add stm32h723Xe.dtsi to dts/arm/st/h7/ +* :github:`38234` - Newlib retargetable lock init fails on qemu_xtensa +* :github:`38233` - Build newlib function read() and write() failed when enable userspace +* :github:`38219` - kernel: Z_MEM_SLAB_INITIALIZER MACRO not compatible with C++ +* :github:`38216` - nxp_adsp_imx8 fails to build a number of tests +* :github:`38214` - xtensa builds fail in CI due to running out of ram to link +* :github:`38207` - Use of unaligned noinit data hangs qemu_arc_hs +* :github:`38202` - mbedtls and littlefs on a STM32L4 +* :github:`38197` - Invalid NULL check for ``iso`` in bt_iso_connected +* :github:`38196` - net nbr command might crash +* :github:`38191` - Unable to connect multiple MQTT clients +* :github:`38186` - i.MX RT10xx boards fail to initialize when Ethernet is enabled +* :github:`38181` - tests/drivers/uart/uart_basic_api/drivers.uart.cdc_acm fails to build +* :github:`38177` - LORA Module crashes SHT3XD sensor. +* :github:`38173` - STM32WB: Low power modes entry blocked by C2 when CONFIG_BLE=n +* :github:`38172` - modem_context_sprint_ip_addr returns pointer to stack array +* :github:`38170` - Shell argument in second position containing a question mark is ignored +* :github:`38168` - aarch32: flags value collision between base IRQ layer and GIC interrupt controller driver +* :github:`38162` - Upgrade to 2.6 GPIO device_get_binding("GPIO_0") now returns null +* :github:`38154` - Error building example i2c_fujitsu_fram +* :github:`38153` - Zephyr Native POSIX select() implementation too frequent wakeup on pure timeout based use +* :github:`38145` - [backport v2.6-branch] backport of #37787 failed +* :github:`38144` - [backport v2.6-branch] backport of #37787 failed +* :github:`38141` - Wrong output from printk() with CONFIG_CBPRINTF_NANO=y +* :github:`38138` - [Coverity CID: 239554] Out-of-bounds read in /zephyr/include/generated/syscalls/log_msg2.h (Generated Code) +* :github:`38137` - [Coverity CID: 239555] Unchecked return value in subsys/mgmt/hawkbit/hawkbit.c +* :github:`38136` - [Coverity CID: 239557] Out-of-bounds read in /zephyr/include/generated/syscalls/kernel.h (Generated Code) +* :github:`38135` - [Coverity CID: 239560] Out-of-bounds access in subsys/modbus/modbus_core.c +* :github:`38134` - [Coverity CID: 239563] Logically dead code in subsys/bluetooth/host/id.c +* :github:`38133` - [Coverity CID: 239564] Side effect in assertion in subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +* :github:`38132` - [Coverity CID: 239565] Unchecked return value in drivers/sensor/adxl372/adxl372_trigger.c +* :github:`38131` - [Coverity CID: 239568] Out-of-bounds access in subsys/modbus/modbus_core.c +* :github:`38130` - [Coverity CID: 239569] Out-of-bounds access in subsys/bluetooth/host/id.c +* :github:`38129` - [Coverity CID: 239572] Out-of-bounds read in /zephyr/include/generated/syscalls/kernel.h (Generated Code) +* :github:`38127` - [Coverity CID: 239579] Logically dead code in drivers/flash/nrf_qspi_nor.c +* :github:`38126` - [Coverity CID: 239581] Out-of-bounds access in subsys/modbus/modbus_core.c +* :github:`38125` - [Coverity CID: 239582] Unchecked return value in drivers/display/ssd1306.c +* :github:`38124` - [Coverity CID: 239583] Side effect in assertion in subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +* :github:`38123` - [Coverity CID: 239584] Improper use of negative value in subsys/logging/log_msg2.c +* :github:`38122` - [Coverity CID: 239585] Side effect in assertion in subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +* :github:`38121` - [Coverity CID: 239586] Side effect in assertion in subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +* :github:`38120` - [Coverity CID: 239588] Unchecked return value in subsys/bluetooth/host/id.c +* :github:`38119` - [Coverity CID: 239592] Dereference before null check in subsys/ipc/rpmsg_multi_instance/rpmsg_multi_instance.c +* :github:`38118` - [Coverity CID: 239597] Explicit null dereferenced in tests/net/context/src/main.c +* :github:`38117` - [Coverity CID: 239598] Unchecked return value in drivers/sensor/adxl362/adxl362_trigger.c +* :github:`38116` - [Coverity CID: 239601] Untrusted loop bound in subsys/bluetooth/host/sdp.c +* :github:`38115` - [Coverity CID: 239605] Logically dead code in drivers/flash/nrf_qspi_nor.c +* :github:`38114` - [Coverity CID: 239607] Missing break in switch in subsys/usb/class/dfu/usb_dfu.c +* :github:`38113` - [Coverity CID: 239609] Out-of-bounds access in subsys/random/rand32_ctr_drbg.c +* :github:`38112` - [Coverity CID: 239612] Out-of-bounds read in /zephyr/include/generated/syscalls/log_ctrl.h (Generated Code) +* :github:`38111` - [Coverity CID: 239615] Out-of-bounds access in subsys/net/lib/sockets/sockets_tls.c +* :github:`38110` - [Coverity CID: 239619] Out-of-bounds access in subsys/net/lib/sockets/sockets_tls.c +* :github:`38109` - [Coverity CID: 239623] Out-of-bounds access in subsys/net/lib/sockets/sockets_tls.c +* :github:`38108` - nxp: usb driver build failure due to d92d1f162af3ba24963f1026fc0a304f1a44d1f3 +* :github:`38104` - kheap buffer own section attribute causing memory overflow in ESP32 +* :github:`38101` - bt_le_adv_update_data() assertion fail +* :github:`38093` - preempt_cnt not reset in each test case in tests/lib/ringbuffer/libraries.data_structures +* :github:`38090` - LPS22HH: int32_t overflow in pressure calculations +* :github:`38082` - Hawkbit (http request) and MQTT can't seem to work together +* :github:`38078` - RT6XX I2S test fails after d92d1f162af3ba24963f1026fc0a304f1a44d1f3 +* :github:`38069` - stm32h747i_disco M4 not working following merge of 9fa5437447712eece9c88e728ac05ac10fb01c4a +* :github:`38065` - Bluetooth: Direction Finding: Compiler warning when included in other header files +* :github:`38059` - automount configuration in nrf52840dk_nrf52840.overlay causes error: mount point already exists!! in subsys/fs/littlefs sample +* :github:`38054` - Bluetooth: host: Local Host terminated but send host number of completed Packed +* :github:`38047` - twister: The --board-root parameter doesn't appear to work +* :github:`38046` - twister: The --device-serial only works at 115200 baud +* :github:`38044` - tests: newlib: Scenarios from tests/lib/newlib/thread_safety fail on nrf9160dk_nrf9160_ns +* :github:`38031` - STM32WB - Problem with data reception on LPUART when PM and LPTIM are enabled +* :github:`38026` - boards: bl654_usb: does not support samples/bluetooth/hci_uart +* :github:`38022` - thread: k_float_enable() API can't build on x86_64 platforms, fix that API and macro documentation +* :github:`38019` - nsim_sem_mpu_stack_guard board can't run +* :github:`38017` - [Coverity CID: 237063] Untrusted value as argument in tests/net/lib/coap/src/main.c +* :github:`38016` - [Coverity CID: 238375] Uninitialized pointer read in subsys/bluetooth/mesh/shell.c +* :github:`38015` - [Coverity CID: 237072] Uninitialized pointer read in subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +* :github:`38014` - [Coverity CID: 237071] Unexpected control flow in subsys/bluetooth/host/keys.c +* :github:`38013` - [Coverity CID: 237070] Unchecked return value in subsys/bluetooth/shell/gatt.c +* :github:`38012` - [Coverity CID: 236654] Unchecked return value in subsys/bluetooth/host/gatt.c +* :github:`38011` - [Coverity CID: 236653] Unchecked return value in drivers/sensor/bmi160/bmi160_trigger.c +* :github:`38010` - [Coverity CID: 236652] Unchecked return value in drivers/sensor/fxas21002/fxas21002_trigger.c +* :github:`38009` - [Coverity CID: 236651] Unchecked return value in drivers/sensor/bmg160/bmg160_trigger.c +* :github:`38008` - [Coverity CID: 236650] Unchecked return value in drivers/sensor/fxos8700/fxos8700_trigger.c +* :github:`38007` - [Coverity CID: 236649] Unchecked return value in drivers/sensor/adt7420/adt7420_trigger.c +* :github:`38006` - [Coverity CID: 236648] Unchecked return value in drivers/sensor/sx9500/sx9500_trigger.c +* :github:`38005` - [Coverity CID: 236647] Unchecked return value in drivers/sensor/bmp388/bmp388_trigger.c +* :github:`38004` - [Coverity CID: 238360] Result is not floating-point in drivers/sensor/sgp40/sgp40.c +* :github:`38003` - [Coverity CID: 238343] Result is not floating-point in drivers/sensor/sgp40/sgp40.c +* :github:`38002` - [Coverity CID: 237060] Out-of-bounds access in subsys/bluetooth/host/gatt.c +* :github:`38001` - [Coverity CID: 238371] Negative array index read in tests/lib/cbprintf_package/src/test.inc +* :github:`38000` - [Coverity CID: 238347] Negative array index read in tests/lib/cbprintf_package/src/test.inc +* :github:`37999` - [Coverity CID: 238383] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37998` - [Coverity CID: 238381] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37997` - [Coverity CID: 238380] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37996` - [Coverity CID: 238379] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37995` - [Coverity CID: 238378] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37994` - [Coverity CID: 238377] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37993` - [Coverity CID: 238376] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37992` - [Coverity CID: 238374] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37991` - [Coverity CID: 238373] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37990` - [Coverity CID: 238372] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37989` - [Coverity CID: 238370] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37988` - [Coverity CID: 238369] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37987` - [Coverity CID: 238368] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37986` - [Coverity CID: 238367] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37985` - [Coverity CID: 238366] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37984` - [Coverity CID: 238364] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37983` - [Coverity CID: 238363] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37982` - [Coverity CID: 238362] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37981` - [Coverity CID: 238361] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37980` - [Coverity CID: 238359] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37979` - [Coverity CID: 238358] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37978` - [Coverity CID: 238357] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37977` - [Coverity CID: 238356] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37976` - [Coverity CID: 238355] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37975` - [Coverity CID: 238354] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37974` - [Coverity CID: 238353] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37973` - [Coverity CID: 238352] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37972` - [Coverity CID: 238351] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37971` - [Coverity CID: 238350] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37970` - [Coverity CID: 238349] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37969` - [Coverity CID: 238348] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37968` - [Coverity CID: 238346] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37967` - [Coverity CID: 238345] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37966` - [Coverity CID: 238344] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37965` - [Coverity CID: 238342] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37964` - [Coverity CID: 238341] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37963` - [Coverity CID: 238340] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37962` - [Coverity CID: 238339] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37961` - [Coverity CID: 238337] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37960` - [Coverity CID: 238336] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37959` - [Coverity CID: 238335] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37958` - [Coverity CID: 238334] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37957` - [Coverity CID: 238333] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37956` - [Coverity CID: 238332] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37955` - [Coverity CID: 238331] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37954` - [Coverity CID: 238330] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37953` - [Coverity CID: 238328] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37952` - [Coverity CID: 238327] Logically dead code in tests/bluetooth/tester/src/mesh.c +* :github:`37951` - [Coverity CID: 238365] Logical vs. bitwise operator in drivers/i2s/i2s_nrfx.c +* :github:`37950` - [Coverity CID: 237067] Division or modulo by zero in tests/benchmarks/latency_measure/src/heap_malloc_free.c +* :github:`37949` - [Coverity CID: 238382] Dereference before null check in subsys/bluetooth/mesh/cfg_cli.c +* :github:`37948` - [Coverity CID: 238338] Dereference before null check in subsys/bluetooth/mesh/cfg_cli.c +* :github:`37947` - [Coverity CID: 237069] Dereference before null check in subsys/bluetooth/host/att.c +* :github:`37946` - [Coverity CID: 237066] Calling risky function in tests/lib/c_lib/src/main.c +* :github:`37945` - [Coverity CID: 237064] Calling risky function in tests/lib/c_lib/src/main.c +* :github:`37944` - [Coverity CID: 237062] Calling risky function in tests/lib/c_lib/src/main.c +* :github:`37940` - Unconsistent UART ASYNC API +* :github:`37927` - tests-ci: net-lib: test/net/lib : build missing drivers__net and application has no console output +* :github:`37916` - [Coverity CID :219656] Uninitialized scalar variable in file /tests/kernel/threads/thread_stack/src/main.c +* :github:`37915` - led_pwm driver not generating correct linker symbol +* :github:`37896` - samples: bluetooth: mesh: build failed for native posix +* :github:`37876` - Execution of twister in makefile environment +* :github:`37865` - nRF Battery measurement issue +* :github:`37861` - tests/lib/ringbuffer failed on ARC boards +* :github:`37856` - tests: arm: uninitialized FPSCR +* :github:`37852` - RISC-V machine timer time-keeping question +* :github:`37850` - Provide macros for switching off Zephyr kernel version +* :github:`37842` - TCP2 statemachine gets stuck in TCP_FIN_WAIT_2 state +* :github:`37839` - SX1272 LoRa driver is broken and fails to build +* :github:`37838` - cmake 3.20 not supported (yet) by recent Ubuntu +* :github:`37830` - intel_adsp_cavs15: run queue testcases failed on ADSP +* :github:`37827` - stm32h747i_disco M4 not working, if use large size(>1KB) global array +* :github:`37821` - pm: ``pm_device_request`` incorrectly returns errors +* :github:`37797` - Merge vendor-prefixes.txt from all modules with build.settings.dts_root in zephyr/module.yml +* :github:`37790` - Bluetooth: host: Confusion about periodic advertising interval +* :github:`37786` - Example for tca9546a multiplexor driver +* :github:`37784` - MPU6050 accel and gyro values swapped +* :github:`37781` - nucleo_l496zg lpuart1 driver not working +* :github:`37779` - adc sam0 interrupt mapping, RESRDY maps to second interrupt in samd5x.dtsi +* :github:`37772` - samples: subsys: usb: mass: Use &flash0 storage_partition for USB mass storage +* :github:`37768` - tests/lib/ringbuffer/libraries.data_structures fails to build on number of platforms due to CONFIG_SYS_CLOCK_TICKS_PER_SEC=100000 +* :github:`37765` - cmake: multiple ``No SOURCES given to Zephyr library:`` warnings +* :github:`37746` - qemu_x86_64 fails samples/hello_world/sample.basic.helloworld.uefi in CI +* :github:`37735` - Unsigned types are incorrectly serialized when TLV format is used in LWM2M response +* :github:`37734` - xtensa xcc build spi_nor.c fail +* :github:`37720` - net: dtls: received close_notify alerts are not properly handled by DTLS client sockets +* :github:`37718` - Incompatible (u)intptr_t type and PRIxPTR definitions +* :github:`37709` - x86 PCIe ECAM does not work as expected +* :github:`37701` - stm32: conflicts with uart serial DMA +* :github:`37696` - Modbus TCP: wrong transaction id in response +* :github:`37694` - Update CMSIS-DSP version to 1.9.0 (CMSIS 5.8.0) +* :github:`37693` - Update CMSIS-Core version to 5.5.0 (CMSIS 5.8.0) +* :github:`37691` - samples/subsys/canbus/isotp/sample.subsys.canbus.isotp fails to build on mimxrt1170_evk_cm7 +* :github:`37687` - Support MVE on ARMv8.1-M +* :github:`37684` - Add State Machine Framework to Zephyr +* :github:`37676` - tests/kernel/device/kernel.device.pm (and tests/subsys/pm/power_mgmt/subsys.pm.device_pm) fails to build on mec172xevb_assy6906 & mec1501modular_assy6885 +* :github:`37675` - tests/kernel/device/kernel.device.pm fails on bt510/bt6x0 +* :github:`37672` - Board qemu_x86 is no longer working with shell +* :github:`37665` - File system: wrong type for ssize_t in fs.h for CONFIG_ARCH_POSIX +* :github:`37660` - Changing zephyr,console requires a clean build +* :github:`37658` - samples: boards/stm32/backup_sram : needs backup sram enabled in DT to properly display memory region +* :github:`37652` - bluetooth: tests/bluetooth/bsim_bt/bsim_test_advx reported success but still reported failed. +* :github:`37637` - Infinite configuring loop for samples\drivers\led_ws2812 sample +* :github:`37619` - RT6xx TRNG reports error on first request after reset +* :github:`37611` - Bluetooth: host: Implement L2CAP ecred reconfiguration request as initiator +* :github:`37610` - subsys/mgmt/hawkbit: Unable to parse json if the payload is split into 2 packets +* :github:`37600` - Invalidate TLB after ptables swap +* :github:`37597` - samples: bluetooth: scan_adv +* :github:`37586` - get_maintainer.py is broken +* :github:`37581` - Bluetooth: controller: radio: Change CTE configuration method +* :github:`37579` - PWM: Issue compiling project when CONFIG_PWM and CONFIG_PWM_SAM is used with SAME70 +* :github:`37571` - Bluetooth: Extended advertising assertion +* :github:`37556` - Schedule or timeline of LE audio in zephyr +* :github:`37547` - Bluetooth: Direction Finding: Channel index of received CTE packet is incorrect +* :github:`37544` - Change partition name using .overlay +* :github:`37543` - Using STM32Cube HAL function results in linker error +* :github:`37536` - _pm_devices() skips the very first device in the list and suspend() is not called. +* :github:`37530` - arc smp build failed with mwdt toolchain. +* :github:`37527` - Replace mqtt-azure example with azure-sdk-for-c +* :github:`37526` - ehl_crb: edac tests are failing +* :github:`37520` - Is zephyr can run syscall or extrenal program +* :github:`37519` - friend.c:unseg_app_sdu_decrypt causes assert: net_buf_simple_tailfroom(buf) >= len when payload + opcode is 10 or 11 bytes long +* :github:`37515` - drivers: flash_sam: Random failures when writing large amount of data to flash +* :github:`37502` - OPENTHREAD_CUSTOM_PARAMETERS does not seem to work +* :github:`37495` - mcuboot: Booting an image flashed on top of a Hawkbit updated ones results in hard fault +* :github:`37491` - wrong documentation format on DMA peripheral API reference +* :github:`37482` - 'cmd.exe' is not recognized as an internal or external command, operable program or batch file. +* :github:`37475` - twister: wrong test statuses in json report +* :github:`37472` - Corrupted timeout on poll for offloaded sockets +* :github:`37467` - Bluetooth: host: Incorrect advertiser timeout handling when using Limited Discoverable flag +* :github:`37465` - samples/bluetooth/iso_receive fails on nrf5340dk target +* :github:`37462` - Bluetooth: Advertising becomes scannable even if BT_LE_ADV_OPT_FORCE_NAME_IN_AD is set +* :github:`37461` - Schedule of LE audio in zephyr +* :github:`37460` - tests/kernel/sched/schedule_api/kernel.scheduler and tests/kernel/fifo/fifo_timeout/kernel.fifo.timeout failed on nsim_hs_smp board +* :github:`37456` - script: Unaccounted size in ram/rom reports +* :github:`37454` - Sensor driver: sht4x, sgp40, invalid include path +* :github:`37446` - Sensor driver: ST LPS22HH undeclared functions and variables +* :github:`37444` - MSI-X: wrong register referenced in map_msix_table() +* :github:`37441` - Native POSIX Flash Storage Does not Support Multiple Instances +* :github:`37436` - Delayed startup due to printing over not ready console +* :github:`37412` - IQ samples are not correct during the "reference period" of CTE signal +* :github:`37409` - Allow dual controller on usb +* :github:`37406` - ISO disconnect complete event doesn't reach the application +* :github:`37400` - esp32 build +* :github:`37396` - DHCP issue with events not triggering on network with microsoft windows DHCP server +* :github:`37395` - stm32h747i_disco board M4 core not working +* :github:`37391` - Bluetooth: 4 Bits of IQ Samples Are Removed (Direction Finding Based on CTE) +* :github:`37386` - bt_vcs_register() enhancement for setting default volume and step +* :github:`37379` - drivers: adc for stm32h7 depends on the version for oversampling +* :github:`37376` - samples/subsys/usb/dfu/sample.usb.dfu fails on teensy41/teensy40 +* :github:`37375` - tests/drivers/adc/adc_api/drivers.adc fails to build on nucleo_h753zi +* :github:`37371` - logging.log2_api_deferred_64b_timestamp tests fails running on several qemu platforms +* :github:`37367` - Bluetooth: Host: Support setting long advertising data +* :github:`37365` - STM32 :DTCM: incorrect buffer size utilization +* :github:`37346` - STM32WL LoRa increased the current in "suspend_to_idle" state +* :github:`37338` - west flash to teensy 41 fail, use blinky with west build +* :github:`37332` - Increased power consumption for STM32WB55 with enabled PM and Bluetooth +* :github:`37327` - subsys/mgmt/hawkbit: hawkbit run can interrupt a running instance +* :github:`37319` - West 0.11.0 fails in Zephyr doc build under other manifest repo & renamed Zephyr fork +* :github:`37309` - ARC: add MPU v6 (and others) support +* :github:`37307` - Use XOSHIRO random number generator on NXP i.MX RT platform +* :github:`37306` - revert commit with bogus commit message +* :github:`37305` - Bluetooth Direction Finding Support of "AoA RX 1us" +* :github:`37304` - k_timer_status_sync can lock forever on qemu_x86_64 +* :github:`37303` - tests: drivers: i2s: drivers.i2s.speed scenario fails on nrf platforms +* :github:`37294` - RTT logs not found with default west debug invocation on jlink runner +* :github:`37293` - Native POSIX MAC addresses are not random and are duplicate between multiple instances +* :github:`37272` - subsys/mgmt/hawkbit: Falsely determine that an update is installed successfully +* :github:`37270` - stm32l4 System Power Management issue +* :github:`37264` - tests-ci : can: isotp: implemmentation test report FATAL ERROR when do not connect can loopback test pins +* :github:`37265` - tests-ci : kernel: scheduler: multiq test failed +* :github:`37266` - tests-ci : kernel: memory_protection: userspace test Timeout +* :github:`37267` - tests-ci : kernel: threads: apis test Timeout +* :github:`37263` - lib: timeutil: conversion becomes less accurate as time progresses +* :github:`37260` - STM32WL does not support HSE as RCC source and HSEDiv +* :github:`37258` - symmetric multiprocessing failed in user mode +* :github:`37254` - Run Coverity / Generate GitHub Issues +* :github:`37253` - west flash is failed with openocd for on macOS +* :github:`37236` - ESP32 will not start when CONFIG_ASSERT=y is enabled +* :github:`37231` - BME280 faulty measurement after power cycle +* :github:`37228` - Bluetooth SMP does not complete pairing +* :github:`37226` - PM: soc: Leftover in conversion of PM hooks to __weak +* :github:`37225` - subsys/mgmt/hawkbit & sample: Bugs/improvements +* :github:`37222` - k_queue data corruption, override user data after reserved heading word +* :github:`37221` - nRF5340: SPIM4 invalid clock frequency selection +* :github:`37213` - ESP32: can't write to SD card over SPI (CRC error) +* :github:`37207` - drivers: serial: convert uart_altera_jtag_hal to use devicetree +* :github:`37206` - counter: stm32: Missing implementation of set_top_value +* :github:`37205` - openocd: Configure thread awareness by default +* :github:`37202` - esp32c3 build error +* :github:`37189` - Bug "Key 'name', 'cmake-ext' and 'kconfig-ext' were not defined" when build a zephyr application +* :github:`37188` - Get an error of "Illegal load of EXC_RETURN into PC" when print log in IO interrupt callback +* :github:`37182` - cmsis_v1 osSignalWait doesn't clear the signals properly when any signal mask is set +* :github:`37180` - Led driver PCA9633 does nok take chip out from sleep +* :github:`37175` - nucleo-f756zg: rtos aware debugging not working +* :github:`37174` - Zephyr's .git directory is 409 MiB, can it be squashed? +* :github:`37173` - drivers: clock_control: stm32: AHB prescaler usable for almost all stm32 series +* :github:`37170` - LwM2M lwm2m_rd_client_stop() not working when called during bootstrapping/registration +* :github:`37160` - [Moved] Bootloader should provide the version of zephyr, mcuboot and a user defined version to the application +* :github:`37159` - osThreadTerminate does not decrease the instances counter +* :github:`37153` - USB serial number is not unique for STM32 devices +* :github:`37145` - sys: ring_buffer: ring_buf_peek() and ring_buf_size_get() +* :github:`37140` - Twister: Cmake error wrongly counted in the report +* :github:`37135` - Extend the HWINFO API to provide variable length unique ID +* :github:`37134` - Add support for the Raspberry Pi Compute Module 4 +* :github:`37132` - Assert on enabling Socket CAN +* :github:`37120` - Documentation on modules +* :github:`37119` - tests: kernel tests hardfault on nucleo_l073rz +* :github:`37115` - tests/bluetooth/shell fails to builds on a lot of platforms +* :github:`37109` - Zephyr POSIX layer uses swapping with an interrupt lock held +* :github:`37105` - mcumgr: BUS FAULT when starting dfu with mcumgr CLI +* :github:`37104` - tests-ci : kernel: scheduler: multiq test failed +* :github:`37075` - PlatformIO: i cannot use the Wifi Shield ESP8266 to build the sample wifi project with the Nucleo F429ZI +* :github:`37070` - NXP mcux ADC16 reading 65535 +* :github:`37057` - PWM-blinky for Silabs MCU +* :github:`37038` - stm32f4 - DMA tx interrupt doesn't trigger +* :github:`37032` - document: API reference missing: In clock of zephyr document +* :github:`37029` - drivers: sensor: sensor_value_to_double requieres non const sensor_value pointer +* :github:`37028` - ipv6 multicast addresses vanish after iface down/up sequence +* :github:`37024` - Compile error if we only use VCS without VOCS and AICS +* :github:`37023` - zephyr_prebuilt.elf and zephyr.elf has inconsistent symbol address in RISC-V platform +* :github:`37007` - Problem with out of tree driver +* :github:`37006` - tests: kernel: mem_protect: stack_random: enable qemu_riscv32 +* :github:`36998` - TF-M: does not allow PSA Connect to proceed with IRQs locked +* :github:`36990` - Memory misalignment ARM Cortex-M33 +* :github:`36971` - ESP32: wifi station sample does not get IP address by DHCP4 +* :github:`36967` - Bluetooth: public API to query controller public address +* :github:`36959` - Direction Finding - CTE transmitted in connectionless mode has wrong length +* :github:`36953` - lorawan: MlmeConfirm failed : Tx timeout +* :github:`36948` - Cluttering of logs on USB Console in Zephyr when CDC Shell is enabled +* :github:`36947` - Tensorflow: Dedicated tflite-micro repository +* :github:`36929` - Failure to build OpenThread LwM2M client on nrf52840dk +* :github:`36928` - Disconnecting ISO mid-send giver error in hci_num_completed_packets +* :github:`36927` - LWM2M: Writing to Write-Only resource causes notification +* :github:`36926` - samples/boards/nrf/system_off wouldn't compile on Particle Xenon board +* :github:`36924` - embARC Machine Learning Inference Library from Synopsys +* :github:`36917` - Runtime device PM is broken on STM32 +* :github:`36909` - Shell log` commands crash the system if CONFIG_SHELL_LOG_BACKEND is not defined +* :github:`36896` - tests: net: select: still failing occasionally due to FUZZ +* :github:`36891` - Significant TCP perfomance regression +* :github:`36889` - string.h / strcasestr() + strtok() +* :github:`36885` - Update ISO API to better support TWS +* :github:`36882` - MCUMGR: fs upload fail for first time file upload +* :github:`36873` - USB AUDIO Byte alignment issues +* :github:`36869` - Direction Finding Connectionless porting to nrf52811 +* :github:`36866` - CONFIG_NO_OPTIMIZATIONS=y MPU fault on Zephyr 2.6 +* :github:`36865` - k_work_q seems to check uninitialized flag on start +* :github:`36859` - Possible Advertising PDU Corruption if bt_enable called in SYS_INIT function +* :github:`36858` - Static object constructors execute twice on the NATIVE_POSIX target +* :github:`36857` - i2c_samd0.c burst write not compatible with ssd1306.c +* :github:`36851` - FS logging backend assumes littlefs +* :github:`36823` - Build excludes paths to standard C++ headers when using GNUARMEMB toolchain variant +* :github:`36819` - qemu_leon3 samples/subsys/portability/cmsis_rtos_v2 samples failing +* :github:`36814` - Wrong format type for uint32_t +* :github:`36811` - Clarify ``Z_`` APIs naming conventions and intended scope +* :github:`36802` - MCUboot doesn't work with encrypted images on external flash +* :github:`36796` - Build failure: samples/net/civetweb/http_server using target stm32h735g_disco +* :github:`36794` - Build failure: tests/drivers/adc using stm32l562e_dk +* :github:`36790` - sys: ring_buffer: correct space calculation when tail is less than head +* :github:`36789` - [ESP32] samples blinky / gpio / custom board +* :github:`36783` - drivers: modem: hl7800 gpio init failed with interrupt flags +* :github:`36782` - drivers: serial: nrfx: Enforced pull-ups on RXD and CTS conflict on many custom boards +* :github:`36781` - source_periph incorrectly set in dma_stm32 +* :github:`36778` - firmware update using mcumgr displays information for only slot 0 and not slot 1. +* :github:`36770` - doc:Missing description for deadline scheduling +* :github:`36769` - Zephyr assumes Interrupt Line config space register is RW, while ACRN hardwired it to 0. +* :github:`36767` - tests-ci :arch.arm.irq_advanced_features.arm_irq_target_state : test failed +* :github:`36768` - tests-ci :coredump.logging_backend : test failed +* :github:`36765` - [PCI] ACRN sets Interrupt Line config space register to 0 and ReadOnly. +* :github:`36764` - Bluetooth Require paired after disconnected work with iphone +* :github:`36755` - NTP client faults module when it fails +* :github:`36748` - Zephyr IP Stack Leaks when using PROMISCUOUS socket along with POSIX sockets based implementation. +* :github:`36747` - Adding Board Support for STEVAL-STWINKT1B +* :github:`36745` - Zephyr IP Stack Limited to 1514 bytes on the wire - no ICMPs beyond this limit +* :github:`36739` - coap_packet_get_payload() returns the wrong size +* :github:`36737` - Cortex M23: "swap_helper.S:223: Error: invalid offset, value too big (0x0000009C)" +* :github:`36736` - kernel: SMP global lock (and therefore irq_lock) works incorrectly on SMP platforms +* :github:`36718` - st_ble_sensor sample references wrong attribute +* :github:`36716` - zephyr - ADC - ATSAMD21G18A +* :github:`36713` - nrf5 ieee802154 driver does not compile and breaks CI +* :github:`36711` - Enable "template repository" for zephyrproject-rtos/example-application +* :github:`36696` - Json on native_posix_64 board +* :github:`36695` - net: ieee802154: cc13xx_26xx: Sub-GHz RF power saving +* :github:`36692` - Release Notes for 2.6.0 not useful (BLE API changes) +* :github:`36679` - Bluetooth - notifications not sending (bonded, CONFIG_BT_MAX_CONN=4, after disconnection then reconnection) +* :github:`36678` - Zephyr Throws Exception for Shell "log status" command when Telnet is shell backend and log is UART backend +* :github:`36668` - LittleFS example overwrite falsh memory +* :github:`36667` - logger: Filesystem backend doesn't work except for first time boot +* :github:`36665` - l2cap cids mixed up in request +* :github:`36661` - xtensa xcc does not support "-Warray-bounds" +* :github:`36659` - samples/net/sockets small bugs +* :github:`36655` - twister: sometimes the twister fails because the error ``configparser.NoSectionError: No section: 'manifest'`` +* :github:`36652` - deadlock in pthread implementation on SMP platforms +* :github:`36646` - sample.shell.shell_module.minimal_rtt fails to build on mimxrt1170_evk_cm4/mimxrt1170_evk_cm7 +* :github:`36644` - Toolchain C++ headers can be included when libstdc++ is not selected +* :github:`36631` - Turn on GPIO from DTS +* :github:`36625` - compilation fails while building samples/net/openthread/coprocessor for Arduino nano 33 ble +* :github:`36613` - LoRaWAN - Provide method to register a callback for received data +* :github:`36609` - could not mount fatfs on efm32pg_stk3402a +* :github:`36608` - Unable to compile USB console example with uart_mux +* :github:`36606` - Regression in udp socket performance from zephyr v2.3.0 to v2.6.0 +* :github:`36600` - Bluetooth: Peripheral: Bond issue when using secure connection +* :github:`36598` - Lora driver TX done wait/synchronous call +* :github:`36593` - Failing IPv6 Ready compliance (RFC 2460) +* :github:`36590` - NVS sector size above 65535 not supported +* :github:`36578` - net: ip: Assertion fails when tcp_send_data() with zero length packet +* :github:`36575` - Modbus RTU Client on ESP32 +* :github:`36572` - kernel: Negative mutex lock_count value +* :github:`36570` - Use a custom role for Kconfig configuration options +* :github:`36569` - '.. only:' is not working as expected in documentation +* :github:`36568` - net: lib: sockets: Assertion fails when zsock_close() +* :github:`36565` - ehl_crb: Only boot banner is printed but not the test related details for multiple tests due to PR #36191 is not backported to v2.6.0 release +* :github:`36553` - LoRaWAN Sample: join accept but "Join failed" +* :github:`36552` - Bluetooth v2.6.0 connectable advertising leak/loss +* :github:`36540` - LoRaWAN otaa.app_key belongs to mib_req.Param.AppKey +* :github:`36524` - HSE clock doesn't initialize and blinky doesn't run on custom board when moving from zephyr v2.3.0 to v2.6.0 +* :github:`36520` - tests/kernel/timer/timer_api/kernel.timer.tickless fails to build on npcx9m6f_evb +* :github:`36500` - espressif: cannot install toolchain on Darwin-arm64 +* :github:`36496` - bluetooth: only the first Extended Advertising Report with data status "incomplete, more data to come" is issued +* :github:`36495` - dtc generates missing #address-cells in interrupt provider warning +* :github:`36486` - LOG2 - self referential macro +* :github:`36467` - runner mdb-hw not work with arc hsdk board +* :github:`36466` - tests/kernel/mem_protect/mem_protect failed with arcmwdt toolchain +* :github:`36465` - samples/compression/lz4 failed with arcmwdt toolchian +* :github:`36462` - [bluetooth stack][limited_discoverable_advertising timeout] Some problems about the lim_adv_timeout +* :github:`36448` - samples: subsys: fs: fat_fs: adafruit_2_8_tft_touch_v2: buildkite compilation failed when no i2c defined +* :github:`36447` - net: socket: socketpair: Poll call resetting all events +* :github:`36435` - RFC: API Change: Mesh: Add return value for opcode callback +* :github:`36427` - test: kernel.common.nano32: zephyr-v2.6.0-286-g46029914a7ac: mimxrt1060_evk: test fails +* :github:`36419` - test-ci: net.ethernet_mgmt: zephyr-v2.6.0-286-g46029914a7ac: frdm_k64f: test fails +* :github:`36418` - test-ci: net.socket.tls: zephyr-v2.6.0-286-g46029914a7ac: frdm_k64f: test fail +* :github:`36417` - tests-ci :coredump.logging_backend : zephyr-v2.6.0-286-g46029914a7ac: lpcxpresso55s28: test failed +* :github:`36416` - tests-ci :arch.arm.irq_advanced_features.arm_irq_target_state : zephyr-v2.6.0-286-g46029914a7ac: lpcxpresso55s28: test failed +* :github:`36414` - ESP32 with samples/net/wifi gives: net_if: There is no network interface to work with! +* :github:`36412` - Blinky on ESP32: Unsupported board: led0 devicetree alias is not defined" +* :github:`36410` - board: cc1352r_sensortag: add dts entry for hdc2080 +* :github:`36408` - ARM_MPU on boards ``stm32_min_dev_*`` without MPU enabled +* :github:`36398` - [Video API] Erroneous function pointer validation +* :github:`36390` - net: ip: Negative TCP unacked_len value +* :github:`36388` - ARM: Architecture Level user guide +* :github:`36382` - segfault when hardware isn't emulated +* :github:`36381` - Bluetooth ASSERTION FAIL [evdone] Zephyr v2.6.0 +* :github:`36380` - missing auto-dependency on CONFIG_EMUL +* :github:`36357` - tests: samples: watchdog: sample.subsys.task_wdt fails on nrf platforms +* :github:`36356` - Network fails to transmit STM32H747DISC0 board zephyr v2.6.0 +* :github:`36351` - nRF: we do not always guarantee that SystemInit is inlined +* :github:`36347` - Zephyr Wifi IoT device - whats a good board to start with? +* :github:`36344` - Zephyr 2.6.0 st_ble_sensor sample is broken when compiled for nucleo_wb55rg +* :github:`36339` - samples/subsys/logging/dictionary doesn't build under MS Windows environment +* :github:`36329` - Support for CC3120 WiFi module +* :github:`36324` - add project groups to upsteam west manifest +* :github:`36323` - Don't set TFM_CMAKE_BUILD_TYPE_DEBUG by default on LPC55S69-NS if DEBUG_OPTIMIZATIONS +* :github:`36319` - Help: Asking for Help Tips page gets 404 error +* :github:`36318` - [Coverity CID: 236600] Unused value in drivers/ieee802154/ieee802154_nrf5.c +* :github:`36317` - [Coverity CID: 236599] Unused value in drivers/ieee802154/ieee802154_nrf5.c +* :github:`36316` - [Coverity CID: 236597] Unused value in drivers/ieee802154/ieee802154_nrf5.c +* :github:`36315` - [Coverity CID: 236604] Untrusted value as argument in subsys/net/lib/lwm2m/lwm2m_engine.c +* :github:`36314` - [Coverity CID: 236610] Uninitialized pointer read in subsys/bluetooth/mesh/proxy.c +* :github:`36313` - [Coverity CID: 236602] Unchecked return value in drivers/modem/gsm_ppp.c +* :github:`36312` - [Coverity CID: 236608] Out-of-bounds access in subsys/bluetooth/audio/mics_client.c +* :github:`36311` - [Coverity CID: 236598] Out-of-bounds access in subsys/bluetooth/audio/mics_client.c +* :github:`36310` - [Coverity CID: 236607] Missing break in switch in drivers/ieee802154/ieee802154_nrf5.c +* :github:`36309` - [Coverity CID: 236606] Missing break in switch in drivers/ieee802154/ieee802154_nrf5.c +* :github:`36308` - [Coverity CID: 236601] Missing break in switch in drivers/ieee802154/ieee802154_nrf5.c +* :github:`36307` - [Coverity CID: 236605] Logically dead code in subsys/bluetooth/audio/mics.c +* :github:`36306` - [Coverity CID: 236596] Logically dead code in subsys/bluetooth/audio/mics.c +* :github:`36305` - [Coverity CID: 236595] Logically dead code in samples/drivers/eeprom/src/main.c +* :github:`36304` - [Coverity CID: 236609] Explicit null dereferenced in subsys/bluetooth/audio/mics_client.c +* :github:`36303` - [Coverity CID: 236603] Dereference after null check in subsys/bluetooth/audio/vcs_client.c +* :github:`36301` - soc: cypress: Port Zephyr to Cypress CYW43907 +* :github:`36298` - TF-M integration: add a brief user guide +* :github:`36291` - ADC and math library functions use for stm32l496 +* :github:`36289` - eswifi gets a deadlock on b_l4s5i_iot01a target +* :github:`36282` - Overwrite mode for RTT logging +* :github:`36278` - ARM: Cortex-M: SysTick priority is not initialized if the SysTick is not used +* :github:`36276` - NULL pointer access in check_used_port() +* :github:`36270` - TF-M: introduce uniformity in Non-Secure target names +* :github:`36267` - net: ieee802154: software address filtering +* :github:`36263` - up_squared: kernel.memory_protection.mem_map.x86_64 failed. +* :github:`36256` - SPI4 & 3 MISO not working on nRF5340 +* :github:`36255` - tests/subsys/logging/log_core failed on hsdk board +* :github:`36254` - Zephyr shell subsystem not work with ARC hardware boards. +* :github:`36250` - tests/subsys/cpp/cxx - doesn't compile on native_posix when CONFIG_EXCEPTIONS=y +* :github:`36247` - samples: usb: testusb: Problems with using with cdc-acm +* :github:`36242` - Zephyr Upstream + sdk-nrf BLE NUS SHELL LOG/CBPRINTF build problem. +* :github:`36238` - net_if.c: possible mutex deadlock +* :github:`36237` - fs_open returns 0 on existing file with FS_O_CREATE | FS_O_WRITE +* :github:`36197` - BOSSA flashing on Arduino Nano 33 BLE (NRF52840) +* :github:`36185` - CMP0116 related warnings +* :github:`36172` - net: ieee802154: LL src/dst address is lost from received net_pkt (when using 6LO) +* :github:`36163` - nvs no longer supports the use of id=0xffff +* :github:`36131` - Occasionally unable to scan for extended advertisements when connected +* :github:`36117` - toolchain: The added abstraction for llvm, breaks builds with off-tree llvm based toolchains +* :github:`36107` - ehl_crb: Multiple tests are failing and board is not booting up. +* :github:`36101` - tfm related build rebuild even if nothing changes +* :github:`36100` - pb_gatt buf_send does not call callback +* :github:`36095` - drivers: pwm: sam: compilation failure for sam_v71b_xult +* :github:`36094` - BLE wrong connections intervals on multible connections +* :github:`36093` - Fix dt_compat_enabled_with_label behavior (or usage) +* :github:`36089` - intel_adsp_cavs25: support more than 2 DSP cores +* :github:`36088` - intel_adsp_cavs25: secondary boot fails in arch_start_cpu() +* :github:`36084` - Arduino Nano 33 BLE: USB gets disconnected after flashing +* :github:`36078` - coredump.logging_backend: lpcxpresso55s28: test failure assertion fail +* :github:`36077` - net: lib: coap: Impossible to get socket info from incoming packet +* :github:`36075` - drivers: can: stm32fd: can2 does not work +* :github:`36074` - LoRaWAN: sx126x: infinite loop on CRC error +* :github:`36061` - Undefined reference to ``z_priq_rb_lessthan(rbnode*, rbnode*)`` when using k_timer_start in cpp file. +* :github:`36057` - Zephyr Shell Console and Logging Targeting Isolated Different Device Interfaces +* :github:`36048` - Cannot establish ISO CIS connection properly after ACL disconnected several times +* :github:`36038` - iotdk: the testcase samples/modules/nanopb can't build +* :github:`36037` - bt_init returning success when Bluetooth initialization does not get finalized. +* :github:`36035` - struct devices should be allocated in ROM, not RAM +* :github:`36033` - Mere warnings slow down incremental documentation build from seconds to minutes +* :github:`36030` - West warnings (and others?) are ignored when building documentation +* :github:`36028` - More Description in Example Documentation +* :github:`36026` - wolfssl / wolfcrypt +* :github:`36022` - Wrong channel index in connectionless IQ samples report +* :github:`36014` - stm32g050: Missing closing parenthesis for soc prototype +* :github:`36013` - arm: qemu: run cmsis-dsp tests on the qemu target with FPU +* :github:`35999` - Unexpected Bluetooth disconnection and removal of bond +* :github:`35992` - stm32f303k8 device tree missing DACs +* :github:`35986` - POSIX: multiple definition of posix_types +* :github:`35983` - [backport v1.14-branch] backport of #35935 failed +* :github:`35978` - ESP32 SPI send data hangup +* :github:`35972` - C++ exceptions do not work when building with GNU Arm Embedded +* :github:`35971` - ehl_crb: test_nop is failing under tests/kernel/common/ +* :github:`35970` - up_squared: samples/boards/up_squared/gpio_counter/ is failing +* :github:`35964` - shell_uart hangs when putting UART into PM_LOW_POWER_STATE / PM_DEVICE_STATE_LOW_POWER +* :github:`35962` - drivers using deprecated Kconfigs +* :github:`35955` - Bluetooth: Controller: Regression in connection setup +* :github:`35949` - can: mcan: sjw-data devicetree configuration is not written correctly +* :github:`35945` - SPI4 on nRF5340 not working when using k_sleep() in main +* :github:`35941` - subsys: tracing: sysview: No SEGGER_SYSVIEW.h in path +* :github:`35939` - enc424j600 driver unusable/broken on stm32l552 +* :github:`35931` - Bluetooth: controller: Assertion in ull_master.c +* :github:`35930` - nRF Dongle as BLE Central Unstable Connectivity at Long-ish Range +* :github:`35926` - Shell tab-completion with more than two levels of nested dynamic commands fails +* :github:`35916` - drivers: TI cc13xx_cc26xx: build error when PM is enabled (serial, entropy, spi, i2c modules) +* :github:`35908` - Stopping DHCP with network interface goes down leaves networking state in a broken state +* :github:`35897` - Bluetooth: PTS Tester on native posix +* :github:`35890` - Build system ignores explicit ZephyrBuildConfiguration_ROOT variable +* :github:`35880` - PSA tests run indefinitely when CONFIG_TFM_IPC=y +* :github:`35870` - Build failure with gcc 11.x on native_posix +* :github:`35857` - intel_adsp_cavs15: run msgq testcases failed on ADSP +* :github:`35856` - intel_adsp_cavs15: run semaphore testcases failed on ADSP +* :github:`35850` - the sample kernel/metairq_dispatch fails on nucleo_g474re +* :github:`35835` - ADC support for STM32l496_disco board +* :github:`35809` - sample: USB audio samples are not working on STM32 +* :github:`35793` - kernel.scheduler.multiq: Failed since #35276 ("cooperative scheduling only" special cases removal) +* :github:`35789` - sockets_tls: receiving data on offloaded socket before handshake causes pollin | pollerr and failed recvfrom (SARA-R4) +* :github:`35721` - Atmel sam0 Async and/or DMA may not work +* :github:`35720` - tests:kernel timer fails on test_sleep_abs with TICKLESS_KERNEL and PM on nucleo_wb55rg +* :github:`35718` - Excessive error messages from filesystem interface +* :github:`35711` - net: sockets: dtls: handshake not reset as it ought to be +* :github:`35707` - AssertionError: zephyr/tests/kernel/common test case is failing with gcc-11 (Yocto) +* :github:`35703` - posix_apis: fails at test_posix_realtime for mimxrt1024_evk +* :github:`35681` - Unable to get output for samples/subsys/logging/logger and samples/philosophers +* :github:`35668` - The channel selection of auxiliary advertisments in extended advertisments +* :github:`35663` - STM32H7: Support memory protection unit(MPU) to enable shared memory +* :github:`35658` - arch.interrupt.arm.irq_vector_table.arm_irq_vector_table: MPU FAULT Halting system for mximxrt685_evk_cm33 +* :github:`35656` - arch.interrupt.arm.arm_interrupt: hangs on mimxrt685_evk_cm33 +* :github:`35581` - stm32 SPI problems with DMA and INTR set-up +* :github:`35550` - nRF91: DPS310 I2C driver not working +* :github:`35532` - SSL Handshake error with modified http(s) client example +* :github:`35529` - STM32: STM32H7 ADC calibration must be performed on startup +* :github:`35429` - subsys: settings: Encryption +* :github:`35377` - add creg_gpio driver for ARC HSDK board +* :github:`35354` - Adding support for measurement of Ultraviolet(UV) Light. +* :github:`35293` - Sporadic boot failure +* :github:`35256` - DOC: DATA PASSING TABLE MISSING THE OBJECT QUEUES +* :github:`35250` - Twister is not reading the serial line output completely +* :github:`35244` - twister: build failure for native_posix with GNU binutils 2.35 +* :github:`35238` - ieee802.15.4 support for stm32wb55 +* :github:`35229` - twister log mixing between tests +* :github:`35190` - echo_server sample non-functional rails all CPUs on native_posix_64 board build +* :github:`35055` - STM32L432KC Nucleo Reference board SWD problem after programming with Zephyr +* :github:`34917` - arch.interrupt.arm| arch.interrupt.extra_exception_info: lpcxpresso55s28 series: test failure +* :github:`34913` - ModuleNotFoundError: No module named 'elftools' +* :github:`34879` - mec15xxevb_assy6853: 2 GPIO test failures +* :github:`34855` - FANSTEL BT840X +* :github:`34832` - Coding Guideline - MISRA rule 14.4 not applied properly +* :github:`34829` - Bluetooth: ISO: Don't attempt to remove the ISO data path of a disconnected ISO channel +* :github:`34767` - C++ support on ESP boards +* :github:`34760` - Hawkbit not downloading large files +* :github:`34659` - Bluetooth: HCI cmd response timeout +* :github:`34571` - Twister mark successfully passed tests as failed +* :github:`34557` - upgrade fatfs to 0.14b +* :github:`34554` - Settings FS: Duplicate finding is extremely slow when dealing with larger number of settings entries +* :github:`34544` - lib: gui: lvgl: buffer overflow bug on misconfiguration +* :github:`34543` - STM32F1 failed to compile with CONFIG_UART_ASYNC_API +* :github:`34392` - [backport v2.5-branch] backport of #34237 failed +* :github:`34391` - [backport v1.14-branch] backport of #34237 failed +* :github:`34390` - i2s: bitrate is wrongly configured on STM32 +* :github:`34372` - CPU Lockups when using own Log Backend +* :github:`34354` - Please investigate adding DMA support to STM32 I2C! +* :github:`34324` - RTT is not working on STM32 +* :github:`34315` - BMI270 configuration file sending to I2C seems to be not handling the last part of the configuration properly. +* :github:`34305` - Shell [modem send] command causes shell to hang after about 10 seconds, Sara R4 - Particle Boron +* :github:`34282` - HAL Module Request: hal_telink +* :github:`34273` - mqtt_publisher: Unable to connect properly on EC21 modem with bg9x driver +* :github:`34269` - LOG_MODE_MINIMAL BUILD error +* :github:`34268` - Bluetooth: Mesh: Sample is stuck in init process on disco_l475_iot +* :github:`34259` - Problem running code with memory domain +* :github:`34239` - Call settings_save_one in the system work queue, which will cause real-time performance degradation. +* :github:`34236` - External source code integration request: Raspberry Pi Pico SDK +* :github:`34231` - uzlib (decompression library) +* :github:`34226` - Compile error when building civetweb http_server sample for posix_native +* :github:`34222` - Commit related to null pointer exception detection causing UART issues +* :github:`34218` - Civetweb server crashing when trying to access invalid resource +* :github:`34204` - nvs_write: Bad documented return value. +* :github:`34192` - Sensor BME680: Add support for SPI operation +* :github:`34134` - USB do not works if bootloader badly use the device before +* :github:`34131` - TFTP client ignores incoming data packets +* :github:`34121` - Unable to generate pdf according to the documentation steps on windows +* :github:`34105` - Convert tests/kernel/workq to new kwork API +* :github:`34049` - Nordic nrf9160 switching between drivers and peripherals +* :github:`34015` - cfb sample "Device not found" for esp32 when SSD1306 is enabled +* :github:`33994` - kscan_ft5336 doesn't provide proper up/down information when polling, and hogs resources in interrupt mode +* :github:`33960` - Zephyr for Briey SoC +* :github:`33937` - [backport v1.14-branch] backport of #26712 failed +* :github:`33932` - [backport v1.14-branch] backport of #26083 failed +* :github:`33910` - sam_v71_xult -> I2C_1 hang during scanning i2c devices +* :github:`33901` - tests: interrupt: irq_enable() and irq_disable() do not work with direct and regular interrupt on x86 +* :github:`33895` - Device tree: STM32L412 and STM32L422 are missing nodes +* :github:`33883` - [backport v2.5-branch] backport of #33340 failed +* :github:`33876` - Lora sender sample build error for esp32 +* :github:`33873` - arm_arch_timer: Too many clock announcements with CONFIG_TICKLESS_KERNEL=n on SMP +* :github:`33862` - [backport v2.5-branch] backport of #33771 failed +* :github:`33753` - LVGL output doesn't match the LVGL TFT simulator for gauge widget +* :github:`33652` - Monitoring the BLE connection +* :github:`33573` - JSON_OBJ_DESCR_ARRAY_ARRAY is dangerously broken +* :github:`33554` - Request to add OM13056 board (LPC1500 family or specifically SoC LPC1519) support to Zephyr +* :github:`33544` - ehl_crb: portability.posix.common.posix_realtime failed. +* :github:`33485` - Issue with DMA transfers outside of the Zephyr DMA driver on STM32F767 +* :github:`33483` - TIMESLICE and PM interaction and expected behavior +* :github:`33449` - Remove deprecated items in 2.7 +* :github:`33440` - lsm6dso sensor driver not working on nRF5340 +* :github:`33435` - armclang / armlinker +* :github:`33337` - twister: Find and fix all "dead" samples/tests +* :github:`33275` - ehl_crb: samples/subsys/shell/shell_module does not work +* :github:`33265` - Power Management Overhaul +* :github:`33192` - LoRaWAN - Application fails to start if module is not powered +* :github:`33113` - Improve code coverage for new feature or code change in kernel +* :github:`33104` - Updating Zephyr to fix Work Queue Problems +* :github:`33099` - ppp: termination packet not sent +* :github:`33052` - [Coverity CID :219624] Untrusted loop bound in subsys/bluetooth/host/sdp.c +* :github:`33041` - [Coverity CID :219645] Untrusted loop bound in subsys/bluetooth/host/sdp.c +* :github:`33016` - spi_nor: CONFIG_SPI_NOR_SFDP_RUNTIME leaves flash in Standby after spi_nor_configure() +* :github:`33015` - spi_nor driver: SPI_NOR_IDLE_IN_DPD breaks SPI_NOR_SFDP_RUNTIME +* :github:`32997` - Improve documentation search experience +* :github:`32990` - FS/littlefs: it is possible to write to already deleted file +* :github:`32984` - West: openocd runner: Don't let debug mode on by default +* :github:`32875` - Benchmarking Zephyr vs. RIOT-OS +* :github:`32836` - Remaining integration failures on intel_adsp_cavs15 +* :github:`32822` - Code doesn't compile after changing the PWM pin on example "blinky_pwm" on NRF52 +* :github:`32803` - Extend mcux uart drivers to support async API +* :github:`32789` - USB DFU support w/o MPU support +* :github:`32733` - RS-485 support +* :github:`32669` - [Bluetooth] sample code for Periodic Advertising Sync Transfer +* :github:`32603` - acrn_ehl_crb: test case of arch.interrupt.prevent_interruption failed +* :github:`32564` - net_buf reference count not protected +* :github:`32545` - It seems that CONFIG_IMG_MGMT_VERBOSE_ERR does not work +* :github:`32531` - get_maintainer.py cannot parse MAINTAINERS.yml +* :github:`32293` - Zephyr 2.6 Release Checklist +* :github:`32289` - USDHC: Fails after reset +* :github:`32282` - x86 ACPI images are much too large +* :github:`32261` - problem with CONFIG_STACK_SENTINEL +* :github:`32133` - Current atomics are subtly broken on AArch64 due to memory ordering +* :github:`32111` - Zephyr build fail with LLVM on Windows +* :github:`32035` - Bluetooth: application notification when MTU updated +* :github:`31993` - Add west extension to parse yml file +* :github:`31985` - riscv: Long execution time when TICKLESS_KERNEL=y +* :github:`31943` - drivers: flash: stm32: harmonization of flash erase implementation across STM32 series +* :github:`31739` - Convert CoAP unit tests to use ztest API +* :github:`31593` - civetweb hangs when there are no free filedescriptors +* :github:`31499` - lwm2m : Add visibility into observer notification success/fail +* :github:`31475` - TCP keepalive +* :github:`31473` - Failed phy request not retried and may prevent DLE procedure during auto-initiation +* :github:`31447` - MQTT idling gets disconnected when using TCP2 +* :github:`31290` - dts: arm: st: standardize pwm default property st,prescaler to 0 +* :github:`31253` - lis3dh driver support is confusing +* :github:`31162` - Mapping between existing and new system power management states +* :github:`31107` - libc: minimal: add qsort routine +* :github:`31043` - Infinite loop in modem cmd_handler_process +* :github:`30921` - west flash failed with an open ocd error +* :github:`30861` - drivers: uart: increase timeout precision in uart_rx_enable +* :github:`30635` - cpu_stats: Change from printk to ``LOG_*`` +* :github:`30429` - Thread Border Router with NRC/RCP sample and nrf52840dk not starting +* :github:`30367` - TCP2 does not send our MSS to peer +* :github:`30245` - Bluetooth: controller: event scheduling pipeline preemption by short schedule +* :github:`30244` - Bluetooth: controller: Extended scan window time reservation prevents auxiliary channel reception +* :github:`30243` - Bluetooth: controller: IRK resolution in extended scanning breaks auxiliary PDU reception +* :github:`30236` - Main thread sometimes looping forever before user application is reached when using UDP and IPv6 on Nucleo F767ZI +* :github:`30209` - TCP2 : How to add MSS option on sending [SYN, ACK] to client? +* :github:`30066` - CI test build with RAM overflow +* :github:`30026` - Can not make multiple BLE IPSP connection to the same host +* :github:`29545` - samples: tfm_integration: tfm_ipc: No module named 'cryptography.hazmat.primitives.asymmetric.ed25519' +* :github:`29535` - riscv: stack objects are mis-aligned +* :github:`29520` - make k_current_get() work without a system call +* :github:`29397` - Build all tests of module mcuboot +* :github:`28872` - Support ESP32 as Bluetooth controller +* :github:`28819` - memory order and consistency promises for Zephyr atomic API? +* :github:`28729` - ARM: Core Stack Improvements/Bug fixes for 2.6 release +* :github:`28716` - 2.5 Release Checklist +* :github:`28312` - Add option to enable ART Accelerator on STM32 FLASH controller +* :github:`27992` - stm32f7: usb: Bursting HID Get and Set report requests leads to unresponding Control endpoint. +* :github:`27525` - Including STM32Cube's USB PD support to Zephyr +* :github:`27415` - Decide if we keep a single thread support (CONFIG_MULTITHREADING=n) in Zephyr +* :github:`27176` - [v1.14] Restore socket descriptor permission management +* :github:`27015` - Add custom transport support for MQTT +* :github:`26981` - Problem with PPP + GSM MUX with SIMCOM7600E +* :github:`26585` - IPv4 multicast datagrams can't be received for mimxrt1064_evk board (missing ethernet API) +* :github:`26256` - NRF51822 BLE Micro module: hangs on k_msleep() (RTC counter not working) +* :github:`26136` - CMake Error in Windows Environment +* :github:`26051` - shell: uart: Allow a change in the shell initalisation to let routing it through USB UART +* :github:`25832` - [test][kernel][lpcxpresso55s69_ns] kernel cases meet ESF could not be retrieved successfully +* :github:`25182` - Raspberry Pi 4B Support +* :github:`25015` - Bluetooth Isochronous Channels Support +* :github:`24854` - docs: Using third-party libraries not well documented in Memory partitions docs +* :github:`24733` - Misconfigured environment +* :github:`24200` - USB GET_INTERFACE response always 0, even when an alternate setting is used +* :github:`24051` - double to sensor_val +* :github:`23745` - Align PS/2 handlers with the handlers found in other drivers +* :github:`23723` - Poor sinf/cosf performance compared to the Segger math libraries +* :github:`23349` - Question: How to add external soc, board, DTS, drivers and libs? +* :github:`22731` - Improve docker CI documentation +* :github:`22705` - Implement counter driver for lpcxpresso55s69 +* :github:`22702` - Implement I2S driver for lpcxpresso55s69 +* :github:`22455` - How to assign USB endpoint address manually in stm32f4_disco for CDC ACM class driver +* :github:`22210` - Bluetooth - bt_gatt_get_value_attr_by_uuid +* :github:`22131` - ARM Cortex_R: CONFIG_USERSPACE: external interrupts are disabled during system calls +* :github:`21869` - IPv6 neighbors get added too eagerly +* :github:`21648` - improve documentation on meta-IRQ threads +* :github:`21519` - RFC: libc: thread-safe newlib +* :github:`21339` - Expired IPv6 router causes an infinite loop +* :github:`21293` - adding timeout the I2C read/write functions for the stm32 port +* :github:`21205` - get_device_list only available if power management invoked +* :github:`21167` - libraries.libc.newlib test fails +* :github:`20576` - DTS overlay files must include full path name +* :github:`20409` - USB: Create webusb shell +* :github:`20236` - usb: api: Cleanup of current inclusion path for USB +* :github:`20171` - support external spi nor flash on mimxrt1060-evk +* :github:`19882` - Add support for multiple channel sampling to STM32 ADC driver +* :github:`19328` - Logger could block in thread at certain log message pool usage +* :github:`18960` - [Coverity CID :203908]Error handling issues in /lib/libc/newlib/libc-hooks.c +* :github:`18896` - Concurrent Multi-Protocol Support NRF52840 +* :github:`18850` - Bluetooth: controller: Advertiser following directed advertiser will have corrupt data +* :github:`18386` - [Coverity CID :203443]Memory - corruptions in /subsys/bluetooth/host/rfcomm.c +* :github:`18351` - logging: 32 bit float values don't work. +* :github:`18316` - Support for unregistering bt_conn callbacks +* :github:`18042` - Only corporate members can join the slack channel +* :github:`17748` - stm32: clock-control: Remove usage of SystemCoreClock +* :github:`17692` - Proper way for joining a multicast group (NRF52840/OpenThread) +* :github:`17375` - Add VREF, TEMPSENSOR, VBAT internal channels to the stm32 adc driver +* :github:`17021` - revise concurrency control in kernel/userspace.c +* :github:`16761` - nrf52840 usb driver with openthread +* :github:`16671` - ideas for future of the settings +* :github:`16231` - Add CONFIG_UART_DYNAMIC_SETTINGS option +* :github:`15841` - Support AT86RF233 +* :github:`15793` - Unable to load binaries into iotdk +* :github:`15676` - Support instrumentation for time spent in various power states +* :github:`15555` - Counter Docs Missing Callback Context Note +* :github:`14308` - Better integration between system and device power modes. +* :github:`12405` - add test to catch issues fixed in PR #12384 +* :github:`11773` - Add Bluetooth support for Silicon Labs EFR32MG12 +* :github:`11702` - Add support for nrfx i2s driver +* :github:`11519` - Add at least build test for cc1200 +* :github:`11193` - ARM V8M Trusted Execution Environments and Zephyr +* :github:`11028` - CONFIG_LOAPIC_SPURIOUS_VECTOR not being tested +* :github:`11000` - USB 2.0 high-speed support in Zephyr +* :github:`10930` - Extending string formatting function +* :github:`10676` - Feature Required: DFU over Thread network +* :github:`10378` - watchdog: Limitation with the current watchdog API for Nordic devices +* :github:`10324` - Publish PDF with the release doc build +* :github:`10198` - Add support for FRDM-STBC-AGM01 sensor shield +* :github:`8876` - Adapt net/l2/ieee802154 subsystem to new shell subsystem +* :github:`8275` - when zephyr can support popular IDE develop? +* :github:`7001` - ST Sensors: Driver factorization +* :github:`6777` - Add copyright handling to contributing doc +* :github:`6657` - Question: Is Bluetooth avrcp supported in Zephyr? Or any plan? +* :github:`6493` - need APIs for ranged random number generation +* :github:`6450` - Several devices of same type on same bus - how to address? +* :github:`6117` - Make sanitycheck aware of DTS and HW support +* :github:`4911` - Filesystem support for qemu +* :github:`1392` - No module named 'elftools' +* :github:`3886` - Add mutual authentication to net/crypto examples +* :github:`3885` - Add real entropy to crypto-based net samples +* :github:`3884` - Improve the TLS and DTLS examples to use best practices on security +* :github:`3879` - k_thread_abort vs k_thread->fn_abort() +* :github:`3677` - Implement HCI Zephyr extensions +* :github:`3199` - xtensa: simplify linker scripts +* :github:`2811` - Investigate having timeout code track tick deadlines instead of deltas +* :github:`2619` - Define APIs for hashing/ Message Authentication +* :github:`2248` - Split LE Controller: style fixes diff --git a/doc/security/vulnerabilities.rst b/doc/security/vulnerabilities.rst index e4fe0c11d811..b550a3b8a957 100644 --- a/doc/security/vulnerabilities.rst +++ b/doc/security/vulnerabilities.rst @@ -784,6 +784,24 @@ Possible overflow in mempool CVE-2021 ======== +CVE-2021-3319 +------------- + +DOS: Incorrect 802154 Frame Validation for Omitted Source / Dest Addresses + +Improper processing of omitted source and destination addresses in +ieee802154 frame validation (ieee802154_validate_frame) + +This has been fixed in main for v2.5.0 + +- `CVE-2020-3319 `_ + +- `Zephyr project bug tracker GHSA-94jg-2p6q-5364 + `_ + +- `PR31908 fix for main + `_ + CVE-2021-3320 ------------------- Mismatch between validation and handling of 802154 ACK frames, where @@ -938,6 +956,36 @@ This has been fixed in main for v2.6.0 - `PR 33418 fix for 1.14.2 `_ +CVE-2021-3436 +------------- + +Bluetooth: Possible to overwrite an existing bond during keys +distribution phase when the identity address of the bond is known + +During the distribution of the identity address information we don’t +check for an existing bond with the same identity address.This means +that a duplicate entry will be created in RAM while the newest entry +will overwrite the existing one in persistent storage. + +This has been fixed in main for v2.6.0 + +- `CVE-2021-3436 `_ + +- `Zephyr project bug tracker GHSA-j76f-35mc-4h63 + `_ + +- `PR 33266 fix for main + `_ + +- `PR 33432 fix for 2.5 + `_ + +- `PR 33433 fix for 2.4 + `_ + +- `PR 33718 fix for 1.14.2 + `_ + CVE-2021-3454 ------------- @@ -989,7 +1037,70 @@ This has been fixed in main for v2.6.0 - `PR 36105 fix for 2.4 `_ +CVE-2021-3510 +------------- + +Zephyr JSON decoder incorrectly decodes array of array + +When using JSON_OBJ_DESCR_ARRAY_ARRAY, the subarray is has the token +type JSON_TOK_LIST_START, but then assigns to the object part of the +union. arr_parse then takes the offset of the array-object (which has +nothing todo with the list) treats it as relative to the parent +object, and stores the length of the subarray in there. + +This has been fixed in main for v2.7.0 + +- `CVE-2021-3510 `_ + +- `Zephyr project bug tracker GHSA-289f-7mw3-2qf4 + `_ + +- `PR 36340 fix for main + `_ + +- `PR 37816 fix for 2.6 + `_ + CVE-2021-3581 ------------- -Under embargo until 2021/09/04 +HCI data not properly checked leads to memory overflow in the Bluetooth stack + +In the process of setting SCAN_RSP through the HCI command, the Zephyr +Bluetooth protocol stack did not effectively check the length of the +incoming HCI data. Causes memory overflow, and then the data in the +memory is overwritten, and may even cause arbitrary code execution. + +This has been fixed in main for v2.6.0 + +- `CVE-2021-3581 `_ + +- `Zephyr project bug tracker GHSA-8q65-5gqf-fmw5 + `_ + +- `PR 35935 fix for main + `_ + +- `PR 35984 fix for 2.5 + `_ + +- `PR 35985 fix for 2.4 + `_ + +- `PR 35985 fix for 1.14 + `_ + +CVE-2021-3625 +------------- + +Buffer overflow in Zephyr USB DFU DNLOAD + +This has been fixed in main for v2.6.0 + +- `CVE-2021-3625 `_ + +- `Zephyr project bug tracker GHSA-c3gr-hgvr-f363 + `_ + +- `PR 36694 fix for main + `_ diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index f5423ac32f04..ce280174dd2d 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -49,8 +49,8 @@ add_subdirectory_ifdef(CONFIG_PM_CPU_OPS pm_cpu_ops) add_subdirectory_ifdef(CONFIG_FLASH_HAS_DRIVER_ENABLED flash) add_subdirectory_ifdef(CONFIG_SERIAL_HAS_DRIVER serial) -add_subdirectory_ifdef(CONFIG_BT bluetooth) -add_subdirectory_ifdef(CONFIG_NETWORKING net) +add_subdirectory_ifdef(CONFIG_BT_DRIVERS bluetooth) +add_subdirectory_ifdef(CONFIG_NET_DRIVERS net) add_subdirectory_ifdef(CONFIG_NET_L2_ETHERNET ethernet) add_subdirectory_ifdef(CONFIG_ENTROPY_HAS_DRIVER entropy) add_subdirectory_ifdef(CONFIG_SYS_CLOCK_EXISTS timer) diff --git a/drivers/adc/adc_stm32.c b/drivers/adc/adc_stm32.c index d79b2de86b20..50bd687ef370 100644 --- a/drivers/adc/adc_stm32.c +++ b/drivers/adc/adc_stm32.c @@ -409,18 +409,10 @@ static int start_read(const struct device *dev, return err; } -#if defined(CONFIG_SOC_SERIES_STM32G0X) || \ - defined(CONFIG_SOC_SERIES_STM32G4X) || \ - defined(CONFIG_SOC_SERIES_STM32H7X) || \ - defined(CONFIG_SOC_SERIES_STM32L0X) || \ - defined(CONFIG_SOC_SERIES_STM32L4X) || \ - defined(CONFIG_SOC_SERIES_STM32L5X) || \ - defined(CONFIG_SOC_SERIES_STM32WBX) || \ - defined(CONFIG_SOC_SERIES_STM32WLX) +#if defined(CONFIG_SOC_SERIES_STM32G0X) /* * Errata: Writing ADC_CFGR1 register while ADEN bit is set * resets RES[1:0] bitfield. We need to disable and enable adc. - * On all those stm32 devices it is allowed to write these bits only when ADEN = 0. */ if (LL_ADC_IsEnabled(adc) == 1UL) { LL_ADC_Disable(adc); @@ -436,6 +428,15 @@ static int start_read(const struct device *dev, LL_ADC_SetResolution(adc, resolution); #endif +#ifdef CONFIG_SOC_SERIES_STM32L0X + /* + * setting OVS bits is conditioned to ADC state: ADC must be disabled + * or enabled without conversion on going : disable it, it will stop + */ + LL_ADC_Disable(adc); + while (LL_ADC_IsEnabled(adc) == 1UL) { + } +#endif /* CONFIG_SOC_SERIES_STM32L0X */ #if defined(CONFIG_SOC_SERIES_STM32G0X) || \ defined(CONFIG_SOC_SERIES_STM32G4X) || \ defined(CONFIG_SOC_SERIES_STM32H7X) || \ @@ -444,13 +445,7 @@ static int start_read(const struct device *dev, defined(CONFIG_SOC_SERIES_STM32L5X) || \ defined(CONFIG_SOC_SERIES_STM32WBX) || \ defined(CONFIG_SOC_SERIES_STM32WLX) - /* - * setting OVS bits is conditioned to ADC state: ADC must be disabled - * or enabled without conversion on going : disable it, it will stop - */ - LL_ADC_Disable(adc); - while (LL_ADC_IsEnabled(adc) == 1UL) { - } + switch (sequence->oversampling) { case 0: LL_ADC_SetOverSamplingScope(adc, LL_ADC_OVS_DISABLE); diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index edb50e29572a..b68f20ec2588 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -9,9 +9,13 @@ # Controller support is an HCI driver in itself, so these HCI driver # options are only applicable if controller support hasn't been enabled. -menu "Bluetooth Drivers" +menuconfig BT_DRIVERS + bool "Bluetooth Drivers" + default y depends on BT && !BT_CTLR +if BT_DRIVERS + if BT_HCI source "drivers/bluetooth/hci/Kconfig" endif @@ -20,4 +24,4 @@ if BT_CUSTOM # Insert here any custom (non-HCI) offload drives endif -endmenu +endif # BT_DRIVERS diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index c9ea0ede759c..d3315bd6eea9 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -25,6 +25,7 @@ config BT_H5 bool "H:5 UART [EXPERIMENTAL]" select UART_INTERRUPT_DRIVEN select BT_UART + select EXPERIMENTAL depends on SERIAL help Bluetooth three-wire (H:5) UART driver. Implementation of HCI diff --git a/drivers/can/Kconfig.net b/drivers/can/Kconfig.net index 0c5220630e03..080ffa680cfa 100644 --- a/drivers/can/Kconfig.net +++ b/drivers/can/Kconfig.net @@ -5,6 +5,7 @@ config CAN_NET bool "Enable 6loCAN network interface [EXPERIMENTAL]" + select EXPERIMENTAL help Enable IPv6 Networking over can (6loCAN) diff --git a/drivers/console/Kconfig b/drivers/console/Kconfig index b21e14f3de4d..c21fd94ee044 100644 --- a/drivers/console/Kconfig +++ b/drivers/console/Kconfig @@ -41,7 +41,6 @@ config UART_CONSOLE config UART_CONSOLE_INIT_PRIORITY int "Init priority" - default 95 if USB_UART_CONSOLE default 60 depends on UART_CONSOLE help @@ -89,15 +88,6 @@ config UART_CONSOLE_INPUT_EXPIRED_TIMEOUT Fixed amount of time which unit is milliseconds to keep the UART console in use flag true. -config USB_UART_CONSOLE - bool "Use USB port for console outputs" - select UART_CONSOLE - select USB_CDC_ACM - help - Enable this option to use the USB CDC ACM class for console. - As for the console driver, this option only changes the initialization - level. - config RAM_CONSOLE bool "Use RAM console" select CONSOLE_HAS_DRIVER @@ -328,6 +318,7 @@ config UART_MUX bool "Enable UART muxing (GSM 07.10) support [EXPERIMENTAL]" depends on SERIAL_SUPPORT_INTERRUPT && GSM_MUX select UART_INTERRUPT_DRIVEN + select EXPERIMENTAL help Enable this option to create UART muxer that run over a physical UART. The GSM 07.10 muxing protocol is used to separate the data diff --git a/drivers/console/uart_console.c b/drivers/console/uart_console.c index 5c105857d0f4..7462f3750734 100644 --- a/drivers/console/uart_console.c +++ b/drivers/console/uart_console.c @@ -609,9 +609,7 @@ static int uart_console_init(const struct device *arg) /* UART console initializes after the UART device itself */ SYS_INIT(uart_console_init, -#if defined(CONFIG_USB_UART_CONSOLE) - APPLICATION, -#elif defined(CONFIG_EARLY_CONSOLE) +#if defined(CONFIG_EARLY_CONSOLE) PRE_KERNEL_1, #else POST_KERNEL, diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index ea5e3538b8b2..5d6e5e5e670b 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -8,6 +8,7 @@ # menuconfig CRYPTO bool "Crypto Drivers [EXPERIMENTAL]" + select EXPERIMENTAL if CRYPTO @@ -29,6 +30,7 @@ config CRYPTO_TINYCRYPT_SHIM select TINYCRYPT_AES_CTR select TINYCRYPT_AES_CCM select TINYCRYPT_AES_CMAC + select EXPERIMENTAL help Enable TinyCrypt shim layer compliant with crypto APIs. @@ -51,6 +53,7 @@ config CRYPTO_MBEDTLS_SHIM bool "Enable mbedTLS shim driver [EXPERIMENTAL]" select MBEDTLS select MBEDTLS_ENABLE_HEAP + select EXPERIMENTAL help Enable mbedTLS shim layer compliant with crypto APIs. You will need to fill in a relevant value to CONFIG_MBEDTLS_HEAP_SIZE. diff --git a/drivers/ethernet/CMakeLists.txt b/drivers/ethernet/CMakeLists.txt index c50e75516780..0db2724bfd89 100644 --- a/drivers/ethernet/CMakeLists.txt +++ b/drivers/ethernet/CMakeLists.txt @@ -26,16 +26,12 @@ zephyr_library_sources_ifdef(CONFIG_ETH_SAM_GMAC eth_sam_gmac.c) zephyr_library_sources_ifdef(CONFIG_DSA_KSZ8XXX dsa_ksz8xxx.c) if(CONFIG_ETH_NATIVE_POSIX) - zephyr_library_named(drivers__ethernet__native_posix) - zephyr_library_compile_definitions( - NO_POSIX_CHEATS - _BSD_SOURCE - _DEFAULT_SOURCE - ) - zephyr_library_sources( - eth_native_posix.c - eth_native_posix_adapt.c - ) + set(native_posix_source_files eth_native_posix.c eth_native_posix_adapt.c) + set_source_files_properties(${native_posix_source_files} + PROPERTIES COMPILE_DEFINITIONS + "NO_POSIX_CHEATS;_BSD_SOURCE;_DEFAULT_SOURCE" + ) + zephyr_library_sources(${native_posix_source_files}) endif() add_subdirectory(phy) diff --git a/drivers/ethernet/Kconfig.e1000 b/drivers/ethernet/Kconfig.e1000 index 89b15f4ad552..5ac419080222 100644 --- a/drivers/ethernet/Kconfig.e1000 +++ b/drivers/ethernet/Kconfig.e1000 @@ -27,6 +27,7 @@ config ETH_E1000_VERBOSE_DEBUG config ETH_E1000_PTP_CLOCK bool "Enable PTP clock driver support [EXPERIMENTAL]" depends on PTP_CLOCK + select EXPERIMENTAL default y help Enable PTP clock support. This is still a dummy that is only used diff --git a/drivers/ethernet/phy/CMakeLists.txt b/drivers/ethernet/phy/CMakeLists.txt index 57f312a8efa1..2592f9d4778e 100644 --- a/drivers/ethernet/phy/CMakeLists.txt +++ b/drivers/ethernet/phy/CMakeLists.txt @@ -1,5 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() - zephyr_library_sources_ifdef(CONFIG_PHY_GENERIC_MII phy_mii.c) diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index f6833430cb66..79f477c1fb27 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,6 +37,18 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_ARM_NONSECURE_FIRMWARE +#if CONFIG_SPM +#include +#elif CONFIG_BUILD_WITH_TFM +#include +#include +#endif /* CONFIG_SPM */ +#if USE_PARTITION_MANAGER +#include +#endif /* USE_PARTITION_MANAGER */ +#endif /* CONFIG_ARM_NONSECURE_FIRMWARE */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -146,6 +158,25 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } +#if CONFIG_ARM_NONSECURE_FIRMWARE && USE_PARTITION_MANAGER + if ((addr < PM_APP_ADDRESS) || (addr > (PM_APP_ADDRESS + PM_APP_SIZE))) { +#if CONFIG_SPM && CONFIG_SPM_SECURE_SERVICES + return spm_request_read(data, addr, len); +#elif CONFIG_BUILD_WITH_TFM + uint32_t err = 0; + enum tfm_platform_err_t plt_err; + + plt_err = tfm_platform_mem_read(&data, addr, len, &err); + if (plt_err != TFM_PLATFORM_ERR_SUCCESS || err != 0) { + LOG_ERR("tfm_..._mem_read failed: plt_err: 0x%x," + "err: 0x%x\n", plt_err, err); + return -EINVAL; + } + return 0; +#endif + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/drivers/gpio/Kconfig.emul b/drivers/gpio/Kconfig.emul index 7d8548bb6a5a..3b596c251d64 100644 --- a/drivers/gpio/Kconfig.emul +++ b/drivers/gpio/Kconfig.emul @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 config GPIO_EMUL - bool "[EXPERIMENTAL] Emulated GPIO driver" + bool "Emulated GPIO driver" help Enable the emulated GPIO driver. Mainly used for testing, this driver allows for an arbitrary number of emulated GPIO controllers diff --git a/drivers/gpio/gpio_stm32.c b/drivers/gpio/gpio_stm32.c index 40e53936dca6..9e325c18f6aa 100644 --- a/drivers/gpio/gpio_stm32.c +++ b/drivers/gpio/gpio_stm32.c @@ -692,7 +692,8 @@ GPIO_DEVICE_INIT_STM32(k, K); #endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(gpiok), okay) */ -#if defined(CONFIG_SOC_SERIES_STM32F1X) +#if defined(CONFIG_SOC_SERIES_STM32F1X) && \ + !defined(CONFIG_GPIO_STM32_SWJ_ENABLE) static int gpio_stm32_afio_init(const struct device *dev) { @@ -716,6 +717,6 @@ static int gpio_stm32_afio_init(const struct device *dev) return 0; } -SYS_DEVICE_DEFINE("gpio_stm32_afio", gpio_stm32_afio_init, NULL, PRE_KERNEL_2, 0); +SYS_DEVICE_DEFINE("gpio_stm32_afio", gpio_stm32_afio_init, NULL, PRE_KERNEL_1, 0); -#endif /* CONFIG_SOC_SERIES_STM32F1X */ +#endif /* CONFIG_SOC_SERIES_STM32F1X && !CONFIG_GPIO_STM32_SWJ_ENABLE */ diff --git a/drivers/i2c/i2c_ite_it8xxx2.c b/drivers/i2c/i2c_ite_it8xxx2.c index 5d3acc026cb5..f2b098ca77fe 100644 --- a/drivers/i2c/i2c_ite_it8xxx2.c +++ b/drivers/i2c/i2c_ite_it8xxx2.c @@ -164,6 +164,33 @@ static const struct i2c_pin i2c_pin_regs[] = { { &GPDMRA, &GPDMRA, 0x10, 0x20}, }; +static int i2c_parsing_return_value(const struct device *dev) +{ + struct i2c_it8xxx2_data *data = DEV_DATA(dev); + const struct i2c_it8xxx2_config *config = DEV_CFG(dev); + + if (!data->err) + return 0; + + /* Connection timed out */ + if (data->err == ETIMEDOUT) + return -ETIMEDOUT; + + if (config->port < I2C_STANDARD_PORT_COUNT) { + /* The device does not respond ACK */ + if (data->err == HOSTA_NACK) + return -ENXIO; + else + return -EIO; + } else { + /* The device does not respond ACK */ + if (data->err == E_HOSTA_ACK) + return -ENXIO; + else + return -EIO; + } +} + static int i2c_get_line_levels(const struct device *dev) { const struct i2c_it8xxx2_config *config = DEV_CFG(dev); @@ -835,7 +862,7 @@ static int i2c_it8xxx2_transfer(const struct device *dev, struct i2c_msg *msgs, /* Unlock mutex of i2c controller */ k_mutex_unlock(&data->mutex); - return data->err; + return i2c_parsing_return_value(dev); } static void i2c_it8xxx2_isr(void *arg) diff --git a/drivers/i2s/i2s_nrfx.c b/drivers/i2s/i2s_nrfx.c index c4f1e57d30a9..1073c6c94bfd 100644 --- a/drivers/i2s/i2s_nrfx.c +++ b/drivers/i2s/i2s_nrfx.c @@ -27,12 +27,12 @@ struct i2s_nrfx_drv_data { const uint32_t *last_tx_buffer; enum i2s_state state; enum i2s_dir active_dir; + bool stop; /* stop after the current (TX or RX) block */ + bool discard_rx; /* discard further RX blocks */ + volatile bool next_tx_buffer_needed; bool tx_configured : 1; bool rx_configured : 1; - bool stop : 1; /* stop after the current (TX or RX) block */ - bool discard_rx : 1; /* discard further RX blocks */ bool request_clock : 1; - volatile bool next_tx_buffer_needed; }; struct i2s_nrfx_drv_cfg { @@ -81,6 +81,7 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, uint32_t best_diff = UINT32_MAX; uint8_t r, best_r = 0; nrf_i2s_mck_t best_mck_cfg = 0; + uint32_t best_mck = 0; for (r = 0; r < ARRAY_SIZE(ratios); ++r) { /* Only multiples of the frame width can be used as ratios. */ @@ -110,6 +111,7 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, if (diff < best_diff) { best_mck_cfg = mck_factor * 4096; + best_mck = actual_mck; best_r = r; /* Stop if an exact match is found. */ if (diff == 0) { @@ -150,6 +152,7 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, if (diff < best_diff) { best_mck_cfg = dividers[d].divider_enum; + best_mck = mck_freq; best_r = r; /* Stop if an exact match is found. */ if (diff == 0) { @@ -173,6 +176,8 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, config->mck_setup = best_mck_cfg; config->ratio = ratios[best_r].ratio_enum; + LOG_INF("I2S MCK frequency: %u, actual PCM rate: %u", + best_mck, best_mck / ratios[best_r].ratio_val); } static bool get_next_tx_buffer(struct i2s_nrfx_drv_data *drv_data, @@ -465,9 +470,7 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir, return -EINVAL; } - if (i2s_cfg->channels == 2 || - (i2s_cfg->format & I2S_FMT_DATA_FORMAT_MASK) - == I2S_FMT_DATA_FORMAT_I2S) { + if (i2s_cfg->channels == 2) { nrfx_cfg.channels = NRF_I2S_CHANNELS_STEREO; } else if (i2s_cfg->channels == 1) { nrfx_cfg.channels = NRF_I2S_CHANNELS_LEFT; @@ -878,8 +881,8 @@ static const struct i2s_driver_api i2s_nrf_drv_api = { #define I2S_CLK_SRC(idx) DT_STRING_TOKEN(I2S(idx), clock_source) #define I2S_NRFX_DEVICE(idx) \ - static void *tx_msgs[CONFIG_I2S_NRFX_TX_BLOCK_COUNT]; \ - static void *rx_msgs[CONFIG_I2S_NRFX_RX_BLOCK_COUNT]; \ + static void *tx_msgs##idx[CONFIG_I2S_NRFX_TX_BLOCK_COUNT]; \ + static void *rx_msgs##idx[CONFIG_I2S_NRFX_RX_BLOCK_COUNT]; \ static struct i2s_nrfx_drv_data i2s_nrfx_data##idx = { \ .state = I2S_STATE_READY, \ }; \ @@ -889,11 +892,11 @@ static const struct i2s_driver_api i2s_nrf_drv_api = { nrfx_isr, nrfx_i2s_irq_handler, 0); \ irq_enable(DT_IRQN(I2S(idx))); \ k_msgq_init(&i2s_nrfx_data##idx.tx_queue, \ - (char *)tx_msgs, sizeof(void *), \ - CONFIG_I2S_NRFX_TX_BLOCK_COUNT); \ + (char *)tx_msgs##idx, sizeof(void *), \ + ARRAY_SIZE(tx_msgs##idx)); \ k_msgq_init(&i2s_nrfx_data##idx.rx_queue, \ - (char *)rx_msgs, sizeof(void *), \ - CONFIG_I2S_NRFX_RX_BLOCK_COUNT); \ + (char *)rx_msgs##idx, sizeof(void *), \ + ARRAY_SIZE(rx_msgs##idx)); \ init_clock_manager(dev); \ return 0; \ } \ diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig index 6843c98ad39b..d456e99e87e6 100644 --- a/drivers/ieee802154/Kconfig +++ b/drivers/ieee802154/Kconfig @@ -8,7 +8,7 @@ # menuconfig IEEE802154 bool "IEEE 802.15.4 drivers options" - default y if NET_L2_IEEE802154 || NET_L2_OPENTHREAD + default y if NET_L2_IEEE802154 || NET_L2_OPENTHREAD || NET_L2_ZIGBEE if IEEE802154 diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index 0ce293fb401f..4856c3a37b65 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -39,6 +39,14 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include +#if defined(CONFIG_SOC_NRF5340_CPUAPP) && defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#if defined(CONFIG_SPM_SERVICE_READ) +#include +#elif defined(CONFIG_BUILD_WITH_TFM) +#include +#endif +#endif + #include "ieee802154_nrf5.h" #include "nrf_802154.h" #include "nrf_802154_const.h" @@ -61,17 +69,30 @@ static struct nrf5_802154_data nrf5_data; #define DRX_SLOT_PH 0 /* Placeholder delayed reception window ID */ #define DRX_SLOT_RX 1 /* Actual delayed reception window ID */ -#define PH_DURATION 10 /* Duration of the placeholder window, in microseconds */ +#define PH_DURATION 10 /* Duration of the placeholder window, in microseconds */ +/* When scheduling the actual delayed reception window an adjustment of + * 800 us is required to match the CSL tranmission timing for unknown + * reasons. This is a temporary workaround until the root cause is found. + */ +#define DRX_ADJUST 800 #if defined(CONFIG_IEEE802154_NRF5_UICR_EUI64_ENABLE) #if defined(CONFIG_SOC_NRF5340_CPUAPP) +#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#define EUI64_ADDR (NRF_UICR_S->OTP) +#else #define EUI64_ADDR (NRF_UICR->OTP) +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ #else #define EUI64_ADDR (NRF_UICR->CUSTOMER) #endif /* CONFIG_SOC_NRF5340_CPUAPP */ #else #if defined(CONFIG_SOC_NRF5340_CPUAPP) || defined(CONFIG_SOC_NRF5340_CPUNET) +#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#define EUI64_ADDR (NRF_FICR_S->INFO.DEVICEID) +#else #define EUI64_ADDR (NRF_FICR->INFO.DEVICEID) +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ #else #define EUI64_ADDR (NRF_FICR->DEVICEID) #endif /* CONFIG_SOC_NRF5340_CPUAPP || CONFIG_SOC_NRF5340_CPUNET */ @@ -110,9 +131,32 @@ static void nrf5_get_eui64(uint8_t *mac) mac[index++] = IEEE802154_NRF5_VENDOR_OUI & 0xff; #endif -#if defined(CONFIG_SOC_NRF5340_CPUAPP) && \ - defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) -#error Accessing EUI64 on the non-secure mode is not supported at the moment +#if defined(CONFIG_SOC_NRF5340_CPUAPP) && defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) + int ret = -EPERM; +#if defined(CONFIG_SPM_SERVICE_READ) + ret = spm_request_read(&factoryAddress, + (uint32_t)&EUI64_ADDR[EUI64_ADDR_HIGH], + sizeof(factoryAddress)); +#elif defined(CONFIG_BUILD_WITH_TFM) + enum tfm_platform_err_t tfmError; + uint32_t tfmServiceError; + + tfmError = tfm_platform_mem_read(&factoryAddress, (uint32_t)&EUI64_ADDR[EUI64_ADDR_HIGH], + sizeof(factoryAddress), &tfmServiceError); + + if (tfmError == TFM_PLATFORM_ERR_SUCCESS && tfmServiceError == 0) { + ret = 0; + } else if (tfmError == TFM_PLATFORM_ERR_INVALID_PARAM) { + ret = -EINVAL; + } else if (tfmError == TFM_PLATFORM_ERR_NOT_SUPPORTED) { + ret = -ENOTSUP; + } +#endif + if (ret != 0) { + LOG_ERR("Unable to read EUI64 from the secure zone: %d", ret); + LOG_ERR("Setting EUI64 to 0"); + factoryAddress = 0ULL; + } #else /* Use device identifier assigned during the production. */ factoryAddress = (uint64_t)EUI64_ADDR[EUI64_ADDR_HIGH] << 32; @@ -146,7 +190,8 @@ static void nrf5_rx_thread(void *arg1, void *arg2, void *arg3) * automatic CRC handling is enabled or not, respectively. */ if (IS_ENABLED(CONFIG_IEEE802154_RAW_MODE) || - IS_ENABLED(CONFIG_NET_L2_OPENTHREAD)) { + IS_ENABLED(CONFIG_NET_L2_OPENTHREAD) || + IS_ENABLED(CONFIG_NET_L2_ZIGBEE)) { pkt_len = rx_frame->psdu[0]; } else { pkt_len = rx_frame->psdu[0] - NRF5_FCS_LENGTH; @@ -697,36 +742,36 @@ static void nrf5_iface_init(struct net_if *iface) #if defined(CONFIG_NRF_802154_ENCRYPTION) static void nrf5_config_mac_keys(struct ieee802154_key *mac_keys) { - nrf_802154_security_error_t err; - nrf_802154_key_t key; - uint8_t key_id_to_remove; - - __ASSERT(mac_keys, "Invalid argument."); + static nrf_802154_key_id_t stored_key_ids[NRF_802154_SECURITY_KEY_STORAGE_SIZE]; + static uint8_t stored_ids[NRF_802154_SECURITY_KEY_STORAGE_SIZE]; + uint8_t i; - /* Remove old invalid key assuming that its index is first_valid_key_id - 1. - * TODO: This is Thread specific assumption, need to be changed when RD will provided - * API for removing all keys or handling this internally. - */ - key_id_to_remove = mac_keys->key_index == 1 ? 0x80 : mac_keys->key_index - 1; - - key.id.mode = mac_keys->key_id_mode; - key.id.p_key_id = &key_id_to_remove; - - nrf_802154_security_key_remove(&key.id); + for (i = 0; i < NRF_802154_SECURITY_KEY_STORAGE_SIZE && stored_key_ids[i].p_key_id; i++) { + nrf_802154_security_key_remove(&stored_key_ids[i]); + stored_key_ids[i].p_key_id = NULL; + } + i = 0; for (struct ieee802154_key *keys = mac_keys; keys->key_value; keys++) { - key.value.p_cleartext_key = keys->key_value; - key.id.mode = keys->key_id_mode; - key.id.p_key_id = &(keys->key_index); - key.type = NRF_802154_KEY_CLEARTEXT; - key.frame_counter = 0; - key.use_global_frame_counter = !(keys->frame_counter_per_key); - - nrf_802154_security_key_remove(&key.id); - err = nrf_802154_security_key_store(&key); + nrf_802154_key_t key = { + .value.p_cleartext_key = keys->key_value, + .id.mode = keys->key_id_mode, + .id.p_key_id = &(keys->key_index), + .type = NRF_802154_KEY_CLEARTEXT, + .frame_counter = 0, + .use_global_frame_counter = !(keys->frame_counter_per_key), + }; + + nrf_802154_security_error_t err = nrf_802154_security_key_store(&key); __ASSERT(err == NRF_802154_SECURITY_ERROR_NONE || err == NRF_802154_SECURITY_ERROR_ALREADY_PRESENT, "Storing key failed, err: %d", err); + + __ASSERT(i < NRF_802154_SECURITY_KEY_STORAGE_SIZE, "Store buffer is full"); + stored_ids[i] = *key.id.p_key_id; + stored_key_ids[i].mode = key.id.mode; + stored_key_ids[i].p_key_id = &stored_ids[i]; + i++; }; } #endif /* CONFIG_NRF_802154_ENCRYPTION */ @@ -755,7 +800,7 @@ static void nrf5_config_csl_period(uint16_t period) static void nrf5_schedule_rx(uint8_t channel, uint32_t start, uint32_t duration) { - nrf5_receive_at(start, duration, channel, DRX_SLOT_RX); + nrf5_receive_at(start - DRX_ADJUST, duration, channel, DRX_SLOT_RX); /* The placeholder reception window is rescheduled for the next period */ nrf_802154_receive_at_cancel(DRX_SLOT_PH); @@ -888,8 +933,7 @@ static int nrf5_configure(const struct device *dev, /* nRF5 radio driver callbacks */ -void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi, - uint32_t time) +void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi, uint32_t time) { for (uint32_t i = 0; i < ARRAY_SIZE(nrf5_data.rx_frames); i++) { if (nrf5_data.rx_frames[i].psdu != NULL) { @@ -897,13 +941,15 @@ void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi, } nrf5_data.rx_frames[i].psdu = data; - nrf5_data.rx_frames[i].time = time; nrf5_data.rx_frames[i].rssi = power; nrf5_data.rx_frames[i].lqi = lqi; +#if !defined(CONFIG_NRF_802154_SER_HOST) && defined(CONFIG_NET_PKT_TIMESTAMP) + nrf5_data.rx_frames[i].time = nrf_802154_first_symbol_timestamp_get(time, data[0]); +#endif + if (data[ACK_REQUEST_BYTE] & ACK_REQUEST_BIT) { - nrf5_data.rx_frames[i].ack_fpb = - nrf5_data.last_frame_ack_fpb; + nrf5_data.rx_frames[i].ack_fpb = nrf5_data.last_frame_ack_fpb; } else { nrf5_data.rx_frames[i].ack_fpb = false; } @@ -1072,9 +1118,14 @@ static struct ieee802154_radio_api nrf5_radio_api = { #define L2 OPENTHREAD_L2 #define L2_CTX_TYPE NET_L2_GET_CTX_TYPE(OPENTHREAD_L2) #define MTU 1280 +#elif defined(CONFIG_NET_L2_ZIGBEE) +#define L2 ZIGBEE_L2 +#define L2_CTX_TYPE NET_L2_GET_CTX_TYPE(ZIGBEE_L2) +#define MTU 127 #endif -#if defined(CONFIG_NET_L2_IEEE802154) || defined(CONFIG_NET_L2_OPENTHREAD) +#if defined(CONFIG_NET_L2_IEEE802154) || defined(CONFIG_NET_L2_OPENTHREAD) \ + || defined(CONFIG_NET_L2_ZIGBEE) NET_DEVICE_INIT(nrf5_154_radio, CONFIG_IEEE802154_NRF5_DRV_NAME, nrf5_init, NULL, &nrf5_data, &nrf5_radio_cfg, CONFIG_IEEE802154_NRF5_INIT_PRIO, diff --git a/drivers/led/led_pwm.c b/drivers/led/led_pwm.c index 7ca6afeb16b2..f6c2e75a4f37 100644 --- a/drivers/led/led_pwm.c +++ b/drivers/led/led_pwm.c @@ -140,7 +140,7 @@ static int led_pwm_pm_control(const struct device *dev, } err = pm_device_state_set(led_pwm->dev, state); - if (err) { + if (err && (err != -EALREADY)) { LOG_ERR("Cannot switch PWM %p power state", led_pwm->dev); } } diff --git a/drivers/lora/Kconfig b/drivers/lora/Kconfig index 3218c82a7ec6..6eaa8f1fad22 100644 --- a/drivers/lora/Kconfig +++ b/drivers/lora/Kconfig @@ -10,6 +10,7 @@ menuconfig LORA bool "LoRa support [EXPERIMENTAL]" select REQUIRES_FULL_LIBC select POLL + select EXPERIMENTAL help Include LoRa drivers in the system configuration. diff --git a/drivers/memc/Kconfig b/drivers/memc/Kconfig index cf143e9c26c2..f22dc4e9f295 100644 --- a/drivers/memc/Kconfig +++ b/drivers/memc/Kconfig @@ -5,6 +5,7 @@ menuconfig MEMC bool "Memory controllers [EXPERIMENTAL]" + select EXPERIMENTAL help Add support for memory controllers diff --git a/drivers/modem/Kconfig b/drivers/modem/Kconfig index 2cabac14b10c..1a851d64f478 100644 --- a/drivers/modem/Kconfig +++ b/drivers/modem/Kconfig @@ -38,6 +38,7 @@ config MODEM_RECEIVER_MAX_CONTEXTS config MODEM_CONTEXT bool "Modem context helper driver [EXPERIMENTAL]" + select EXPERIMENTAL help This driver allows modem drivers to communicate with an interface using custom defined protocols. Driver doesn't inspect received data diff --git a/drivers/modem/Kconfig.quectel-bg9x b/drivers/modem/Kconfig.quectel-bg9x index 70f1f74b9e6a..f22f3f4fb761 100644 --- a/drivers/modem/Kconfig.quectel-bg9x +++ b/drivers/modem/Kconfig.quectel-bg9x @@ -10,7 +10,6 @@ config MODEM_QUECTEL_BG9X select MODEM_IFACE_UART select MODEM_SOCKET select NET_SOCKETS_OFFLOAD - imply GPIO help Choose this setting to enable quectel BG9x LTE-CatM1/NB-IoT modem driver. diff --git a/drivers/modem/Kconfig.ublox-sara-r4 b/drivers/modem/Kconfig.ublox-sara-r4 index 1a14aa111aab..6b925585c8cf 100644 --- a/drivers/modem/Kconfig.ublox-sara-r4 +++ b/drivers/modem/Kconfig.ublox-sara-r4 @@ -11,7 +11,6 @@ config MODEM_UBLOX_SARA select MODEM_SOCKET select NET_OFFLOAD select NET_SOCKETS_OFFLOAD - imply GPIO help Choose this setting to enable u-blox SARA-R4 LTE-CatM1/NB-IoT modem driver. diff --git a/drivers/modem/quectel-bg9x.c b/drivers/modem/quectel-bg9x.c index e2b32ce63435..5ae52e18c405 100644 --- a/drivers/modem/quectel-bg9x.c +++ b/drivers/modem/quectel-bg9x.c @@ -1203,4 +1203,5 @@ NET_DEVICE_DT_INST_OFFLOAD_DEFINE(0, modem_init, NULL, &api_funcs, MDM_MAX_DATA_LENGTH); /* Register NET sockets. */ -NET_SOCKET_REGISTER(quectel_bg9x, AF_UNSPEC, offload_is_supported, offload_socket); +NET_SOCKET_REGISTER(quectel_bg9x, NET_SOCKET_DEFAULT_PRIO, AF_UNSPEC, + offload_is_supported, offload_socket); diff --git a/drivers/modem/ublox-sara-r4.c b/drivers/modem/ublox-sara-r4.c index 35b376a033fc..60eb398ba6a3 100644 --- a/drivers/modem/ublox-sara-r4.c +++ b/drivers/modem/ublox-sara-r4.c @@ -1956,8 +1956,8 @@ static bool offload_is_supported(int family, int type, int proto) return true; } -NET_SOCKET_REGISTER(ublox_sara_r4, AF_UNSPEC, offload_is_supported, - offload_socket); +NET_SOCKET_REGISTER(ublox_sara_r4, NET_SOCKET_DEFAULT_PRIO, AF_UNSPEC, + offload_is_supported, offload_socket); #if defined(CONFIG_DNS_RESOLVER) /* TODO: This is a bare-bones implementation of DNS handling diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index cd0153c6d2f6..c61bf4612715 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -1,6 +1,11 @@ # Misc network drivers configuration options # SPDX-License-Identifier: Apache-2.0 +menuconfig NET_DRIVERS + bool "Network Drivers" + +if NET_DRIVERS + # # PPP options # @@ -78,6 +83,12 @@ config PPP_CLIENT_CLIENTSERVER This is only necessary if a ppp connection should be established with a Microsoft Windows PC. +config PPP_NET_IF_NO_AUTO_START + bool "Disable PPP interface auto-start" + help + This option allows user to disable autostarting of the PPP interface + immediately after initialization. + module = NET_PPP module-dep = LOG module-str = Log level for ppp driver @@ -90,8 +101,7 @@ endif # NET_PPP # SLIP options # menuconfig SLIP - bool "SLIP driver" - depends on (!QEMU_TARGET || NET_QEMU_SLIP) + bool "SLIP driver" if !QEMU_TARGET depends on NET_NATIVE select UART_PIPE select UART_INTERRUPT_DRIVEN @@ -149,3 +159,5 @@ module-help = Sets log level for network loopback driver. source "subsys/net/Kconfig.template.log_config.net" endif + +endif # NET_DRIVERS diff --git a/drivers/net/ppp.c b/drivers/net/ppp.c index f38bc104abb7..eeeee459130d 100644 --- a/drivers/net/ppp.c +++ b/drivers/net/ppp.c @@ -781,10 +781,12 @@ static void ppp_iface_init(struct net_if *iface) memset(ppp->buf, 0, sizeof(ppp->buf)); - /* If we have a GSM modem with PPP support, then do not start the - * interface automatically but only after the modem is ready. + /* If we have a GSM modem with PPP support or interface autostart is disabled + * from Kconfig, then do not start the interface automatically but only + * after the modem is ready or when manually started. */ - if (IS_ENABLED(CONFIG_MODEM_GSM_PPP)) { + if (IS_ENABLED(CONFIG_MODEM_GSM_PPP) || + IS_ENABLED(CONFIG_PPP_NET_IF_NO_AUTO_START)) { net_if_flag_set(iface, NET_IF_NO_AUTO_START); } } diff --git a/drivers/pinmux/CMakeLists.txt b/drivers/pinmux/CMakeLists.txt index b8c7fd532bd8..7961fca8f429 100644 --- a/drivers/pinmux/CMakeLists.txt +++ b/drivers/pinmux/CMakeLists.txt @@ -1,19 +1,17 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() - # Board initialization -zephyr_library_sources_ifdef(CONFIG_PINMUX_CC13XX_CC26XX pinmux_cc13xx_cc26xx.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_ESP32 pinmux_esp32.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_HSDK pinmux_hsdk.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_INTEL_S1000 pinmux_intel_s1000.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_ITE_IT8XXX2 pinmux_ite_it8xxx2.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_LPC11U6X pinmux_lpc11u6x.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_MCUX pinmux_mcux.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_MCUX_LPC pinmux_mcux_lpc.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_RV32M1 pinmux_rv32m1.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_SAM0 pinmux_sam0.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_SIFIVE pinmux_sifive.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_STM32 pinmux_stm32.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_TELINK_B91 pinmux_b91.c) -zephyr_library_sources_ifdef(CONFIG_PINMUX_XEC pinmux_mchp_xec.c) +zephyr_sources_ifdef(CONFIG_PINMUX_TELINK_B91 pinmux_b91.c) +zephyr_sources_ifdef(CONFIG_PINMUX_CC13XX_CC26XX pinmux_cc13xx_cc26xx.c) +zephyr_sources_ifdef(CONFIG_PINMUX_ESP32 pinmux_esp32.c) +zephyr_sources_ifdef(CONFIG_PINMUX_HSDK pinmux_hsdk.c) +zephyr_sources_ifdef(CONFIG_PINMUX_INTEL_S1000 pinmux_intel_s1000.c) +zephyr_sources_ifdef(CONFIG_PINMUX_ITE_IT8XXX2 pinmux_ite_it8xxx2.c) +zephyr_sources_ifdef(CONFIG_PINMUX_LPC11U6X pinmux_lpc11u6x.c) +zephyr_sources_ifdef(CONFIG_PINMUX_MCUX pinmux_mcux.c) +zephyr_sources_ifdef(CONFIG_PINMUX_MCUX_LPC pinmux_mcux_lpc.c) +zephyr_sources_ifdef(CONFIG_PINMUX_RV32M1 pinmux_rv32m1.c) +zephyr_sources_ifdef(CONFIG_PINMUX_SAM0 pinmux_sam0.c) +zephyr_sources_ifdef(CONFIG_PINMUX_SIFIVE pinmux_sifive.c) +zephyr_sources_ifdef(CONFIG_PINMUX_STM32 pinmux_stm32.c) +zephyr_sources_ifdef(CONFIG_PINMUX_XEC pinmux_mchp_xec.c) diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 2aa29ca0ad5c..57f12e7468f1 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -169,10 +169,13 @@ static int pwm_nrfx_pin_set(const struct device *dev, uint32_t pwm, pulse_cycles /= 2; } - /* Check if period_cycle is either matching currently used, or + /* Check if period_cycles is either matching currently used, or * possible to use with our prescaler options. + * Don't do anything if the period length happens to be zero. + * In such case, pulse cycles will be right below limited to 0 + * and this will result in making the channel inactive. */ - if (period_cycles != data->period_cycles) { + if (period_cycles != 0 && period_cycles != data->period_cycles) { int ret = pwm_period_check_and_set(config, data, channel, period_cycles); if (ret) { @@ -268,6 +271,14 @@ static const struct pwm_driver_api pwm_nrfx_drv_api_funcs = { static int pwm_nrfx_init(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; + struct pwm_nrfx_data *data = dev->data; + + for (size_t i = 0; i < ARRAY_SIZE(data->current); i++) { + bool inverted = config->initial_config.output_pins[i] & NRFX_PWM_PIN_INVERTED; + uint16_t value = (inverted)?(PWM_NRFX_CH_VALUE_INVERTED):(PWM_NRFX_CH_VALUE_NORMAL); + + data->current[i] = value; + }; nrfx_err_t result = nrfx_pwm_init(&config->pwm, &config->initial_config, @@ -330,23 +341,12 @@ static int pwm_nrfx_pm_control(const struct device *dev, (PWM_NRFX_CH_PIN(dev_idx, ch_idx) | \ (PWM_NRFX_IS_INVERTED(dev_idx, ch_idx) ? NRFX_PWM_PIN_INVERTED : 0)) -#define PWM_NRFX_DEFAULT_VALUE(dev_idx, ch_idx) \ - (PWM_NRFX_IS_INVERTED(dev_idx, ch_idx) ? \ - PWM_NRFX_CH_VALUE_INVERTED : PWM_NRFX_CH_VALUE_NORMAL) - #define PWM_NRFX_COUNT_MODE(dev_idx) \ (PWM_PROP(dev_idx, center_aligned) ? \ NRF_PWM_MODE_UP_AND_DOWN : NRF_PWM_MODE_UP) #define PWM_NRFX_DEVICE(idx) \ - static struct pwm_nrfx_data pwm_nrfx_##idx##_data = { \ - .current = { \ - PWM_NRFX_DEFAULT_VALUE(idx, 0), \ - PWM_NRFX_DEFAULT_VALUE(idx, 1), \ - PWM_NRFX_DEFAULT_VALUE(idx, 2), \ - PWM_NRFX_DEFAULT_VALUE(idx, 3), \ - } \ - }; \ + static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ static const struct pwm_nrfx_config pwm_nrfx_##idx##config = { \ .pwm = NRFX_PWM_INSTANCE(idx), \ .initial_config = { \ diff --git a/drivers/sensor/fdc2x1x/fdc2x1x.c b/drivers/sensor/fdc2x1x/fdc2x1x.c index c58844342608..cedbb79b39f7 100644 --- a/drivers/sensor/fdc2x1x/fdc2x1x.c +++ b/drivers/sensor/fdc2x1x/fdc2x1x.c @@ -485,7 +485,6 @@ static int fdc2x1x_device_pm_ctrl(const struct device *dev, enum pm_device_action action) { int ret; - struct fdc2x1x_data *data = dev->data; const struct fdc2x1x_config *cfg = dev->config; enum pm_device_state curr_state; @@ -613,7 +612,6 @@ static int fdc2x1x_sample_fetch(const struct device *dev, enum sensor_channel chan) { #ifdef CONFIG_PM_DEVICE - struct fdc2x1x_data *data = dev->data; enum pm_device_state state; (void)pm_device_state_get(dev, &state); diff --git a/drivers/sensor/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/qdec_nrfx/qdec_nrfx.c index b13f119bec44..4f8fc48f48f8 100644 --- a/drivers/sensor/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/qdec_nrfx/qdec_nrfx.c @@ -207,9 +207,11 @@ static int qdec_nrfx_init(const struct device *dev) } #ifdef CONFIG_PM_DEVICE -static int qdec_nrfx_pm_control(struct qdec_nrfx_data *data, +static int qdec_nrfx_pm_control(const struct device *dev, enum pm_device_action action) { + ARG_UNUSED(dev); + switch (action) { case PM_DEVICE_ACTION_RESUME: qdec_nrfx_gpio_ctrl(true); diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 08250244e2b1..b84cabe169fc 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -31,6 +31,12 @@ config SERIAL_SUPPORT_INTERRUPT This is an option to be enabled by individual serial driver to signal that the driver and hardware supports interrupts. +config SERIAL_INIT_PRIORITY + int "Serial init priority" + default KERNEL_INIT_PRIORITY_DEVICE + help + Serial driver device initialization priority. + config UART_USE_RUNTIME_CONFIGURE bool "Enable runtime configuration for UART controllers" default y @@ -47,10 +53,10 @@ config UART_USE_RUNTIME_CONFIGURE applications that do not require runtime UART configuration. config UART_ASYNC_API - bool "Enable new asynchronous UART API [EXPERIMENTAL]" + bool "Enable asynchronous UART API" depends on SERIAL_SUPPORT_ASYNC help - This option enables new asynchronous UART API. + This option enables asynchronous UART API. config UART_INTERRUPT_DRIVEN bool "Enable UART Interrupt support" diff --git a/drivers/serial/leuart_gecko.c b/drivers/serial/leuart_gecko.c index ee877b7f40d1..62d1478d4b4a 100644 --- a/drivers/serial/leuart_gecko.c +++ b/drivers/serial/leuart_gecko.c @@ -354,7 +354,7 @@ static struct leuart_gecko_data leuart_gecko_0_data; DEVICE_DT_INST_DEFINE(0, &leuart_gecko_init, NULL, &leuart_gecko_0_data, &leuart_gecko_0_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &leuart_gecko_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -407,7 +407,7 @@ static struct leuart_gecko_data leuart_gecko_1_data; DEVICE_DT_INST_DEFINE(1, &leuart_gecko_init, NULL, &leuart_gecko_1_data, &leuart_gecko_1_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &leuart_gecko_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/serial_test.c b/drivers/serial/serial_test.c index d70e110e4b6d..13da30d2b063 100644 --- a/drivers/serial/serial_test.c +++ b/drivers/serial/serial_test.c @@ -61,7 +61,7 @@ static int serial_vnd_init(const struct device *dev) #define VND_SERIAL_INIT(n) \ DEVICE_DT_INST_DEFINE(n, &serial_vnd_init, NULL, \ NULL, NULL, POST_KERNEL, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &serial_vnd_api); DT_INST_FOREACH_STATUS_OKAY(VND_SERIAL_INIT) diff --git a/drivers/serial/uart_altera_jtag_hal.c b/drivers/serial/uart_altera_jtag_hal.c index 98eb2b5f231f..79d42b3720ed 100644 --- a/drivers/serial/uart_altera_jtag_hal.c +++ b/drivers/serial/uart_altera_jtag_hal.c @@ -61,5 +61,5 @@ static const struct uart_device_config uart_altera_jtag_dev_cfg_0 = { DEVICE_DT_INST_DEFINE(0, uart_altera_jtag_init, NULL, NULL, &uart_altera_jtag_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_altera_jtag_driver_api); diff --git a/drivers/serial/uart_apbuart.c b/drivers/serial/uart_apbuart.c index 04e85aa31d3f..f74ab6648c36 100644 --- a/drivers/serial/uart_apbuart.c +++ b/drivers/serial/uart_apbuart.c @@ -538,7 +538,7 @@ static const struct uart_driver_api apbuart_driver_api = { &apbuart##index##_data, \ &apbuart##index##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &apbuart_driver_api); DT_INST_FOREACH_STATUS_OKAY(APBUART_INIT) diff --git a/drivers/serial/uart_b91.c b/drivers/serial/uart_b91.c index 8c40d698d9e6..58150d61b2c8 100644 --- a/drivers/serial/uart_b91.c +++ b/drivers/serial/uart_b91.c @@ -558,7 +558,7 @@ static const struct uart_driver_api uart_b91_driver_api = { &uart_b91_data_##n, \ &uart_b91_cfg_##n, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ (void *)&uart_b91_driver_api); \ \ static void uart_b91_irq_connect_##n(void) \ diff --git a/drivers/serial/uart_cc13xx_cc26xx.c b/drivers/serial/uart_cc13xx_cc26xx.c index 50e7aec6fff4..fb5313032dcb 100644 --- a/drivers/serial/uart_cc13xx_cc26xx.c +++ b/drivers/serial/uart_cc13xx_cc26xx.c @@ -539,7 +539,7 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = { uart_cc13xx_cc26xx_init_##n, \ uart_cc13xx_cc26xx_pm_control, \ &uart_cc13xx_cc26xx_data_##n, &uart_cc13xx_cc26xx_config_##n,\ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_cc13xx_cc26xx_driver_api) #ifdef CONFIG_PM_DEVICE diff --git a/drivers/serial/uart_cc32xx.c b/drivers/serial/uart_cc32xx.c index 4a0b278604ed..e84ec87d1c01 100644 --- a/drivers/serial/uart_cc32xx.c +++ b/drivers/serial/uart_cc32xx.c @@ -331,7 +331,7 @@ static struct uart_cc32xx_dev_data_t uart_cc32xx_dev_data_##idx = { \ DEVICE_DT_INST_DEFINE(idx, uart_cc32xx_init, \ NULL, &uart_cc32xx_dev_data_##idx, \ &uart_cc32xx_dev_cfg_##idx, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ (void *)&uart_cc32xx_driver_api); \ DT_INST_FOREACH_STATUS_OKAY(UART_32XX_DEVICE); diff --git a/drivers/serial/uart_cmsdk_apb.c b/drivers/serial/uart_cmsdk_apb.c index b39428840be1..5688351ec602 100644 --- a/drivers/serial/uart_cmsdk_apb.c +++ b/drivers/serial/uart_cmsdk_apb.c @@ -508,7 +508,7 @@ DEVICE_DT_INST_DEFINE(0, NULL, &uart_cmsdk_apb_dev_data_0, &uart_cmsdk_apb_dev_cfg_0, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -573,7 +573,7 @@ DEVICE_DT_INST_DEFINE(1, NULL, &uart_cmsdk_apb_dev_data_1, &uart_cmsdk_apb_dev_cfg_1, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -638,7 +638,7 @@ DEVICE_DT_INST_DEFINE(2, NULL, &uart_cmsdk_apb_dev_data_2, &uart_cmsdk_apb_dev_cfg_2, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -703,7 +703,7 @@ DEVICE_DT_INST_DEFINE(3, NULL, &uart_cmsdk_apb_dev_data_3, &uart_cmsdk_apb_dev_cfg_3, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -768,7 +768,7 @@ DEVICE_DT_INST_DEFINE(4, NULL, &uart_cmsdk_apb_dev_data_4, &uart_cmsdk_apb_dev_cfg_4, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_esp32.c b/drivers/serial/uart_esp32.c index 4d577370f1ce..a734365e2aae 100644 --- a/drivers/serial/uart_esp32.c +++ b/drivers/serial/uart_esp32.c @@ -519,7 +519,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ &uart_esp32_data_##idx, \ &uart_esp32_cfg_port_##idx, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_esp32_api); #if DT_NODE_HAS_STATUS(DT_NODELABEL(uart0), okay) diff --git a/drivers/serial/uart_gecko.c b/drivers/serial/uart_gecko.c index 2ef4c08415ec..3ae77177703b 100644 --- a/drivers/serial/uart_gecko.c +++ b/drivers/serial/uart_gecko.c @@ -549,7 +549,7 @@ static const struct uart_driver_api uart_gecko_driver_api = { DEVICE_DT_INST_DEFINE(idx, &uart_gecko_init, \ NULL, &uart_gecko_data_##idx, \ &uart_gecko_cfg_##idx, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_gecko_driver_api); \ \ \ @@ -607,7 +607,7 @@ DT_INST_FOREACH_STATUS_OKAY(GECKO_UART_INIT) DEVICE_DT_INST_DEFINE(idx, &uart_gecko_init, NULL, \ &usart_gecko_data_##idx, \ &usart_gecko_cfg_##idx, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_gecko_driver_api); \ \ GECKO_USART_IRQ_HANDLER(idx) diff --git a/drivers/serial/uart_imx.c b/drivers/serial/uart_imx.c index 611fdb1939e6..d120d9329698 100644 --- a/drivers/serial/uart_imx.c +++ b/drivers/serial/uart_imx.c @@ -319,7 +319,7 @@ static const struct uart_driver_api uart_imx_driver_api = { DEVICE_DT_INST_DEFINE(n, &uart_imx_init, NULL, \ &imx_uart_##n##_data, &imx_uart_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_imx_driver_api); \ \ UART_IMX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_liteuart.c b/drivers/serial/uart_liteuart.c index 972852d96f80..fc55e2a1843b 100644 --- a/drivers/serial/uart_liteuart.c +++ b/drivers/serial/uart_liteuart.c @@ -321,7 +321,7 @@ DEVICE_DT_INST_DEFINE(0, uart_liteuart_init, NULL, &uart_liteuart_data_0, &uart_liteuart_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_liteuart_driver_api); static int uart_liteuart_init(const struct device *dev) diff --git a/drivers/serial/uart_lpc11u6x.c b/drivers/serial/uart_lpc11u6x.c index f318aac79f71..8bcd5a258777 100644 --- a/drivers/serial/uart_lpc11u6x.c +++ b/drivers/serial/uart_lpc11u6x.c @@ -446,7 +446,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart0), &lpc11u6x_uart0_init, NULL, &uart0_data, &uart0_config, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart0_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -904,7 +904,7 @@ static struct lpc11u6x_uartx_data uart_data_##idx; \ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ &lpc11u6x_uartx_init, NULL, \ &uart_data_##idx, &uart_cfg_##idx, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uartx_api) #if DT_NODE_HAS_STATUS(DT_NODELABEL(uart1), okay) diff --git a/drivers/serial/uart_mchp_xec.c b/drivers/serial/uart_mchp_xec.c index 8affdc764bb2..0f329580ea23 100644 --- a/drivers/serial/uart_mchp_xec.c +++ b/drivers/serial/uart_mchp_xec.c @@ -894,7 +894,7 @@ static const struct uart_driver_api uart_xec_driver_api = { &uart_xec_dev_data_##n, \ &uart_xec_dev_cfg_##n, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_xec_driver_api); \ UART_XEC_IRQ_FUNC_DEFINE(n) diff --git a/drivers/serial/uart_mcux.c b/drivers/serial/uart_mcux.c index 011e85ee2d2d..0e9ca5c09729 100644 --- a/drivers/serial/uart_mcux.c +++ b/drivers/serial/uart_mcux.c @@ -414,7 +414,7 @@ static const struct uart_mcux_config uart_mcux_##n##_config = { \ &uart_mcux_##n##_data, \ &uart_mcux_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_mcux_driver_api); \ \ UART_MCUX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_flexcomm.c b/drivers/serial/uart_mcux_flexcomm.c index fd442e31001f..51d214a1f434 100644 --- a/drivers/serial/uart_mcux_flexcomm.c +++ b/drivers/serial/uart_mcux_flexcomm.c @@ -348,7 +348,7 @@ static const struct mcux_flexcomm_config mcux_flexcomm_##n##_config = { \ &mcux_flexcomm_##n##_data, \ &mcux_flexcomm_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_flexcomm_driver_api); \ \ UART_MCUX_FLEXCOMM_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_iuart.c b/drivers/serial/uart_mcux_iuart.c index b12a4fe66c1c..076fb6e822aa 100644 --- a/drivers/serial/uart_mcux_iuart.c +++ b/drivers/serial/uart_mcux_iuart.c @@ -317,7 +317,7 @@ static const struct mcux_iuart_config mcux_iuart_##n##_config = { \ &mcux_iuart_##n##_data, \ &mcux_iuart_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_iuart_driver_api); \ \ IUART_MCUX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_lpsci.c b/drivers/serial/uart_mcux_lpsci.c index 254e05d6a8d1..cab60ca1f77c 100644 --- a/drivers/serial/uart_mcux_lpsci.c +++ b/drivers/serial/uart_mcux_lpsci.c @@ -321,7 +321,7 @@ static const struct mcux_lpsci_config mcux_lpsci_##n##_config = { \ &mcux_lpsci_##n##_data, \ &mcux_lpsci_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_lpsci_driver_api); \ \ MCUX_LPSCI_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_lpuart.c b/drivers/serial/uart_mcux_lpuart.c index 55018c4cd8c3..34b01effa86c 100644 --- a/drivers/serial/uart_mcux_lpuart.c +++ b/drivers/serial/uart_mcux_lpuart.c @@ -448,7 +448,7 @@ static const struct mcux_lpuart_config mcux_lpuart_##n##_config = { \ &mcux_lpuart_##n##_data, \ &mcux_lpuart_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_lpuart_driver_api); \ \ LPUART_MCUX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_miv.c b/drivers/serial/uart_miv.c index 628351b4a198..fe73de441144 100644 --- a/drivers/serial/uart_miv.c +++ b/drivers/serial/uart_miv.c @@ -409,7 +409,7 @@ static const struct uart_miv_device_config uart_miv_dev_cfg_0 = { DEVICE_DT_INST_DEFINE(0, uart_miv_init, NULL, &uart_miv_data_0, &uart_miv_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_miv_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_msp432p4xx.c b/drivers/serial/uart_msp432p4xx.c index e55c40536e64..f6f4e4f51a0c 100644 --- a/drivers/serial/uart_msp432p4xx.c +++ b/drivers/serial/uart_msp432p4xx.c @@ -362,5 +362,5 @@ DEVICE_DT_INST_DEFINE(0, uart_msp432p4xx_init, NULL, &uart_msp432p4xx_dev_data_0, &uart_msp432p4xx_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_msp432p4xx_driver_api); diff --git a/drivers/serial/uart_native_posix.c b/drivers/serial/uart_native_posix.c index 42e94312b9cc..b4fb43fbba64 100644 --- a/drivers/serial/uart_native_posix.c +++ b/drivers/serial/uart_native_posix.c @@ -367,14 +367,14 @@ static int np_uart_tty_poll_in(const struct device *dev, DEVICE_DT_INST_DEFINE(0, &np_uart_0_init, NULL, (void *)&native_uart_status_0, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &np_uart_driver_api_0); #if defined(CONFIG_UART_NATIVE_POSIX_PORT_1_ENABLE) DEVICE_DT_INST_DEFINE(1, &np_uart_1_init, NULL, (void *)&native_uart_status_1, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &np_uart_driver_api_1); #endif /* CONFIG_UART_NATIVE_POSIX_PORT_1_ENABLE */ diff --git a/drivers/serial/uart_npcx.c b/drivers/serial/uart_npcx.c index 7a8c4b75b4cf..a6448f6505cb 100644 --- a/drivers/serial/uart_npcx.c +++ b/drivers/serial/uart_npcx.c @@ -506,7 +506,7 @@ static inline int uart_npcx_pm_control(const struct device *dev, &uart_npcx_init, \ uart_npcx_pm_control, \ &uart_npcx_data_##inst, &uart_npcx_cfg_##inst, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_npcx_driver_api); \ \ NPCX_UART_IRQ_CONFIG_FUNC(inst) diff --git a/drivers/serial/uart_nrfx_uart.c b/drivers/serial/uart_nrfx_uart.c index 02dba0aae9cc..9b55e0d946e8 100644 --- a/drivers/serial/uart_nrfx_uart.c +++ b/drivers/serial/uart_nrfx_uart.c @@ -1188,5 +1188,5 @@ DEVICE_DT_INST_DEFINE(0, NULL, /* Initialize UART device before UART console. */ PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_nrfx_uart_driver_api); diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 17f79a90a480..ee11bc5a7e7d 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -1839,10 +1839,10 @@ static int uarte_nrfx_pm_control(const struct device *dev, nrf_uarte_enable(uarte); #ifdef CONFIG_UART_ASYNC_API - if (hw_rx_counting_enabled(get_dev_data(dev))) { + if (hw_rx_counting_enabled(data)) { nrfx_timer_enable(&get_dev_config(dev)->timer); } - if (get_dev_data(dev)->async) { + if (data->async) { return 0; } #endif @@ -1864,7 +1864,7 @@ static int uarte_nrfx_pm_control(const struct device *dev, * only sent after each RX if async UART API is used. */ #ifdef CONFIG_UART_ASYNC_API - if (get_dev_data(dev)->async) { + if (data->async) { /* Entering inactive state requires device to be no * active asynchronous calls. */ @@ -1997,7 +1997,7 @@ static int uarte_nrfx_pm_control(const struct device *dev, &uarte_##idx##_data, \ &uarte_##idx##z_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_nrfx_uarte_driver_api) #define UARTE_CONFIG(idx) \ diff --git a/drivers/serial/uart_ns16550.c b/drivers/serial/uart_ns16550.c index 484ed60b3a4c..37da71047630 100644 --- a/drivers/serial/uart_ns16550.c +++ b/drivers/serial/uart_ns16550.c @@ -1090,7 +1090,7 @@ static const struct uart_driver_api uart_ns16550_driver_api = { }; \ DEVICE_DT_INST_DEFINE(n, &uart_ns16550_init, NULL, \ &uart_ns16550_dev_data_##n, &uart_ns16550_dev_cfg_##n, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_ns16550_driver_api); \ UART_NS16550_IRQ_FUNC_DEFINE(n) diff --git a/drivers/serial/uart_numicro.c b/drivers/serial/uart_numicro.c index a522d36ca8c3..40941304fdc1 100644 --- a/drivers/serial/uart_numicro.c +++ b/drivers/serial/uart_numicro.c @@ -207,7 +207,7 @@ DEVICE_DT_INST_DEFINE(index, \ NULL, \ &uart_numicro_data_##index, \ &uart_numicro_cfg_##index, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_numicro_driver_api); DT_INST_FOREACH_STATUS_OKAY(NUMICRO_INIT) diff --git a/drivers/serial/uart_pl011.c b/drivers/serial/uart_pl011.c index ed667a51f831..f6c9e2e28183 100644 --- a/drivers/serial/uart_pl011.c +++ b/drivers/serial/uart_pl011.c @@ -443,7 +443,7 @@ DEVICE_DT_INST_DEFINE(0, NULL, &pl011_data_port_0, &pl011_cfg_port_0, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &pl011_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -506,7 +506,7 @@ DEVICE_DT_INST_DEFINE(1, NULL, &pl011_data_port_1, &pl011_cfg_port_1, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &pl011_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -571,7 +571,7 @@ DEVICE_DT_INST_DEFINE(0, NULL, &pl011_data_sbsa, &pl011_cfg_sbsa, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &pl011_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_psoc6.c b/drivers/serial/uart_psoc6.c index 223376969a8e..bf1be63d7841 100644 --- a/drivers/serial/uart_psoc6.c +++ b/drivers/serial/uart_psoc6.c @@ -361,7 +361,7 @@ static const struct uart_driver_api uart_psoc6_driver_api = { DEVICE_DT_INST_DEFINE(n, &uart_psoc6_init, NULL, \ CY_PSOC6_UART_DECL_DATA_PTR(n), \ &cy_psoc6_uart##n##_config, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_psoc6_driver_api); DT_INST_FOREACH_STATUS_OKAY(CY_PSOC6_UART_INIT) diff --git a/drivers/serial/uart_rcar.c b/drivers/serial/uart_rcar.c index 73f2bcfb9b07..2ffc96ffb959 100644 --- a/drivers/serial/uart_rcar.c +++ b/drivers/serial/uart_rcar.c @@ -583,7 +583,7 @@ static const struct uart_driver_api uart_rcar_driver_api = { NULL, \ &uart_rcar_data_##n, \ &uart_rcar_cfg_##n, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rcar_driver_api); \ \ UART_RCAR_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_rom_esp32c3.c b/drivers/serial/uart_rom_esp32c3.c index d2c807da0c3b..e10930ef8ce2 100644 --- a/drivers/serial/uart_rom_esp32c3.c +++ b/drivers/serial/uart_rom_esp32c3.c @@ -53,7 +53,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ NULL, \ NULL, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rom_esp32c3_api); \ DT_INST_FOREACH_STATUS_OKAY(ESP32C3_ROM_UART_INIT) diff --git a/drivers/serial/uart_rom_esp32s2.c b/drivers/serial/uart_rom_esp32s2.c index 3b8e31485808..f989ca14d212 100644 --- a/drivers/serial/uart_rom_esp32s2.c +++ b/drivers/serial/uart_rom_esp32s2.c @@ -51,7 +51,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ NULL, \ NULL, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rom_esp32s2_api); \ DT_INST_FOREACH_STATUS_OKAY(ESP32S2_ROM_UART_INIT) diff --git a/drivers/serial/uart_rtt.c b/drivers/serial/uart_rtt.c index a214a1c4d260..ea94328d4936 100644 --- a/drivers/serial/uart_rtt.c +++ b/drivers/serial/uart_rtt.c @@ -217,7 +217,7 @@ static const struct uart_driver_api uart_rtt_driver_api = { \ DEVICE_DT_DEFINE(UART_RTT(idx), uart_rtt_init, NULL, \ &uart_rtt##idx##_data, config, \ - PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_2, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rtt_driver_api) #ifdef CONFIG_UART_RTT_0 diff --git a/drivers/serial/uart_rv32m1_lpuart.c b/drivers/serial/uart_rv32m1_lpuart.c index 5f7dc3652d47..0bc20c5fa2eb 100644 --- a/drivers/serial/uart_rv32m1_lpuart.c +++ b/drivers/serial/uart_rv32m1_lpuart.c @@ -334,7 +334,7 @@ static const struct uart_driver_api rv32m1_lpuart_driver_api = { &rv32m1_lpuart_##n##_data, \ &rv32m1_lpuart_##n##_cfg, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &rv32m1_lpuart_driver_api); \ \ RV32M1_LPUART_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_sam.c b/drivers/serial/uart_sam.c index d7250f3bbd3c..46d85184a59f 100644 --- a/drivers/serial/uart_sam.c +++ b/drivers/serial/uart_sam.c @@ -364,7 +364,7 @@ static const struct uart_driver_api uart_sam_driver_api = { DEVICE_DT_INST_DEFINE(n, &uart_sam_init, \ NULL, &uart##n##_sam_data, \ &uart##n##_sam_config, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_sam_driver_api); \ \ UART_SAM_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_sam0.c b/drivers/serial/uart_sam0.c index b39d2b77d229..4ab49265d8a6 100644 --- a/drivers/serial/uart_sam0.c +++ b/drivers/serial/uart_sam0.c @@ -1256,7 +1256,7 @@ UART_SAM0_CONFIG_DEFN(n); \ DEVICE_DT_INST_DEFINE(n, uart_sam0_init, NULL, \ &uart_sam0_data_##n, \ &uart_sam0_config_##n, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_sam0_driver_api); \ UART_SAM0_IRQ_HANDLER(n) diff --git a/drivers/serial/uart_sifive.c b/drivers/serial/uart_sifive.c index f7f20d551c72..75cc9c464f41 100644 --- a/drivers/serial/uart_sifive.c +++ b/drivers/serial/uart_sifive.c @@ -396,7 +396,7 @@ DEVICE_DT_INST_DEFINE(0, uart_sifive_init, NULL, &uart_sifive_data_0, &uart_sifive_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_sifive_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -435,7 +435,7 @@ DEVICE_DT_INST_DEFINE(1, uart_sifive_init, NULL, &uart_sifive_data_1, &uart_sifive_dev_cfg_1, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_sifive_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_stellaris.c b/drivers/serial/uart_stellaris.c index 722aea504dc9..b5c71269e2c3 100644 --- a/drivers/serial/uart_stellaris.c +++ b/drivers/serial/uart_stellaris.c @@ -652,7 +652,7 @@ DEVICE_DT_INST_DEFINE(0, &uart_stellaris_init, NULL, &uart_stellaris_dev_data_0, &uart_stellaris_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_stellaris_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -691,7 +691,7 @@ DEVICE_DT_INST_DEFINE(1, &uart_stellaris_init, NULL, &uart_stellaris_dev_data_1, &uart_stellaris_dev_cfg_1, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_stellaris_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -730,7 +730,7 @@ DEVICE_DT_INST_DEFINE(2, &uart_stellaris_init, NULL, &uart_stellaris_dev_data_2, &uart_stellaris_dev_cfg_2, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_stellaris_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index b0a3ce5f7817..f960987d1a83 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -1605,7 +1605,7 @@ DEVICE_DT_INST_DEFINE(index, \ &uart_stm32_init, \ NULL, \ &uart_stm32_data_##index, &uart_stm32_cfg_##index, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_stm32_driver_api); \ \ STM32_UART_IRQ_HANDLER(index) diff --git a/drivers/serial/uart_xlnx_ps.c b/drivers/serial/uart_xlnx_ps.c index 628ffbe164e5..57349a681b5a 100644 --- a/drivers/serial/uart_xlnx_ps.c +++ b/drivers/serial/uart_xlnx_ps.c @@ -1214,7 +1214,7 @@ DEVICE_DT_INST_DEFINE(port, \ NULL, \ &uart_xlnx_ps_dev_data_##port, \ &uart_xlnx_ps_dev_cfg_##port, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_xlnx_ps_driver_api) #define UART_XLNX_INSTANTIATE(inst) \ diff --git a/drivers/serial/uart_xlnx_uartlite.c b/drivers/serial/uart_xlnx_uartlite.c index 78035acfc6b0..2f8ab3053b7d 100644 --- a/drivers/serial/uart_xlnx_uartlite.c +++ b/drivers/serial/uart_xlnx_uartlite.c @@ -379,7 +379,7 @@ static const struct xlnx_uartlite_config xlnx_uartlite_##n##_config = { \ &xlnx_uartlite_##n##_data, \ &xlnx_uartlite_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &xlnx_uartlite_driver_api); \ \ XLNX_UARTLITE_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_xmc4xxx.c b/drivers/serial/uart_xmc4xxx.c index 6fd52a74811f..991d75b894eb 100644 --- a/drivers/serial/uart_xmc4xxx.c +++ b/drivers/serial/uart_xmc4xxx.c @@ -77,7 +77,7 @@ static const struct uart_device_config xmc4xxx_config_##index = { \ NULL, \ &xmc4xxx_data_##index, \ &xmc4xxx_config_##index, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_xmc4xxx_driver_api); DT_INST_FOREACH_STATUS_OKAY(XMC4XXX_INIT) diff --git a/drivers/serial/usart_sam.c b/drivers/serial/usart_sam.c index 63e4267388ba..2f9f1e871980 100644 --- a/drivers/serial/usart_sam.c +++ b/drivers/serial/usart_sam.c @@ -366,7 +366,7 @@ static const struct uart_driver_api usart_sam_driver_api = { &usart_sam_init, NULL, \ &usart##n##_sam_data, \ &usart##n##_sam_config, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &usart_sam_driver_api); \ \ USART_SAM_CONFIG_FUNC(n) \ diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 1b890fd4f31a..0d1fba4c6f53 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -21,6 +21,7 @@ config SPI_ASYNC config SPI_SLAVE bool "Enable Slave support [EXPERIMENTAL]" + select EXPERIMENTAL help Enables Driver SPI slave operations. Slave support depends on the driver and the hardware it runs on. diff --git a/drivers/timer/Kconfig.stm32_lptim b/drivers/timer/Kconfig.stm32_lptim index 3e1d25d35cd7..1b7255be66c7 100644 --- a/drivers/timer/Kconfig.stm32_lptim +++ b/drivers/timer/Kconfig.stm32_lptim @@ -8,6 +8,7 @@ menuconfig STM32_LPTIM_TIMER depends on "$(dt_nodelabel_enabled,lptim1)" depends on CLOCK_CONTROL && PM select TICKLESS_CAPABLE + select EXPERIMENTAL help This module implements a kernel device driver for the LowPower Timer and provides the standard "system clock driver" interfaces. diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index c403eaee477d..76fb09b28fea 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -12,8 +12,6 @@ #include #include #include -#include - #define EXT_CHAN_COUNT CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT #define CHAN_COUNT (EXT_CHAN_COUNT + 1) @@ -25,7 +23,8 @@ BUILD_ASSERT(CHAN_COUNT <= RTC_CH_COUNT, "Not enough compare channels"); -#define COUNTER_SPAN BIT(24) +#define COUNTER_BIT_WIDTH 24U +#define COUNTER_SPAN BIT(COUNTER_BIT_WIDTH) #define COUNTER_MAX (COUNTER_SPAN - 1U) #define COUNTER_HALF_SPAN (COUNTER_SPAN / 2U) #define CYC_PER_TICK (sys_clock_hw_cycles_per_sec() \ @@ -33,18 +32,25 @@ BUILD_ASSERT(CHAN_COUNT <= RTC_CH_COUNT, "Not enough compare channels"); #define MAX_TICKS ((COUNTER_HALF_SPAN - CYC_PER_TICK) / CYC_PER_TICK) #define MAX_CYCLES (MAX_TICKS * CYC_PER_TICK) -static struct k_spinlock lock; +#define OVERFLOW_RISK_RANGE_END (COUNTER_SPAN / 16) +#define ANCHOR_RANGE_START (COUNTER_SPAN / 8) +#define ANCHOR_RANGE_END (7 * COUNTER_SPAN / 8) +#define TARGET_TIME_INVALID (UINT64_MAX) -static uint32_t last_count; +static volatile uint32_t overflow_cnt; +static volatile uint64_t anchor; +static uint64_t last_count; struct z_nrf_rtc_timer_chan_data { z_nrf_rtc_timer_compare_handler_t callback; void *user_context; + volatile uint64_t target_time; }; static struct z_nrf_rtc_timer_chan_data cc_data[CHAN_COUNT]; static atomic_t int_mask; static atomic_t alloc_mask; +static atomic_t force_isr_mask; static uint32_t counter_sub(uint32_t a, uint32_t b) { @@ -81,9 +87,33 @@ static uint32_t counter(void) return nrf_rtc_counter_get(RTC); } -uint32_t z_nrf_rtc_timer_read(void) +static uint32_t absolute_time_to_cc(uint64_t absolute_time) { - return nrf_rtc_counter_get(RTC); + /* 24 least significant bits represent target CC value */ + return absolute_time & COUNTER_MAX; +} + +static uint32_t full_int_lock(void) +{ + uint32_t mcu_critical_state; + + if (IS_ENABLED(CONFIG_ZERO_LATENCY_IRQS)) { + mcu_critical_state = __get_PRIMASK(); + __disable_irq(); + } else { + mcu_critical_state = irq_lock(); + } + + return mcu_critical_state; +} + +static void full_int_unlock(uint32_t mcu_critical_state) +{ + if (IS_ENABLED(CONFIG_ZERO_LATENCY_IRQS)) { + __set_PRIMASK(mcu_critical_state); + } else { + irq_unlock(mcu_critical_state); + } } uint32_t z_nrf_rtc_timer_compare_evt_address_get(int32_t chan) @@ -92,27 +122,44 @@ uint32_t z_nrf_rtc_timer_compare_evt_address_get(int32_t chan) return nrf_rtc_event_address_get(RTC, nrf_rtc_compare_event_get(chan)); } -bool z_nrf_rtc_timer_compare_int_lock(int32_t chan) +static bool compare_int_lock(int32_t chan) { - __ASSERT_NO_MSG(chan && chan < CHAN_COUNT); - atomic_val_t prev = atomic_and(&int_mask, ~BIT(chan)); nrf_rtc_int_disable(RTC, RTC_CHANNEL_INT_MASK(chan)); + __DMB(); + __ISB(); + return prev & BIT(chan); } -void z_nrf_rtc_timer_compare_int_unlock(int32_t chan, bool key) + +bool z_nrf_rtc_timer_compare_int_lock(int32_t chan) { __ASSERT_NO_MSG(chan && chan < CHAN_COUNT); + return compare_int_lock(chan); +} + +static void compare_int_unlock(int32_t chan, bool key) +{ if (key) { atomic_or(&int_mask, BIT(chan)); nrf_rtc_int_enable(RTC, RTC_CHANNEL_INT_MASK(chan)); + if (atomic_get(&force_isr_mask) & BIT(chan)) { + NVIC_SetPendingIRQ(RTC_IRQn); + } } } +void z_nrf_rtc_timer_compare_int_unlock(int32_t chan, bool key) +{ + __ASSERT_NO_MSG(chan && chan < CHAN_COUNT); + + compare_int_unlock(chan, key); +} + uint32_t z_nrf_rtc_timer_compare_read(int32_t chan) { __ASSERT_NO_MSG(chan < CHAN_COUNT); @@ -120,41 +167,48 @@ uint32_t z_nrf_rtc_timer_compare_read(int32_t chan) return nrf_rtc_cc_get(RTC, chan); } -int z_nrf_rtc_timer_get_ticks(k_timeout_t t) +uint64_t z_nrf_rtc_timer_get_ticks(k_timeout_t t) { - uint32_t curr_count; + uint64_t curr_time; int64_t curr_tick; int64_t result; int64_t abs_ticks; do { - curr_count = counter(); + curr_time = z_nrf_rtc_timer_read(); curr_tick = sys_clock_tick_get(); - } while (curr_count != counter()); + } while (curr_time != z_nrf_rtc_timer_read()); abs_ticks = Z_TICK_ABS(t.ticks); if (abs_ticks < 0) { /* relative timeout */ - return (t.ticks > COUNTER_HALF_SPAN) ? - -EINVAL : ((curr_count + t.ticks) & COUNTER_MAX); + return (t.ticks > COUNTER_SPAN) ? + -EINVAL : (curr_time + t.ticks); } /* absolute timeout */ result = abs_ticks - curr_tick; - if ((result > COUNTER_HALF_SPAN) || - (result < -(int64_t)COUNTER_HALF_SPAN)) { + if (result > COUNTER_SPAN) { return -EINVAL; } - return (curr_count + result) & COUNTER_MAX; + return curr_time + result; } -/* Function safely sets absolute alarm. It assumes that provided value is - * less than COUNTER_HALF_SPAN from now. It detects late setting and also - * handle +1 cycle case. +/** @brief Function safely sets absolute alarm. + * + * It assumes that provided value is less than COUNTER_HALF_SPAN from now. + * It detects late setting and also handle +1 cycle case. + * + * @param[in] chan A channel for which a new CC value is to be set. + * + * @param[in] abs_val An absolute value of CC register to be set. + * + * @returns CC value that was actually set. It is equal to @p abs_val or + * shifted ahead if @p abs_val was too near in the future (+1 case). */ -static void set_absolute_alarm(int32_t chan, uint32_t abs_val) +static uint32_t set_absolute_alarm(int32_t chan, uint32_t abs_val) { uint32_t now; uint32_t now2; @@ -178,7 +232,6 @@ static void set_absolute_alarm(int32_t chan, uint32_t abs_val) k_busy_wait(19); } - /* If requested cc_val is in the past or next tick, set to 2 * ticks from now. RTC may not generate event if CC is set for * 1 tick from now. @@ -201,39 +254,144 @@ static void set_absolute_alarm(int32_t chan, uint32_t abs_val) */ } while ((now2 != now) && (counter_sub(cc_val, now2 + 2) > COUNTER_HALF_SPAN)); + + return cc_val; } -static void compare_set(int32_t chan, uint32_t cc_value, +static int compare_set_nolocks(int32_t chan, uint64_t target_time, z_nrf_rtc_timer_compare_handler_t handler, void *user_data) { + int ret = 0; + uint32_t cc_value = absolute_time_to_cc(target_time); + uint64_t curr_time = z_nrf_rtc_timer_read(); + + if (curr_time < target_time) { + if (target_time - curr_time > COUNTER_SPAN) { + /* Target time is too distant. */ + return -EINVAL; + } + + if (target_time != cc_data[chan].target_time) { + /* Target time is valid and is different than currently set. + * Set CC value. + */ + uint32_t cc_set = set_absolute_alarm(chan, cc_value); + + target_time += counter_sub(cc_set, cc_value); + } + } else { + /* Force ISR handling when exiting from critical section. */ + atomic_or(&force_isr_mask, BIT(chan)); + } + + cc_data[chan].target_time = target_time; cc_data[chan].callback = handler; cc_data[chan].user_context = user_data; - set_absolute_alarm(chan, cc_value); + return ret; +} + +static int compare_set(int32_t chan, uint64_t target_time, + z_nrf_rtc_timer_compare_handler_t handler, + void *user_data) +{ + bool key; + + key = compare_int_lock(chan); + + int ret = compare_set_nolocks(chan, target_time, handler, user_data); + + compare_int_unlock(chan, key); + + return ret; +} + +int z_nrf_rtc_timer_set(int32_t chan, uint64_t target_time, + z_nrf_rtc_timer_compare_handler_t handler, + void *user_data) +{ + __ASSERT_NO_MSG(chan && chan < CHAN_COUNT); + + return compare_set(chan, target_time, handler, user_data); } -void z_nrf_rtc_timer_compare_set(int32_t chan, uint32_t cc_value, - z_nrf_rtc_timer_compare_handler_t handler, - void *user_data) +void z_nrf_rtc_timer_abort(int32_t chan) { __ASSERT_NO_MSG(chan && chan < CHAN_COUNT); - bool key = z_nrf_rtc_timer_compare_int_lock(chan); + bool key = compare_int_lock(chan); + + cc_data[chan].target_time = TARGET_TIME_INVALID; + event_clear(chan); + event_disable(chan); + (void)atomic_and(&force_isr_mask, ~BIT(chan)); + + compare_int_unlock(chan, key); +} + +uint64_t z_nrf_rtc_timer_read(void) +{ + uint64_t val = ((uint64_t)overflow_cnt) << COUNTER_BIT_WIDTH; + + __DMB(); - compare_set(chan, cc_value, handler, user_data); + uint32_t cntr = counter(); - z_nrf_rtc_timer_compare_int_unlock(chan, key); + val += cntr; + + if (cntr < OVERFLOW_RISK_RANGE_END) { + /* `overflow_cnt` can have incorrect value due to still unhandled overflow or + * due to possibility that this code preempted overflow interrupt before final write + * of `overflow_cnt`. Update of `anchor` occurs far in time from this moment, so + * `anchor` is considered valid and stable. Because of this timing there is no risk + * of incorrect `anchor` value caused by non-atomic read of 64-bit `anchor`. + */ + if (val < anchor) { + /* Unhandled overflow, detected, let's add correction */ + val += COUNTER_SPAN; + } + } else { + /* `overflow_cnt` is considered valid and stable in this range, no need to + * check validity using `anchor` + */ + } + + return val; +} + +static inline bool in_anchor_range(uint32_t cc_value) +{ + return (cc_value >= ANCHOR_RANGE_START) && (cc_value < ANCHOR_RANGE_END); +} + +static inline bool anchor_update(uint32_t cc_value) +{ + /* Update anchor when far from overflow */ + if (in_anchor_range(cc_value)) { + /* In this range `overflow_cnt` is considered valid and stable. + * Write of 64-bit `anchor` is non atomic. However it happens + * far in time from the moment the `anchor` is read in + * `z_nrf_rtc_timer_read`. + */ + anchor = (((uint64_t)overflow_cnt) << COUNTER_BIT_WIDTH) + cc_value; + return true; + } + + return false; } static void sys_clock_timeout_handler(int32_t chan, - uint32_t cc_value, + uint64_t expire_time, void *user_data) { - uint32_t dticks = counter_sub(cc_value, last_count) / CYC_PER_TICK; + uint32_t cc_value = absolute_time_to_cc(expire_time); + uint64_t dticks = (expire_time - last_count) / CYC_PER_TICK; last_count += dticks * CYC_PER_TICK; + bool anchor_updated = anchor_update(cc_value); + if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { /* protection is not needed because we are in the RTC interrupt * so it won't get preempted by the interrupt. @@ -243,7 +401,80 @@ static void sys_clock_timeout_handler(int32_t chan, } sys_clock_announce(IS_ENABLED(CONFIG_TICKLESS_KERNEL) ? - dticks : (dticks > 0)); + (int32_t)dticks : (dticks > 0)); + + if (cc_value == get_comparator(chan)) { + /* New value was not set. Set something that can update anchor. + * If anchor was updated we can enable same CC value to trigger + * interrupt after full cycle. Else set event in anchor update + * range. Since anchor was not updated we know that it's very + * far from mid point so setting is done without any protection. + */ + if (!anchor_updated) { + set_comparator(chan, COUNTER_HALF_SPAN); + } + event_enable(chan); + } +} + +static bool channel_processing_check_and_clear(int32_t chan) +{ + bool result = false; + + uint32_t mcu_critical_state = full_int_lock(); + + if (nrf_rtc_int_enable_check(RTC, RTC_CHANNEL_INT_MASK(chan))) { + /* The processing of channel can be caused by CC match + * or be forced. + */ + result = atomic_and(&force_isr_mask, ~BIT(chan)) || + nrf_rtc_event_check(RTC, RTC_CHANNEL_EVENT_ADDR(chan)); + + if (result) { + event_clear(chan); + } + } + + full_int_unlock(mcu_critical_state); + + return result; +} + +static void process_channel(int32_t chan) +{ + if (channel_processing_check_and_clear(chan)) { + void *user_context; + uint32_t mcu_critical_state; + uint64_t curr_time; + uint64_t expire_time; + z_nrf_rtc_timer_compare_handler_t handler = NULL; + + curr_time = z_nrf_rtc_timer_read(); + + /* This critical section is used to provide atomic access to + * cc_data structure and prevent higher priority contexts + * (including ZLIs) from overwriting it. + */ + mcu_critical_state = full_int_lock(); + + /* If target_time is in the past or is equal to current time + * value, execute the handler. + */ + expire_time = cc_data[chan].target_time; + if (curr_time >= expire_time) { + handler = cc_data[chan].callback; + user_context = cc_data[chan].user_context; + cc_data[chan].callback = NULL; + cc_data[chan].target_time = TARGET_TIME_INVALID; + event_disable(chan); + } + + full_int_unlock(mcu_critical_state); + + if (handler) { + handler(chan, expire_time, user_context); + } + } } /* Note: this function has public linkage, and MUST have this @@ -258,34 +489,14 @@ void rtc_nrf_isr(const void *arg) { ARG_UNUSED(arg); - for (int32_t chan = 0; chan < CHAN_COUNT; chan++) { - if (nrf_rtc_int_enable_check(RTC, RTC_CHANNEL_INT_MASK(chan)) && - nrf_rtc_event_check(RTC, RTC_CHANNEL_EVENT_ADDR(chan))) { - uint32_t cc_val; - uint32_t now; - z_nrf_rtc_timer_compare_handler_t handler; - - event_clear(chan); - event_disable(chan); - cc_val = get_comparator(chan); - now = counter(); - - /* Higher priority interrupt may already changed cc_val - * which now points to the future. In that case return - * current counter value. It is less precise than - * returning exact CC value but this one is already lost. - */ - if (counter_sub(now, cc_val) > COUNTER_HALF_SPAN) { - cc_val = now; - } + if (nrf_rtc_int_enable_check(RTC, NRF_RTC_INT_OVERFLOW_MASK) && + nrf_rtc_event_check(RTC, NRF_RTC_EVENT_OVERFLOW)) { + nrf_rtc_event_clear(RTC, NRF_RTC_EVENT_OVERFLOW); + overflow_cnt++; + } - handler = cc_data[chan].callback; - cc_data[chan].callback = NULL; - if (handler) { - handler(chan, cc_val, - cc_data[chan].user_context); - } - } + for (int32_t chan = 0; chan < CHAN_COUNT; chan++) { + process_channel(chan); } } @@ -324,15 +535,19 @@ int sys_clock_driver_init(const struct device *dev) /* TODO: replace with counter driver to access RTC */ nrf_rtc_prescaler_set(RTC, 0); for (int32_t chan = 0; chan < CHAN_COUNT; chan++) { + cc_data[chan].target_time = TARGET_TIME_INVALID; nrf_rtc_int_enable(RTC, RTC_CHANNEL_INT_MASK(chan)); } + nrf_rtc_int_enable(RTC, NRF_RTC_INT_OVERFLOW_MASK); + NVIC_ClearPendingIRQ(RTC_IRQn); IRQ_CONNECT(RTC_IRQn, DT_IRQ(DT_NODELABEL(RTC_LABEL), priority), rtc_nrf_isr, 0, 0); irq_enable(RTC_IRQn); + nrf_rtc_int_enable(RTC, NRF_RTC_INT_OVERFLOW_MASK); nrf_rtc_task_trigger(RTC, NRF_RTC_TASK_CLEAR); nrf_rtc_task_trigger(RTC, NRF_RTC_TASK_START); @@ -341,10 +556,11 @@ int sys_clock_driver_init(const struct device *dev) alloc_mask = BIT_MASK(EXT_CHAN_COUNT) << 1; } - if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { - compare_set(0, counter() + CYC_PER_TICK, - sys_clock_timeout_handler, NULL); - } + uint32_t initial_timeout = IS_ENABLED(CONFIG_TICKLESS_KERNEL) ? + (COUNTER_HALF_SPAN - 1) : + (counter() + CYC_PER_TICK); + + compare_set(0, initial_timeout, sys_clock_timeout_handler, NULL); z_nrf_clock_control_lf_on(mode); @@ -363,7 +579,7 @@ void sys_clock_set_timeout(int32_t ticks, bool idle) ticks = (ticks == K_TICKS_FOREVER) ? MAX_TICKS : ticks; ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); - uint32_t unannounced = counter_sub(counter(), last_count); + uint32_t unannounced = z_nrf_rtc_timer_read() - last_count; /* If we haven't announced for more than half the 24-bit wrap * duration, then force an announce to avoid loss of a wrap @@ -388,8 +604,9 @@ void sys_clock_set_timeout(int32_t ticks, bool idle) cyc = MAX_CYCLES; } - cyc += last_count; - compare_set(0, cyc, sys_clock_timeout_handler, NULL); + uint64_t target_time = cyc + last_count; + + compare_set(0, target_time, sys_clock_timeout_handler, NULL); } uint32_t sys_clock_elapsed(void) @@ -398,14 +615,10 @@ uint32_t sys_clock_elapsed(void) return 0; } - return counter_sub(counter(), last_count) / CYC_PER_TICK; + return (z_nrf_rtc_timer_read() - last_count) / CYC_PER_TICK; } uint32_t sys_clock_cycle_get_32(void) { - k_spinlock_key_t key = k_spin_lock(&lock); - uint32_t ret = counter_sub(counter(), last_count) + last_count; - - k_spin_unlock(&lock, key); - return ret; + return (uint32_t)z_nrf_rtc_timer_read(); } diff --git a/drivers/wifi/esp_at/Kconfig.esp_at b/drivers/wifi/esp_at/Kconfig.esp_at index 73cdadb4f81f..ed3024cc42a6 100644 --- a/drivers/wifi/esp_at/Kconfig.esp_at +++ b/drivers/wifi/esp_at/Kconfig.esp_at @@ -16,6 +16,21 @@ menuconfig WIFI_ESP_AT if WIFI_ESP_AT +config WIFI_ESP_AT_SCAN_PASSIVE + bool "Passive scan" + help + Use passive scanning. + +config WIFI_ESP_AT_SCAN_MAC_ADDRESS + bool "MAC address in scan response" + help + Get mac address in scan response. + +config WIFI_ESP_AT_SCAN_RESULT_RSSI_ORDERED + bool "Scan result ordering based on RSSI" + help + Order based on RSSI. + config WIFI_ESP_AT_RX_STACK_SIZE int "Stack size for the Espressif esp wifi driver RX thread" default 1024 diff --git a/drivers/wifi/esp_at/esp.c b/drivers/wifi/esp_at/esp.c index bbe75d62eb20..7881675db529 100644 --- a/drivers/wifi/esp_at/esp.c +++ b/drivers/wifi/esp_at/esp.c @@ -253,6 +253,7 @@ MODEM_CMD_DEFINE(on_cmd_cipstamac) } /* +CWLAP:(sec,ssid,rssi,channel) */ +/* with: CONFIG_WIFI_ESP_AT_SCAN_MAC_ADDRESS: +CWLAP:,,,,*/ MODEM_CMD_DEFINE(on_cmd_cwlap) { struct esp_data *dev = CONTAINER_OF(data, struct esp_data, @@ -276,7 +277,18 @@ MODEM_CMD_DEFINE(on_cmd_cwlap) memcpy(res.ssid, argv[1], i); res.ssid_length = i; res.rssi = strtol(argv[2], NULL, 10); - res.channel = strtol(argv[3], NULL, 10); + + if (IS_ENABLED(CONFIG_WIFI_ESP_AT_SCAN_MAC_ADDRESS)) { + argv[3] = str_unquote(argv[3]); + res.mac_length = WIFI_MAC_ADDR_LEN; + if (net_bytes_from_str(res.mac, sizeof(res.mac), argv[3]) < 0) { + LOG_ERR("Invalid MAC address"); + res.mac_length = 0; + } + res.channel = (argc > 4) ? strtol(argv[4], NULL, 10) : -1; + } else { + res.channel = strtol(argv[3], NULL, 10); + } if (dev->scan_cb) { dev->scan_cb(dev->net_iface, 0, &res); @@ -717,7 +729,11 @@ static void esp_mgmt_scan_work(struct k_work *work) struct esp_data *dev; int ret; static const struct modem_cmd cmds[] = { +#if defined(CONFIG_WIFI_ESP_AT_SCAN_MAC_ADDRESS) + MODEM_CMD("+CWLAP:", on_cmd_cwlap, 5U, ","), +#else MODEM_CMD("+CWLAP:", on_cmd_cwlap, 4U, ","), +#endif }; dev = CONTAINER_OF(work, struct esp_data, scan_work); @@ -726,9 +742,13 @@ static void esp_mgmt_scan_work(struct k_work *work) if (ret < 0) { goto out; } - ret = esp_cmd_send(dev, cmds, ARRAY_SIZE(cmds), "AT+CWLAP", + ret = esp_cmd_send(dev, + cmds, ARRAY_SIZE(cmds), + ESP_CMD_CWLAP, ESP_SCAN_TIMEOUT); esp_mode_flags_clear(dev, EDF_STA_LOCK); + LOG_DBG("ESP Wi-Fi scan: cmd = %s", ESP_CMD_CWLAP); + if (ret < 0) { LOG_ERR("Failed to scan: ret %d", ret); } @@ -925,8 +945,11 @@ static void esp_init_work(struct k_work *work) #endif /* enable multiple socket support */ SETUP_CMD_NOHANDLE("AT+CIPMUX=1"), - /* only need ecn,ssid,rssi,channel */ - SETUP_CMD_NOHANDLE("AT+CWLAPOPT=0,23"), + + SETUP_CMD_NOHANDLE( + ESP_CMD_CWLAPOPT(ESP_CMD_CWLAPOPT_ORDERED, ESP_CMD_CWLAPOPT_MASK)), + SETUP_CMD_NOHANDLE(ESP_CMD_CWLAP), + #if defined(CONFIG_WIFI_ESP_AT_VERSION_2_0) SETUP_CMD_NOHANDLE(ESP_CMD_CWMODE(STA)), SETUP_CMD_NOHANDLE("AT+CWAUTOCONN=0"), diff --git a/drivers/wifi/esp_at/esp.h b/drivers/wifi/esp_at/esp.h index bbdf339da0ba..3a1b7315bf51 100644 --- a/drivers/wifi/esp_at/esp.h +++ b/drivers/wifi/esp_at/esp.h @@ -131,6 +131,28 @@ extern "C" { #define ESP_CMD_SET_IP(ip, gateway, mask) "AT+"_CIPSTA"=\"" \ ip "\",\"" gateway "\",\"" mask "\"" +#if defined(CONFIG_WIFI_ESP_AT_SCAN_PASSIVE) +#define ESP_CMD_CWLAP "AT+CWLAP=,,,1,," +#else +#define ESP_CMD_CWLAP "AT+CWLAP" +#endif + +#if defined(CONFIG_WIFI_ESP_AT_SCAN_RESULT_RSSI_ORDERED) +#define ESP_CMD_CWLAPOPT_ORDERED "1" +#else +#define ESP_CMD_CWLAPOPT_ORDERED "0" +#endif + +#if defined(CONFIG_WIFI_ESP_AT_SCAN_MAC_ADDRESS) +/* We need ecn,ssid,rssi,mac,channel */ +#define ESP_CMD_CWLAPOPT_MASK "31" +#else +/* no mac: only need ecn,ssid,rssi,channel */ +#define ESP_CMD_CWLAPOPT_MASK "23" +#endif + +#define ESP_CMD_CWLAPOPT(sort, mask) "AT+CWLAPOPT=" sort "," mask + extern struct esp_data esp_driver_data; enum esp_socket_flags { diff --git a/drivers/wifi/eswifi/eswifi_socket_offload.c b/drivers/wifi/eswifi/eswifi_socket_offload.c index beee4d80ae1a..ffa01b33c102 100644 --- a/drivers/wifi/eswifi/eswifi_socket_offload.c +++ b/drivers/wifi/eswifi/eswifi_socket_offload.c @@ -571,8 +571,8 @@ static const struct socket_op_vtable eswifi_socket_fd_op_vtable = { }; #ifdef CONFIG_NET_SOCKETS_OFFLOAD -NET_SOCKET_REGISTER(eswifi, AF_UNSPEC, eswifi_socket_is_supported, - eswifi_socket_create); +NET_SOCKET_REGISTER(eswifi, NET_SOCKET_DEFAULT_PRIO, AF_UNSPEC, + eswifi_socket_is_supported, eswifi_socket_create); #endif static int eswifi_off_getaddrinfo(const char *node, const char *service, diff --git a/drivers/wifi/simplelink/simplelink_sockets.c b/drivers/wifi/simplelink/simplelink_sockets.c index f315f59df008..4f11fc5845e3 100644 --- a/drivers/wifi/simplelink/simplelink_sockets.c +++ b/drivers/wifi/simplelink/simplelink_sockets.c @@ -1264,8 +1264,8 @@ static int simplelink_socket_accept(void *obj, struct sockaddr *addr, } #ifdef CONFIG_NET_SOCKETS_OFFLOAD -NET_SOCKET_REGISTER(simplelink, AF_UNSPEC, simplelink_is_supported, - simplelink_socket_create); +NET_SOCKET_REGISTER(simplelink, NET_SOCKET_DEFAULT_PRIO, AF_UNSPEC, + simplelink_is_supported, simplelink_socket_create); #endif void simplelink_sockets_init(void) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index e3f84a7088d7..af5e9f97c60a 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -5,7 +5,7 @@ / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -413,7 +413,8 @@ compatible = "nordic,nrf-qspi"; #address-cells = <1>; #size-cells = <0>; - reg = <0x40029000 0x1000>; + reg = <0x40029000 0x1000>, <0x12000000 0x8000000>; + reg-names = "qspi", "qspi_mm"; interrupts = <41 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; label = "QSPI"; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index b65ed1cdc0d7..6c4bf87ddfba 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi index ccfc7177f9f2..885931e0ff71 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi @@ -382,7 +382,8 @@ qspi: qspi@2b000 { compatible = "nordic,nrf-qspi"; #address-cells = <1>; #size-cells = <0>; - reg = <0x2b000 0x1000>; + reg = <0x2b000 0x1000>, <0x10000000 0x10000000>; + reg-names = "qspi", "qspi_mm"; interrupts = <43 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; label = "QSPI"; diff --git a/dts/arm/nordic/nrf5340_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index eb39f04ff406..1620249c7671 100644 --- a/dts/arm/nordic/nrf5340_cpuappns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns.dtsi @@ -30,6 +30,15 @@ chosen { zephyr,flash-controller = &flash_controller; + + /* + * By default, system entropy comes from the entropy_cc310.c + * driver in the nrf repository. This is devicetree glue + * needed to make the system aware of that fact. Individual + * applications can override this by changing this property + * value. + */ + zephyr,entropy = &cryptocell_sw; }; soc { @@ -48,6 +57,13 @@ #include "nrf5340_cpuapp_peripherals.dtsi" }; }; + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc312-sw"; + #address-cells = <0>; + label = "CRYPTOCELL_SW"; + }; }; &nvic { diff --git a/dts/arm/nordic/nrf9160.dtsi b/dts/arm/nordic/nrf9160.dtsi index 09b030d13581..e797d79ab529 100644 --- a/dts/arm/nordic/nrf9160.dtsi +++ b/dts/arm/nordic/nrf9160.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; diff --git a/dts/arm/nordic/nrf9160ns.dtsi b/dts/arm/nordic/nrf9160ns.dtsi index 1742580e76cf..a85dada2ba6f 100644 --- a/dts/arm/nordic/nrf9160ns.dtsi +++ b/dts/arm/nordic/nrf9160ns.dtsi @@ -29,6 +29,15 @@ chosen { zephyr,flash-controller = &flash_controller; + + /* + * By default, system entropy comes from the entropy_cc310.c + * driver in the nrf repository. This is devicetree glue + * needed to make the system aware of that fact. Individual + * applications can override this by changing this property + * value. + */ + zephyr,entropy = &cryptocell_sw; }; soc { @@ -54,6 +63,13 @@ label = "GPIOTE_1"; }; }; + + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc310-sw"; + label = "CRYPTOCELL_SW"; + }; }; &nvic { diff --git a/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml new file mode 100644 index 000000000000..a0724a45938d --- /dev/null +++ b/dts/bindings/crypto/nordic,nrf-cc310-sw.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2020, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Stub access to cryptocell via platform driver + + Non-secure configurations can use this compatible to declare + devicetree nodes which access the CC310 via callbacks into secure + code. + +compatible: "nordic,nrf-cc310-sw" + +include: base.yaml + +properties: + label: + required: true diff --git a/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml b/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml new file mode 100644 index 000000000000..9c3f936bf20e --- /dev/null +++ b/dts/bindings/crypto/nordic,nrf-cc312-sw.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2021, Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Stub access to cryptocell via platform driver + + Non-secure configurations can use this compatible to declare + devicetree nodes which access the CC312 via callbacks into secure + code. + +compatible: "nordic,nrf-cc312-sw" + +include: base.yaml + +properties: + label: + required: true diff --git a/dts/bindings/flash_controller/nordic,nrf-qspi.yaml b/dts/bindings/flash_controller/nordic,nrf-qspi.yaml index eed8cf231fb8..63b410c9fe92 100644 --- a/dts/bindings/flash_controller/nordic,nrf-qspi.yaml +++ b/dts/bindings/flash_controller/nordic,nrf-qspi.yaml @@ -4,6 +4,21 @@ description: | Properties defining the interface for the Nordic QSPI peripheral. + The reg property describes two register blocks: one for the memory + corresponding to the QSPI peripheral registers, and another for + the memory mapped XIP area: + + qspi: qspi@2b000 { + compatible = "nordic,nrf-qspi"; + reg = <0x2b000 0x1000>, <0x10000000 0x10000000>; + reg-names = "qspi", "qspi_mm"; + ... + }; + + Above, the register block with base address 0x2b000 and name + "qspi" are the QSPI peripheral registers. The register block with + base address 0x10000000 and name "qspi_mm" is the XIP area. + compatible: "nordic,nrf-qspi" include: flash-controller.yaml diff --git a/dts/bindings/net/wireless/nordic,nrf-radio.yaml b/dts/bindings/net/wireless/nordic,nrf-radio.yaml index 1dcce92154e2..ef6b063caff6 100644 --- a/dts/bindings/net/wireless/nordic,nrf-radio.yaml +++ b/dts/bindings/net/wireless/nordic,nrf-radio.yaml @@ -12,6 +12,27 @@ description: | This binding is not relevant to the nRF91x baseband radio. + External Coexistence Support + ---------------------------- + + External radio coexistence is a system designed to allow cooperative sharing + of the radio spectrum by separate transceivers or SoCs co-located on the + same board. There has to be an arbitrator that grants or denies on-air access + to the different transceivers, using one or more GPIOs connected to each + transceiver. + + If your system includes a radio arbitrator, set up the link to it in the + devicetree using this binding's 'coex' property, like this example: + + &radio { + coex = <&nrf_radio_coex>; + }; + + nrf_radio_coex: my-coex { + compatible = "..."; + ... + }; + Direction Finding Extension --------------------------- @@ -92,6 +113,11 @@ properties: interrupts: required: true + coex: + type: phandle + description: | + Phandle linking the RADIO node to the external radio coexistence arbitrator. + dfe-supported: type: boolean description: | diff --git a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld index da045f7b90f3..46fe93cec603 100644 --- a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -28,6 +28,36 @@ #define RAMABLE_REGION SRAM #endif +#if USE_PARTITION_MANAGER + +#include + +#ifdef LINK_INTO_s1 +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#define ROM_ADDR PM_ADDRESS + PM_S1_ADDRESS - PM_S0_ADDRESS + +#else /* ! LINK_INTO_s1 */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#define ROM_ADDR PM_ADDRESS +#endif /* LINK_MCUBOOT_INTO_s1 */ +#define ROM_SIZE PM_SIZE + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -54,6 +84,23 @@ #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS #endif +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index afeaa7bacf90..8c6df6d28e96 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -751,6 +751,9 @@ enum bt_security_err { /** Invalid parameters. */ BT_SECURITY_ERR_INVALID_PARAM, + /** Distributed Key Rejected */ + BT_SECURITY_ERR_KEY_REJECTED, + /** Pairing failed but the exact reason could not be specified. */ BT_SECURITY_ERR_UNSPECIFIED, }; diff --git a/include/bluetooth/hci.h b/include/bluetooth/hci.h index 480b5d512375..58dca42c7e29 100644 --- a/include/bluetooth/hci.h +++ b/include/bluetooth/hci.h @@ -1432,15 +1432,20 @@ struct bt_hci_cp_le_ext_create_conn { #define BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_USE_LIST BIT(0) #define BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_REPORTS_DISABLED BIT(1) +#define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_NO_FILTERING 0 #define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_NO_AOA BIT(0) #define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_NO_AOD_1US BIT(1) #define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_NO_AOD_2US BIT(2) #define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_NO_CTE BIT(3) #define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_ONLY_CTE BIT(4) +/* Constants to check correctness of CTE type */ +#define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_ALLOWED_BITS 5 +#define BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_INVALID_VALUE \ + (~BIT_MASK(BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_ALLOWED_BITS)) #define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC BT_OP(BT_OGF_LE, 0x0044) struct bt_hci_cp_le_per_adv_create_sync { - uint8_t options; + uint8_t options; uint8_t sid; bt_addr_le_t addr; uint16_t skip; diff --git a/include/bluetooth/l2cap.h b/include/bluetooth/l2cap.h index 8b973dd57865..7f5aa877492b 100644 --- a/include/bluetooth/l2cap.h +++ b/include/bluetooth/l2cap.h @@ -177,6 +177,10 @@ struct bt_l2cap_le_chan { * @ref BT_L2CAP_SDU_RX_MTU by the stack. */ struct bt_l2cap_le_endpoint rx; + + /** Pending RX MTU on ECFC reconfigure, used internally by stack */ + uint16_t pending_rx_mtu; + /** Channel Transmission Endpoint */ struct bt_l2cap_le_endpoint tx; /** Channel Transmission queue */ @@ -316,6 +320,16 @@ struct bt_l2cap_chan_ops { * references to the channel object. */ void (*released)(struct bt_l2cap_chan *chan); + + /** @brief Channel reconfigured callback + * + * If this callback is provided it will be called whenever peer or + * local device requested reconfiguration. Application may check + * updated MTU and MPS values by inspecting chan->le endpoints. + * + * @param chan The channel which was reconfigured + */ + void (*reconfigured)(struct bt_l2cap_chan *chan); }; /** @def BT_L2CAP_CHAN_SEND_RESERVE @@ -414,6 +428,20 @@ int bt_l2cap_br_server_register(struct bt_l2cap_server *server); int bt_l2cap_ecred_chan_connect(struct bt_conn *conn, struct bt_l2cap_chan **chans, uint16_t psm); +/** @brief Reconfigure Enhanced Credit Based L2CAP channels + * + * Reconfigure up to 5 L2CAP channels. Channels must be from the same bt_conn. + * Once reconfiguration is completed each channel reconfigured() callback will + * be called. MTU cannot be decreased on any of provided channels. + * + * @param chans Array of channel objects. Null-terminated. Elements after the + * first 5 are silently ignored. + * @param mtu Channel MTU to reconfigure to. + * + * @return 0 in case of success or negative value in case of error. + */ +int bt_l2cap_ecred_chan_reconfigure(struct bt_l2cap_chan **chans, uint16_t mtu); + /** @brief Connect L2CAP channel * * Connect L2CAP channel by PSM, once the connection is completed channel diff --git a/include/bluetooth/mesh/access.h b/include/bluetooth/mesh/access.h index 43c9af62fc0d..971dd75eb7f2 100644 --- a/include/bluetooth/mesh/access.h +++ b/include/bluetooth/mesh/access.h @@ -343,6 +343,29 @@ struct bt_mesh_model_op { */ #define BT_MESH_PUB_TRANSMIT_INT(transmit) ((((transmit) >> 3) + 1) * 50) +/** @def BT_MESH_PUB_MSG_TOTAL + * + * @brief Get total number of messages within one publication interval including initial + * publication. + * + * @param pub Model publication context. + * + * @return total number of messages. + */ +#define BT_MESH_PUB_MSG_TOTAL(pub) (BT_MESH_PUB_TRANSMIT_COUNT((pub)->retransmit) + 1) + +/** @def BT_MESH_PUB_MSG_NUM + * + * @brief Get message number within one publication interval. + * + * Meant to be used inside @ref bt_mesh_model_pub.update. + * + * @param pub Model publication context. + * + * @return message number starting from 1. + */ +#define BT_MESH_PUB_MSG_NUM(pub) (BT_MESH_PUB_TRANSMIT_COUNT((pub)->retransmit) + 1 - (pub)->count) + /** Model publication context. * * The context should primarily be created using the @@ -356,7 +379,8 @@ struct bt_mesh_model_pub { uint16_t key:12, /**< Publish AppKey Index. */ cred:1, /**< Friendship Credentials Flag. */ send_rel:1, /**< Force reliable sending (segment acks) */ - fast_period:1; /**< Use FastPeriodDivisor */ + fast_period:1, /**< Use FastPeriodDivisor */ + retr_update:1; /**< Call update callback on every retransmission. */ uint8_t ttl; /**< Publish Time to Live. */ uint8_t retransmit; /**< Retransmit Count & Interval Steps. */ @@ -386,6 +410,9 @@ struct bt_mesh_model_pub { * If the callback returns non-zero, the publication is skipped * and will resume on the next periodic publishing interval. * + * When @ref bt_mesh_model_pub.retr_update is set to 1, + * the callback will be called on every retransmission. + * * @param mod The Model the Publication Context belogs to. * * @return Zero on success or (negative) error code otherwise. @@ -572,6 +599,19 @@ int bt_mesh_model_send(struct bt_mesh_model *model, */ int bt_mesh_model_publish(struct bt_mesh_model *model); +/** @brief Check if a message is being retransmitted. + * + * Meant to be used inside the @ref bt_mesh_model_pub.update callback. + * + * @param model Mesh Model that supports publication. + * + * @return true if this is a retransmission, false if this is a first publication. + */ +static inline bool bt_mesh_model_pub_is_retransmission(const struct bt_mesh_model *model) +{ + return model->pub->count != BT_MESH_PUB_TRANSMIT_COUNT(model->pub->retransmit); +} + /** @brief Get the element that a model belongs to. * * @param mod Mesh model. diff --git a/include/bluetooth/mesh/shell.h b/include/bluetooth/mesh/shell.h new file mode 100644 index 000000000000..08286e701d89 --- /dev/null +++ b/include/bluetooth/mesh/shell.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_SHELL_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_SHELL_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Maximum number of faults the health server can have. */ +#define BT_MESH_SHELL_CUR_FAULTS_MAX 4 + +/** @def BT_MESH_SHELL_HEALTH_PUB_DEFINE + * + * A helper to define a health publication context for shell with the shell's + * maximum number of faults the element can have. + * + * @param _name Name given to the publication context variable. + */ +#define BT_MESH_SHELL_HEALTH_PUB_DEFINE(_name) \ + BT_MESH_HEALTH_PUB_DEFINE(_name, \ + BT_MESH_SHELL_CUR_FAULTS_MAX); + +/** @brief External reference to health server */ +extern struct bt_mesh_health_srv bt_mesh_shell_health_srv; + +/** @brief External reference to health client */ +extern struct bt_mesh_health_cli bt_mesh_shell_health_cli; + +/** @brief External reference to provisioning handler. */ +extern struct bt_mesh_prov bt_mesh_shell_prov; + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_SHELL_H_ */ diff --git a/include/device.h b/include/device.h index 4bde63efff05..c88316779d24 100644 --- a/include/device.h +++ b/include/device.h @@ -479,48 +479,8 @@ device_required_handles_get(const struct device *dev, if (rv != NULL) { size_t i = 0; - while (rv[i] != DEVICE_HANDLE_SEP) { - ++i; - } - *count = i; - } - - return rv; -} - -/** - * @brief Get the set of handles that this device supports. - * - * The set of supported devices is inferred from devicetree, and does not - * include any software constructs that may depend on the device. - * - * @param dev the device for which supports are desired. - * - * @param count pointer to a place to store the number of devices provided at - * the returned pointer. The value is not set if the call returns a null - * pointer. The value may be set to zero. - * - * @return a pointer to a sequence of @p *count device handles, or a null - * pointer if @p dh does not provide dependency information. - */ -static inline const device_handle_t * -device_supported_handles_get(const struct device *dev, - size_t *count) -{ - const device_handle_t *rv = dev->handles; - size_t region = 0; - size_t i = 0; - - if (rv != NULL) { - /* Fast forward to supporting devices */ - while (region != 2) { - if (*rv == DEVICE_HANDLE_SEP) { - region++; - } - rv++; - } - /* Count supporting devices */ - while (rv[i] != DEVICE_HANDLE_ENDS) { + while ((rv[i] != DEVICE_HANDLE_ENDS) + && (rv[i] != DEVICE_HANDLE_SEP)) { ++i; } *count = i; @@ -566,42 +526,6 @@ int device_required_foreach(const struct device *dev, device_visitor_callback_t visitor_cb, void *context); -/** - * @brief Visit every device that @p dev directly supports. - * - * Zephyr maintains information about which devices are directly supported by - * another device; for example an I2C controller will support an I2C-based - * sensor driver. Supported devices can derive from statically-defined - * devicetree relationships. - * - * This API supports operating on the set of supported devices. Example uses - * include iterating over the devices connected to a regulator when it is - * powered on. - * - * There is no guarantee on the order in which required devices are visited. - * - * If the @p visitor function returns a negative value iteration is halted, - * and the returned value from the visitor is returned from this function. - * - * @note This API is not available to unprivileged threads. - * - * @param dev a device of interest. The devices that this device supports - * will be used as the set of devices to visit. This parameter must not be - * null. - * - * @param visitor_cb the function that should be invoked on each device in the - * support set. This parameter must not be null. - * - * @param context state that is passed through to the visitor function. This - * parameter may be null if @p visitor tolerates a null @p context. - * - * @return The number of devices that were visited if all visits succeed, or - * the negative value returned from the first visit that did not succeed. - */ -int device_supported_foreach(const struct device *dev, - device_visitor_callback_t visitor_cb, - void *context); - /** * @brief Retrieve the device structure for a driver by name * @@ -762,6 +686,50 @@ static inline bool device_is_ready(const struct device *dev) Z_DEVICE_STATE_DEFINE(node_id, dev_name) \ Z_DEVICE_DEFINE_PM_SLOT(dev_name) +/* Helper macros needed for CONFIG_DEVICE_HANDLE_PADDING. These should + * be deleted when that option is removed. + * + * This is implemented "by hand" -- rather than using a helper macro + * like UTIL_LISTIFY() -- because we need to allow users to wrap + * DEVICE_DT_DEFINE with UTIL_LISTIFY, like this: + * + * #define DEFINE_FOO_DEVICE(...) DEVICE_DT_DEFINE(...) + * UTIL_LISTIFY(N, DEFINE_FOO_DEVICE) + * + * If Z_DEVICE_HANDLE_PADDING uses UTIL_LISTIFY, this type of code + * would fail, because the UTIL_LISTIFY token within the + * Z_DEVICE_DEFINE_HANDLES expansion would not be expanded again, + * since it appears in a context where UTIL_LISTIFY is already being + * expanded. Standard C does not reexpand macros appearing in their + * own expansion; this would lead to infinite recursions in general. + */ +#define Z_DEVICE_HANDLE_PADDING \ + Z_DEVICE_HANDLE_PADDING_(CONFIG_DEVICE_HANDLE_PADDING) +#define Z_DEVICE_HANDLE_PADDING_(count) \ + Z_DEVICE_HANDLE_PADDING__(count) +#define Z_DEVICE_HANDLE_PADDING__(count) \ + Z_DEVICE_HANDLE_PADDING_ ## count +#define Z_DEVICE_HANDLE_PADDING_10 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_9 +#define Z_DEVICE_HANDLE_PADDING_9 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_8 +#define Z_DEVICE_HANDLE_PADDING_8 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_7 +#define Z_DEVICE_HANDLE_PADDING_7 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_6 +#define Z_DEVICE_HANDLE_PADDING_6 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_5 +#define Z_DEVICE_HANDLE_PADDING_5 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_4 +#define Z_DEVICE_HANDLE_PADDING_4 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_3 +#define Z_DEVICE_HANDLE_PADDING_3 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_2 +#define Z_DEVICE_HANDLE_PADDING_2 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_1 +#define Z_DEVICE_HANDLE_PADDING_1 \ + DEVICE_HANDLE_ENDS, Z_DEVICE_HANDLE_PADDING_0 +#define Z_DEVICE_HANDLE_PADDING_0 EMPTY /* Initial build provides a record that associates the device object * with its devicetree ordinal, and provides the dependency ordinals. @@ -770,26 +738,6 @@ static inline bool device_is_ready(const struct device *dev) * in a distinct pass1 section (which will be replaced by * postprocessing). * - * Before processing in gen_handles.py, the array format is: - * { - * DEVICE_ORDINAL (or DEVICE_HANDLE_NULL if not a devicetree node), - * List of devicetree dependency ordinals (if any), - * DEVICE_HANDLE_SEP, - * List of injected dependency ordinals (if any), - * DEVICE_HANDLE_SEP, - * List of devicetree supporting ordinals (if any), - * } - * - * After processing in gen_handles.py, the format is updated to: - * { - * List of existing devicetree dependency handles (if any), - * DEVICE_HANDLE_SEP, - * List of injected dependency ordinals (if any), - * DEVICE_HANDLE_SEP, - * List of existing devicetree support handles (if any), - * DEVICE_HANDLE_NULL padding to original length (at least one) - * } - * * It is also (experimentally) necessary to provide explicit alignment * on each object. Otherwise x86-64 builds will introduce padding * between objects in the same input section in individual object @@ -818,9 +766,7 @@ BUILD_ASSERT(sizeof(device_handle_t) == 2, "fix the linker scripts"); )) \ DEVICE_HANDLE_SEP, \ Z_DEVICE_EXTRA_HANDLES(__VA_ARGS__) \ - DEVICE_HANDLE_SEP, \ - COND_CODE_1(DT_NODE_EXISTS(node_id), \ - (DT_SUPPORTS_DEP_ORDS(node_id)), ()) \ + Z_DEVICE_HANDLE_PADDING \ }; #ifdef CONFIG_PM_DEVICE diff --git a/include/devicetree/memory.h b/include/devicetree/memory.h deleted file mode 100644 index a6c173e652e2..000000000000 --- a/include/devicetree/memory.h +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @file - * @brief reserved-memory Devicetree macro public API header file. - */ - -/* - * Copyright (c) 2021 Carlo Caione - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DEVICETREE_MEMORY_H_ -#define ZEPHYR_INCLUDE_DEVICETREE_MEMORY_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup devicetree-reserved Devicetree reserved-memory API - * @ingroup devicetree - * @{ - */ - -/** - * @brief Get the pointer to the reserved-memory region - * - * Example devicetree fragment: - * - * reserved: reserved-memory { - * compatible = "reserved-memory"; - * ... - * n: node { - * reg = <0x42000000 0x1000>; - * }; - * }; - * - * Example usage: - * - * DT_RESERVED_MEM_GET_PTR(DT_NODELABEL(n)) // (uint8_t *) 0x42000000 - * - * @param node_id node identifier - * @return pointer to the beginning of the reserved-memory region - */ -#define DT_RESERVED_MEM_GET_PTR(node_id) _DT_RESERVED_START(node_id) - -/** - * @brief Get the size of the reserved-memory region - * - * Example devicetree fragment: - * - * reserved: reserved-memory { - * compatible = "reserved-memory"; - * ... - * n: node { - * reg = <0x42000000 0x1000>; - * }; - * }; - * - * Example usage: - * - * DT_RESERVED_MEM_GET_SIZE(DT_NODELABEL(n)) // 0x1000 - * - * @param node_id node identifier - * @return the size of the reserved-memory region - */ -#define DT_RESERVED_MEM_GET_SIZE(node_id) DT_REG_SIZE(node_id) - -/** - * @brief Get the pointer to the reserved-memory region from a memory-reserved - * phandle - * - * Example devicetree fragment: - * - * reserved: reserved-memory { - * compatible = "reserved-memory"; - * ... - * res0: res { - * reg = <0x42000000 0x1000>; - * label = "res0"; - * }; - * }; - * - * n: node { - * memory-region = <&res0>; - * }; - * - * Example usage: - * - * DT_RESERVED_MEM_GET_PTR_BY_PHANDLE(DT_NODELABEL(n), memory_region) // (uint8_t *) 0x42000000 - * - * @param node_id node identifier - * @param ph phandle to reserved-memory region - * - * @return pointer to the beginning of the reserved-memory region - */ -#define DT_RESERVED_MEM_GET_PTR_BY_PHANDLE(node_id, ph) \ - DT_RESERVED_MEM_GET_PTR(DT_PHANDLE(node_id, ph)) - -/** - * @brief Get the size of the reserved-memory region from a memory-reserved - * phandle - * - * Example devicetree fragment: - * - * reserved: reserved-memory { - * compatible = "reserved-memory"; - * ... - * res0: res { - * reg = <0x42000000 0x1000>; - * label = "res0"; - * }; - * }; - * - * n: node { - * memory-region = <&res0>; - * }; - * - * Example usage: - * - * DT_RESERVED_MEM_GET_SIZE_BY_PHANDLE(DT_NODELABEL(n), memory_region) // (uint8_t *) 0x42000000 - * - * @param node_id node identifier - * @param ph phandle to reserved-memory region - * - * @return size of the reserved-memory region - */ -#define DT_RESERVED_MEM_GET_SIZE_BY_PHANDLE(node_id, ph) \ - DT_RESERVED_MEM_GET_SIZE(DT_PHANDLE(node_id, ph)) - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_DEVICETREE_MEMORY_H_ */ diff --git a/include/drivers/sensor.h b/include/drivers/sensor.h index 00ec0b62fcfe..ccf4078fc0e8 100644 --- a/include/drivers/sensor.h +++ b/include/drivers/sensor.h @@ -333,7 +333,7 @@ enum sensor_attribute { * @param trigger The trigger */ typedef void (*sensor_trigger_handler_t)(const struct device *dev, - struct sensor_trigger *trigger); + const struct sensor_trigger *trigger); /** * @typedef sensor_attr_set_t @@ -474,7 +474,7 @@ static inline int z_impl_sensor_attr_get(const struct device *dev, * @return 0 if successful, negative errno code if failure. */ static inline int sensor_trigger_set(const struct device *dev, - struct sensor_trigger *trig, + const struct sensor_trigger *trig, sensor_trigger_handler_t handler) { const struct sensor_driver_api *api = diff --git a/include/drivers/timer/nrf_rtc_timer.h b/include/drivers/timer/nrf_rtc_timer.h index f4b502edffcd..1a0999299a21 100644 --- a/include/drivers/timer/nrf_rtc_timer.h +++ b/include/drivers/timer/nrf_rtc_timer.h @@ -11,8 +11,25 @@ extern "C" { #endif +/** @brief Maximum allowed time span that is considered to be in the future. + */ +#define NRF_RTC_TIMER_MAX_SCHEDULE_SPAN BIT(23) + +/** @brief RTC timer compare event handler. + * + * Called from RTC ISR context when processing a compare event. + * + * @param id Compare channel ID. + * + * @param expire_time An actual absolute expiration time set for a compare + * channel. It can differ from the requested target time + * and the difference can be used to determine whether the + * time set was delayed. + * + * @param user_data Pointer to a user context data. + */ typedef void (*z_nrf_rtc_timer_compare_handler_t)(int32_t id, - uint32_t cc_value, + uint64_t expire_time, void *user_data); /** @brief Allocate RTC compare channel. @@ -30,11 +47,11 @@ int32_t z_nrf_rtc_timer_chan_alloc(void); */ void z_nrf_rtc_timer_chan_free(int32_t chan); -/** @brief Read current RTC counter value. +/** @brief Read current absolute time. * - * @return Current RTC counter value. + * @return Current absolute time. */ -uint32_t z_nrf_rtc_timer_read(void); +uint64_t z_nrf_rtc_timer_read(void); /** @brief Get COMPARE event register address. * @@ -76,38 +93,52 @@ uint32_t z_nrf_rtc_timer_compare_read(int32_t chan); /** @brief Try to set compare channel to given value. * - * Provided value is absolute and cannot be further in future than half span of - * the RTC counter. Function continouosly retries to set compare register until - * value that is written is far enough in the future and will generate an event. - * Because of that, compare register value may be different than the one - * requested. During this operation interrupt from that compare channel is - * disabled. Other interrupts are not locked during this operation. - * - * There is no option to abort the request once it is set. However, it can be - * overwritten. + * Provided value is absolute and cannot be further in the future than + * @c NRF_RTC_TIMER_MAX_SCHEDULE_SPAN. If given value is in the past then an RTC + * interrupt is triggered immediately. Otherwise function continuously retries + * to set compare register until value that is written is far enough in the + * future and will generate an event. Because of that, compare register value + * may be different than the one requested. During this operation interrupt + * from that compare channel is disabled. Other interrupts are not locked during + * this operation. * * @param chan Channel ID between 1 and CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT. * - * @param cc_value Absolute value. Values which are further distanced from - * current counter value than half RTC span are considered in the past. + * @param target_time Absolute target time in ticks. * * @param handler User function called in the context of the RTC interrupt. * * @param user_data Data passed to the handler. + * + * @retval 0 if the compare channel was set successfully. + * @retval -EINVAL if provided target time was further than + * @c NRF_RTC_TIMER_MAX_SCHEDULE_SPAN ticks in the future. + */ +int z_nrf_rtc_timer_set(int32_t chan, uint64_t target_time, + z_nrf_rtc_timer_compare_handler_t handler, + void *user_data); + +/** @brief Abort a timer requested with @ref z_nrf_rtc_timer_set. + * + * If an abort operation is performed too late it is still possible for an event + * to fire. The user can detect a spurious event by comparing absolute time + * provided in callback and a result of @ref z_nrf_rtc_timer_read. During this + * operation interrupt from that compare channel is disabled. Other interrupts + * are not locked during this operation. + * + * @param chan Channel ID between 1 and CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT. */ -void z_nrf_rtc_timer_compare_set(int32_t chan, uint32_t cc_value, - z_nrf_rtc_timer_compare_handler_t handler, - void *user_data); +void z_nrf_rtc_timer_abort(int32_t chan); /** @brief Convert system clock time to RTC ticks. * - * @p t can be absolute or relative. @p t cannot be further from now than half - * of the RTC range (e.g. 256 seconds if RTC is running at 32768 Hz). + * @p t can be absolute or relative. @p t cannot be further into the future + * from now than the RTC range (e.g. 512 seconds if RTC is running at 32768 Hz). * * @retval Positive value represents @p t in RTC tick value. * @retval -EINVAL if @p t is out of range. */ -int z_nrf_rtc_timer_get_ticks(k_timeout_t t); +uint64_t z_nrf_rtc_timer_get_ticks(k_timeout_t t); #ifdef __cplusplus } diff --git a/include/fs/nvs.h b/include/fs/nvs.h index d6ad75fc28c8..0b949bbd8057 100644 --- a/include/fs/nvs.h +++ b/include/fs/nvs.h @@ -34,26 +34,23 @@ extern "C" { * @brief Non-volatile Storage File system structure * * @param offset File system offset in flash - * @param ate_wra: Allocation table entry write address. Addresses are stored - * as uint32_t: high 2 bytes are sector, low 2 bytes are offset in sector, - * @param data_wra: Data write address. - * @param sector_size File system is divided into sectors each sector should be - * multiple of pagesize - * @param sector_count Amount of sectors in the file systems - * @param write_block_size Alignment size + * @param ate_wra Allocation table entry write address. Addresses are stored as uint32_t: + * high 2 bytes correspond to the sector, low 2 bytes are the offset in the sector + * @param data_wra Data write address + * @param sector_size File system is split into sectors, each sector must be multiple of pagesize + * @param sector_count Number of sectors in the file systems + * @param ready Flag indicating if the filesystem is initialized * @param nvs_lock Mutex - * @param flash_device Flash Device + * @param flash_device Flash Device runtime structure + * @param flash_parameters Flash memory parameters structure */ struct nvs_fs { - off_t offset; /* filesystem offset in flash */ - uint32_t ate_wra; /* next alloc table entry write address */ - uint32_t data_wra; /* next data write address */ - uint16_t sector_size; /* filesystem is divided into sectors, - * sector size should be multiple of pagesize - */ - uint16_t sector_count; /* amount of sectors in the filesystem */ - bool ready; /* is the filesystem initialized ? */ - + off_t offset; + uint32_t ate_wra; + uint32_t data_wra; + uint16_t sector_size; + uint16_t sector_count; + bool ready; struct k_mutex nvs_lock; const struct device *flash_device; const struct flash_parameters *flash_parameters; @@ -102,10 +99,10 @@ int nvs_clear(struct nvs_fs *fs); * @param data Pointer to the data to be written * @param len Number of bytes to be written * - * @return Number of bytes written. On success, it will be equal to the number - * of bytes requested to be written. On error returns -ERRNO code. + * @return Number of bytes written. On success, it will be equal to the number of bytes requested + * to be written. When a rewrite of the same data already stored is attempted, nothing is written + * to flash, thus 0 is returned. On error, returns negative value of errno.h defined error codes. */ - ssize_t nvs_write(struct nvs_fs *fs, uint16_t id, const void *data, size_t len); /** @@ -130,10 +127,10 @@ int nvs_delete(struct nvs_fs *fs, uint16_t id); * @param data Pointer to data buffer * @param len Number of bytes to be read * - * @return Number of bytes read. On success, it will be equal to the number - * of bytes requested to be read. When the return value is larger than the - * number of bytes requested to read this indicates not all bytes were read, - * and more data is available. On error returns -ERRNO code. + * @return Number of bytes read. On success, it will be equal to the number of bytes requested + * to be read. When the return value is larger than the number of bytes requested to read this + * indicates not all bytes were read, and more data is available. On error, returns negative + * value of errno.h defined error codes. */ ssize_t nvs_read(struct nvs_fs *fs, uint16_t id, void *data, size_t len); @@ -146,15 +143,14 @@ ssize_t nvs_read(struct nvs_fs *fs, uint16_t id, void *data, size_t len); * @param id Id of the entry to be read * @param data Pointer to data buffer * @param len Number of bytes to be read - * @param cnt History counter: 0: latest entry, 1:one before latest ... + * @param cnt History counter: 0: latest entry, 1: one before latest ... * - * @return Number of bytes read. On success, it will be equal to the number - * of bytes requested to be read. When the return value is larger than the - * number of bytes requested to read this indicates not all bytes were read, - * and more data is available. On error returns -ERRNO code. + * @return Number of bytes read. On success, it will be equal to the number of bytes requested + * to be read. When the return value is larger than the number of bytes requested to read this + * indicates not all bytes were read, and more data is available. On error, returns negative + * value of errno.h defined error codes. */ -ssize_t nvs_read_hist(struct nvs_fs *fs, uint16_t id, void *data, size_t len, - uint16_t cnt); +ssize_t nvs_read_hist(struct nvs_fs *fs, uint16_t id, void *data, size_t len, uint16_t cnt); /** * @brief nvs_calc_free_space @@ -163,10 +159,9 @@ ssize_t nvs_read_hist(struct nvs_fs *fs, uint16_t id, void *data, size_t len, * * @param fs Pointer to file system * - * @return Number of bytes free. On success, it will be equal to the number - * of bytes that can still be written to the file system. Calculating the - * free space is a time consuming operation, especially on spi flash. - * On error returns -ERRNO code. + * @return Number of bytes free. On success, it will be equal to the number of bytes that can + * still be written to the file system. Calculating the free space is a time consuming operation, + * especially on spi flash. On error, returns negative value of errno.h defined error codes. */ ssize_t nvs_calc_free_space(struct nvs_fs *fs); diff --git a/include/kernel.h b/include/kernel.h index 3af8b364c4ed..df298eb345c2 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -743,7 +743,7 @@ __syscall void k_thread_priority_set(k_tid_t thread, int prio); * integers. The number of cycles between the "first" deadline in the * scheduler queue and the "last" deadline must be less than 2^31 (i.e * a signed non-negative quantity). Failure to adhere to this rule - * may result in scheduled threads running in an incorrect dealine + * may result in scheduled threads running in an incorrect deadline * order. * * @note Despite the API naming, the scheduler makes no guarantees the diff --git a/include/linker/devicetree_reserved.h b/include/linker/devicetree_reserved.h index 92797602be28..391eba5909ad 100644 --- a/include/linker/devicetree_reserved.h +++ b/include/linker/devicetree_reserved.h @@ -46,14 +46,122 @@ /** * @brief Generate region definitions for all the reserved memory regions */ -#define DT_RESERVED_MEM_REGIONS() _RESERVED_REGION_APPLY(_RESERVED_REGION_DECLARE) +#define LINKER_DT_RESERVED_MEM_REGIONS() _RESERVED_REGION_APPLY(_RESERVED_REGION_DECLARE) /** * @brief Generate section definitions for all the reserved memory regions */ -#define DT_RESERVED_MEM_SECTIONS() _RESERVED_REGION_APPLY(_RESERVED_SECTION_DECLARE) +#define LINKER_DT_RESERVED_MEM_SECTIONS() _RESERVED_REGION_APPLY(_RESERVED_SECTION_DECLARE) /** * @brief Generate linker script symbols for all the reserved memory regions */ -#define DT_RESERVED_MEM_SYMBOLS() _RESERVED_REGION_APPLY(_RESERVED_SYMBOL_DECLARE) +#define LINKER_DT_RESERVED_MEM_SYMBOLS() _RESERVED_REGION_APPLY(_RESERVED_SYMBOL_DECLARE) + +/** + * @brief Get the pointer to the reserved-memory region + * + * Example devicetree fragment: + * + * reserved: reserved-memory { + * compatible = "reserved-memory"; + * ... + * n: node { + * reg = <0x42000000 0x1000>; + * }; + * }; + * + * Example usage: + * + * LINKER_DT_RESERVED_MEM_GET_PTR(DT_NODELABEL(n)) // (uint8_t *) 0x42000000 + * + * @param node_id node identifier + * @return pointer to the beginning of the reserved-memory region + */ +#define LINKER_DT_RESERVED_MEM_GET_PTR(node_id) _DT_RESERVED_START(node_id) + +/** + * @brief Get the size of the reserved-memory region + * + * Example devicetree fragment: + * + * reserved: reserved-memory { + * compatible = "reserved-memory"; + * ... + * n: node { + * reg = <0x42000000 0x1000>; + * }; + * }; + * + * Example usage: + * + * LINKER_DT_RESERVED_MEM_GET_SIZE(DT_NODELABEL(n)) // 0x1000 + * + * @param node_id node identifier + * @return the size of the reserved-memory region + */ +#define LINKER_DT_RESERVED_MEM_GET_SIZE(node_id) DT_REG_SIZE(node_id) + +/** + * @brief Get the pointer to the reserved-memory region from a memory-reserved + * phandle + * + * Example devicetree fragment: + * + * reserved: reserved-memory { + * compatible = "reserved-memory"; + * ... + * res0: res { + * reg = <0x42000000 0x1000>; + * label = "res0"; + * }; + * }; + * + * n: node { + * memory-region = <&res0>; + * }; + * + * Example usage: + * + * LINKER_DT_RESERVED_MEM_GET_PTR_BY_PHANDLE(DT_NODELABEL(n), \ + * memory_region) // (uint8_t *) 0x42000000 + * + * @param node_id node identifier + * @param ph phandle to reserved-memory region + * + * @return pointer to the beginning of the reserved-memory region + */ +#define LINKER_DT_RESERVED_MEM_GET_PTR_BY_PHANDLE(node_id, ph) \ + LINKER_DT_RESERVED_MEM_GET_PTR(DT_PHANDLE(node_id, ph)) + +/** + * @brief Get the size of the reserved-memory region from a memory-reserved + * phandle + * + * Example devicetree fragment: + * + * reserved: reserved-memory { + * compatible = "reserved-memory"; + * ... + * res0: res { + * reg = <0x42000000 0x1000>; + * label = "res0"; + * }; + * }; + * + * n: node { + * memory-region = <&res0>; + * }; + * + * Example usage: + * + * LINKER_DT_RESERVED_MEM_GET_SIZE_BY_PHANDLE(DT_NODELABEL(n), \ + * memory_region) // (uint8_t *) 0x42000000 + * + * @param node_id node identifier + * @param ph phandle to reserved-memory region + * + * @return size of the reserved-memory region + */ +#define LINKER_DT_RESERVED_MEM_GET_SIZE_BY_PHANDLE(node_id, ph) \ + LINKER_DT_RESERVED_MEM_GET_SIZE(DT_PHANDLE(node_id, ph)) diff --git a/include/linker/linker-defs.h b/include/linker/linker-defs.h index 715fb4e0dc6d..b005e99428bd 100644 --- a/include/linker/linker-defs.h +++ b/include/linker/linker-defs.h @@ -259,7 +259,7 @@ extern char _vector_start[]; extern char _vector_end[]; #if DT_NODE_HAS_STATUS(_NODE_RESERVED, okay) -DT_RESERVED_MEM_SYMBOLS() +LINKER_DT_RESERVED_MEM_SYMBOLS() #endif #ifdef CONFIG_SW_VECTOR_RELAY diff --git a/include/logging/log_msg2.h b/include/logging/log_msg2.h index 3753aa779ba0..1d80c040413c 100644 --- a/include/logging/log_msg2.h +++ b/include/logging/log_msg2.h @@ -542,7 +542,7 @@ static inline uint32_t log_msg2_get_total_wlen(const struct log_msg2_desc desc) * * @return Length in 32 bit words. */ -static inline uint32_t log_msg2_generic_get_wlen(union mpsc_pbuf_generic *item) +static inline uint32_t log_msg2_generic_get_wlen(const union mpsc_pbuf_generic *item) { union log_msg2_generic *generic_msg = (union log_msg2_generic *)item; diff --git a/include/net/dns_sd.h b/include/net/dns_sd.h index ae2fe2aed0fd..e5f0b09881c9 100644 --- a/include/net/dns_sd.h +++ b/include/net/dns_sd.h @@ -50,6 +50,38 @@ extern "C" { /** RFC 1034 Section 3.1, RFC 6763 Section 7.2 */ #define DNS_SD_DOMAIN_MAX_SIZE 63 +/** + * Minimum number of segments in a fully-qualified name + * + * This reqpresents FQN's of the form below + * ``` + * ._tcp.. + * ``` + * Currently sub-types and service domains are unsupported and only the + * "local" domain is supported. Specifically, that excludes the following: + * ``` + * ._sub.._tcp... + * ``` + * @see RFC 6763, Section 7.2. + */ +#define DNS_SD_MIN_LABELS 3 +/** + * Maximum number of segments in a fully-qualified name + * + * This reqpresents FQN's of the form below + * ``` + * .._tcp.. + * ``` + * + * Currently sub-types and service domains are unsupported and only the + * "local" domain is supported. Specifically, that excludes the following: + * ``` + * ._sub.._tcp... + * ``` + * @see RFC 6763, Section 7.2. + */ +#define DNS_SD_MAX_LABELS 4 + /** * @brief Register a service for DNS Service Discovery * @@ -209,6 +241,12 @@ struct dns_sd_rec { * @internal */ extern const char dns_sd_empty_txt[1]; +/** + * @brief Wildcard Port specifier for DNS-SD + * + * @internal + */ +extern const uint16_t dns_sd_port_zero; /** @endcond */ @@ -223,6 +261,32 @@ static inline size_t dns_sd_txt_size(const struct dns_sd_rec *rec) return rec->text_size; } +/** + * @brief Check if @a rec is a DNS-SD Service Type Enumeration + * + * DNS-SD Service Type Enumeration is used by network tooling to + * acquire a list of all mDNS-advertised services belonging to a + * particular host on a particular domain. + * + * For example, for the domain '.local', the equivalent query + * would be '_services._dns-sd._udp.local'. + * + * Currently, only the '.local' domain is supported. + * + * @see Service Type Enumeration, RFC 6763. + * + * @param rec the record to in question + * @return true if @a rec is a DNS-SD Service Type Enumeration + */ +bool dns_sd_is_service_type_enumeration(const struct dns_sd_rec *rec); + +/** + * @brief Create a wildcard filter for DNS-SD records + * + * @param filter a pointer to the filter to use + */ +void dns_sd_create_wildcard_filter(struct dns_sd_rec *filter); + /** * @} */ diff --git a/include/net/mqtt.h b/include/net/mqtt.h index 8e726bdd28d7..648c2d1915a5 100644 --- a/include/net/mqtt.h +++ b/include/net/mqtt.h @@ -354,6 +354,9 @@ struct mqtt_sec_config { * May be NULL to skip hostname verification. */ const char *hostname; + + /** Indicates the preference for enabling TLS session caching. */ + int session_cache; }; /** @brief MQTT transport type. */ diff --git a/include/net/net_l2.h b/include/net/net_l2.h index 515249f0be27..0bbf777286a1 100644 --- a/include/net/net_l2.h +++ b/include/net/net_l2.h @@ -121,6 +121,12 @@ NET_L2_DECLARE_PUBLIC(BLUETOOTH_L2); NET_L2_DECLARE_PUBLIC(OPENTHREAD_L2); #endif /* CONFIG_NET_L2_OPENTHREAD */ +#ifdef CONFIG_NET_L2_ZIGBEE +#define ZIGBEE_L2 ZIGBEE +#define ZIGBEE_L2_CTX_TYPE void* +NET_L2_DECLARE_PUBLIC(ZIGBEE_L2); +#endif /* CONFIG_NET_L2_ZIGBEE */ + #ifdef CONFIG_NET_L2_CANBUS_RAW #define CANBUS_RAW_L2 CANBUS_RAW #define CANBUS_RAW_L2_CTX_TYPE void* diff --git a/include/net/socket.h b/include/net/socket.h index 2ef26ab730cf..935c91aefc0d 100644 --- a/include/net/socket.h +++ b/include/net/socket.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #ifdef __cplusplus @@ -880,12 +881,14 @@ struct net_socket_register { int (*handler)(int family, int type, int proto); }; -#define NET_SOCKET_GET_NAME(socket_name) \ - (__net_socket_register_##socket_name) +#define NET_SOCKET_DEFAULT_PRIO CONFIG_NET_SOCKETS_PRIORITY_DEFAULT -#define NET_SOCKET_REGISTER(socket_name, _family, _is_supported, _handler) \ +#define NET_SOCKET_GET_NAME(socket_name, prio) \ + (__net_socket_register_##prio##_##socket_name) + +#define NET_SOCKET_REGISTER(socket_name, prio, _family, _is_supported, _handler) \ static const STRUCT_SECTION_ITERABLE(net_socket_register, \ - NET_SOCKET_GET_NAME(socket_name)) = { \ + NET_SOCKET_GET_NAME(socket_name, prio)) = { \ .family = _family, \ .is_supported = _is_supported, \ .handler = _handler, \ diff --git a/include/net/socket_ncs.h b/include/net/socket_ncs.h new file mode 100644 index 000000000000..b9b6d4d3ddd5 --- /dev/null +++ b/include/net/socket_ncs.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ +#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ + +/** + * @file + * @brief NCS specific additions to the BSD sockets API definitions + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* NCS specific protocol/address families. */ + +#define PF_LTE 102 /**< Protocol family specific to LTE. */ +#define AF_LTE PF_LTE /**< Address family specific to LTE. */ + +/* NCS specific protocol types. */ + +/** Protocol numbers for LTE protocols */ +enum net_lte_protocol { + NPROTO_AT = 513, +}; + +/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence + * when creating a new socket. Combine this flag with a socket type when + * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). + * If it's desired to create a native TLS socket, but still offload the + * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. + */ +#define SOCK_NATIVE 0x80000000 +#define SOCK_NATIVE_TLS 0x40000000 + +/* NCS specific TLS options */ + +/** Socket option to control TLS session caching. Accepted values: + * - 0 - Disabled. + * - 1 - Enabled. + */ +#define TLS_SESSION_CACHE 10 +/** Socket option to purge session cache immediately. + * This option accepts any value. + */ +#define TLS_SESSION_CACHE_PURGE 11 +/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. + * The option accepts an integer, indicating the total handshake timeout, + * including retransmissions, in seconds. + * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. + */ +#define TLS_DTLS_HANDSHAKE_TIMEO 12 + +/* Valid values for TLS_SESSION_CACHE option */ +#define TLS_SESSION_CACHE_DISABLED 0 /**< Disable TLS session caching. */ +#define TLS_SESSION_CACHE_ENABLED 1 /**< Enable TLS session caching. */ + +/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ +#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ +#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ + +/* NCS specific socket options */ + +/** sockopt: disable all replies to unexpected traffics */ +#define SO_SILENCE_ALL 30 +/** sockopt: disable IPv4 ICMP replies */ +#define SO_IP_ECHO_REPLY 31 +/** sockopt: disable IPv6 ICMP replies */ +#define SO_IPV6_ECHO_REPLY 32 +/** sockopt: Release Assistance Indication feature: This will indicate that the + * next call to send/sendto will be the last one for some time. + */ +#define SO_RAI_LAST 50 +/** sockopt: Release Assistance Indication feature: This will indicate that the + * application will not send any more data. + */ +#define SO_RAI_NO_DATA 51 +/** sockopt: Release Assistance Indication feature: This will indicate that + * after the next call to send/sendto, the application is expecting to receive + * one more data packet before this socket will not be used again for some time. + */ +#define SO_RAI_ONE_RESP 52 +/** sockopt: Release Assistance Indication feature: If a client application + * expects to use the socket more it can indicate that by setting this socket + * option before the next send call which will keep the network up longer. + */ +#define SO_RAI_ONGOING 53 +/** sockopt: Release Assistance Indication feature: If a server application + * expects to use the socket more it can indicate that by setting this socket + * option before the next send call. + */ +#define SO_RAI_WAIT_MORE 54 +/** sockopt: Configurable TCP server session timeout in minutes. + * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). + */ +#define SO_TCP_SRV_SESSTIMEO 55 + +/* NCS specific gettaddrinfo() flags */ + +/** Assume `service` contains a Packet Data Network (PDN) ID. + * When specified together with the AI_NUMERICSERV flag, + * `service` shall be formatted as follows: "port:pdn_id" + * where "port" is the port number and "pdn_id" is the PDN ID. + * Example: "8080:1", port 8080 PDN ID 1. + * Example: "42:0", port 42 PDN ID 0. + */ +#define AI_PDNSERV 0x1000 + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ diff --git a/include/net/wifi.h b/include/net/wifi.h index 38bd3a938366..2df112c1b958 100644 --- a/include/net/wifi.h +++ b/include/net/wifi.h @@ -19,6 +19,7 @@ enum wifi_security_type { #define WIFI_SSID_MAX_LEN 32 #define WIFI_PSK_MAX_LEN 64 +#define WIFI_MAC_ADDR_LEN 6 #define WIFI_CHANNEL_MAX 14 #define WIFI_CHANNEL_ANY 255 diff --git a/include/net/wifi_mgmt.h b/include/net/wifi_mgmt.h index 5736890865f3..ad54e009c099 100644 --- a/include/net/wifi_mgmt.h +++ b/include/net/wifi_mgmt.h @@ -91,6 +91,9 @@ struct wifi_scan_result { uint8_t channel; enum wifi_security_type security; int8_t rssi; + + uint8_t mac[WIFI_MAC_ADDR_LEN]; + uint8_t mac_length; }; struct wifi_connect_req_params { diff --git a/include/storage/flash_map.h b/include/storage/flash_map.h index aea59568e7ed..6c900ede293c 100644 --- a/include/storage/flash_map.h +++ b/include/storage/flash_map.h @@ -256,6 +256,10 @@ const struct device *flash_area_get_device(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + #define FLASH_AREA_LABEL_EXISTS(label) \ DT_HAS_FIXED_PARTITION_LABEL(label) @@ -271,6 +275,18 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FLASH_AREA_SIZE(label) \ DT_REG_SIZE(DT_NODE_BY_FIXED_PARTITION_LABEL(label)) +/** + * Get device pointer for device the area/partition resides on + * + * @param label partition label + * + * @return const struct device type pointer + */ +#define FLASH_AREA_DEVICE(label) \ + DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODE_BY_FIXED_PARTITION_LABEL(label))) + +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/include/sys/mpsc_pbuf.h b/include/sys/mpsc_pbuf.h index 931dc7ab0a38..420eba9aab80 100644 --- a/include/sys/mpsc_pbuf.h +++ b/include/sys/mpsc_pbuf.h @@ -69,7 +69,7 @@ struct mpsc_pbuf_buffer; * * @return Size of the packet in 32 bit words. */ -typedef uint32_t (*mpsc_pbuf_get_wlen)(union mpsc_pbuf_generic *packet); +typedef uint32_t (*mpsc_pbuf_get_wlen)(const union mpsc_pbuf_generic *packet); /** @brief Callback called when packet is dropped. * @@ -77,8 +77,8 @@ typedef uint32_t (*mpsc_pbuf_get_wlen)(union mpsc_pbuf_generic *packet); * * @param packet Packet that is being dropped. */ -typedef void (*mpsc_pbuf_notify_drop)(struct mpsc_pbuf_buffer *buffer, - union mpsc_pbuf_generic *packet); +typedef void (*mpsc_pbuf_notify_drop)(const struct mpsc_pbuf_buffer *buffer, + const union mpsc_pbuf_generic *packet); /** @brief MPSC packet buffer structure. */ struct mpsc_pbuf_buffer { @@ -179,7 +179,7 @@ void mpsc_pbuf_commit(struct mpsc_pbuf_buffer *buffer, * and data on remaining bits. */ void mpsc_pbuf_put_word(struct mpsc_pbuf_buffer *buffer, - union mpsc_pbuf_generic word); + const union mpsc_pbuf_generic word); /** @brief Put a packet consisting of a word and a pointer. * * @@ -194,7 +194,8 @@ void mpsc_pbuf_put_word(struct mpsc_pbuf_buffer *buffer, * @param data User data. */ void mpsc_pbuf_put_word_ext(struct mpsc_pbuf_buffer *buffer, - union mpsc_pbuf_generic word, void *data); + const union mpsc_pbuf_generic word, + const void *data); /** @brief Put a packet into a buffer. * @@ -203,18 +204,20 @@ void mpsc_pbuf_put_word_ext(struct mpsc_pbuf_buffer *buffer, * * @param buffer Buffer. * - * @param data First word of data must contain MPSC_PBUF_HDR with valid set. + * @param data First word of data must contain MPSC_PBUF_HDR with valid bit set. * * @param wlen Packet size in words. */ void mpsc_pbuf_put_data(struct mpsc_pbuf_buffer *buffer, - uint32_t *data, size_t wlen); + const uint32_t *data, size_t wlen); /** @brief Claim the first pending packet. * * @param buffer Buffer. + * + * @return Pointer to the claimed packet or null if none available. */ -union mpsc_pbuf_generic *mpsc_pbuf_claim(struct mpsc_pbuf_buffer *buffer); +const union mpsc_pbuf_generic *mpsc_pbuf_claim(struct mpsc_pbuf_buffer *buffer); /** @brief Free a packet. * diff --git a/include/tracing/tracing.h b/include/tracing/tracing.h index db7a93efba36..dc983e8e56c9 100644 --- a/include/tracing/tracing.h +++ b/include/tracing/tracing.h @@ -156,6 +156,18 @@ */ #define sys_port_trace_k_thread_abort(thread) +/** + * @brief Called when a thread enters the k_thread_abort routine + * @param thread Thread object + */ +#define sys_port_trace_k_thread_abort_enter(thread) + +/** + * @brief Called when a thread exits the k_thread_abort routine + * @param thread Thread object + */ +#define sys_port_trace_k_thread_abort_exit(thread) + /** * @brief Called when setting priority of a thread * @param thread Thread object diff --git a/include/usb/usb_device.h b/include/usb/usb_device.h index 727973e9293d..8884c8afbbed 100644 --- a/include/usb/usb_device.h +++ b/include/usb/usb_device.h @@ -433,6 +433,13 @@ bool usb_transfer_is_busy(uint8_t ep); */ int usb_wakeup_request(void); +/** + * @brief Get status of the USB remote wakeup feature + * + * @return true if remote wakeup has been enabled by the host, false otherwise. + */ +bool usb_get_remote_wakeup_status(void); + /** * @} */ diff --git a/kernel/Kconfig b/kernel/Kconfig index cb5c7379a9c7..c2575c77a50e 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -288,6 +288,22 @@ config WAITQ_DUMB endchoice # WAITQ_ALGORITHM +config DEVICE_HANDLE_PADDING + int "Number of additional device handles to use for padding" + default 0 + range 0 10 + help + This is a "fudge factor" which works around build system + limitations. It is safe to ignore unless you get a specific + build system error about it. + + The option's value is the number of superfluous device handle + values which are introduced into the array pointed to by each + device's 'handles' member during the first linker pass. + + Each handle uses 2 bytes, so a value of 3 would use an extra + 6 bytes of ROM for every device. + menu "Kernel Debugging and Metrics" config INIT_STACKS diff --git a/kernel/device.c b/kernel/device.c index 229cb8d1c430..49564849c690 100644 --- a/kernel/device.c +++ b/kernel/device.c @@ -162,11 +162,14 @@ bool z_device_ready(const struct device *dev) return dev->state->initialized && (dev->state->init_res == 0U); } -static int device_visitor(const device_handle_t *handles, - size_t handle_count, - device_visitor_callback_t visitor_cb, - void *context) +int device_required_foreach(const struct device *dev, + device_visitor_callback_t visitor_cb, + void *context) { + size_t handle_count = 0; + const device_handle_t *handles = + device_required_handles_get(dev, &handle_count); + /* Iterate over fixed devices */ for (size_t i = 0; i < handle_count; ++i) { device_handle_t dh = handles[i]; @@ -180,25 +183,3 @@ static int device_visitor(const device_handle_t *handles, return handle_count; } - -int device_required_foreach(const struct device *dev, - device_visitor_callback_t visitor_cb, - void *context) -{ - size_t handle_count = 0; - const device_handle_t *handles = - device_required_handles_get(dev, &handle_count); - - return device_visitor(handles, handle_count, visitor_cb, context); -} - -int device_supported_foreach(const struct device *dev, - device_visitor_callback_t visitor_cb, - void *context) -{ - size_t handle_count = 0; - const device_handle_t *handles = - device_supported_handles_get(dev, &handle_count); - - return device_visitor(handles, handle_count, visitor_cb, context); -} diff --git a/kernel/timer.c b/kernel/timer.c index 5221e2ad377a..f2f3a11d9456 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -26,6 +26,7 @@ void z_timer_expiration_handler(struct _timeout *t) { struct k_timer *timer = CONTAINER_OF(t, struct k_timer, timeout); struct k_thread *thread; + k_spinlock_key_t key = k_spin_lock(&lock); /* * if the timer is periodic, start it again; don't add _TICK_ALIGN @@ -46,27 +47,23 @@ void z_timer_expiration_handler(struct _timeout *t) } if (!IS_ENABLED(CONFIG_MULTITHREADING)) { + k_spin_unlock(&lock, key); return; } thread = z_waitq_head(&timer->wait_q); if (thread == NULL) { + k_spin_unlock(&lock, key); return; } - /* - * Interrupts _DO NOT_ have to be locked in this specific - * instance of thread unpending because a) this is the only - * place a thread can be taken off this pend queue, and b) the - * only place a thread can be put on the pend queue is at - * thread level, which of course cannot interrupt the current - * context. - */ z_unpend_thread_no_timeout(thread); arch_thread_return_value_set(thread, 0); + k_spin_unlock(&lock, key); + z_ready_thread(thread); } diff --git a/lib/libc/minimal/include/ctype.h b/lib/libc/minimal/include/ctype.h index 83675bf6cbb9..f9a4bdf7b4c4 100644 --- a/lib/libc/minimal/include/ctype.h +++ b/lib/libc/minimal/include/ctype.h @@ -69,6 +69,11 @@ static inline int isalnum(int chr) return (int)(isalpha(chr) || isdigit(chr)); } +static inline int iscntrl(int c) +{ + return (int)((((unsigned int)c) <= 31U) || (((unsigned int)c) == 127U)); +} + #ifdef __cplusplus } #endif diff --git a/lib/os/mpsc_pbuf.c b/lib/os/mpsc_pbuf.c index 936b8d107f01..3ef516a55991 100644 --- a/lib/os/mpsc_pbuf.c +++ b/lib/os/mpsc_pbuf.c @@ -185,7 +185,7 @@ static union mpsc_pbuf_generic *drop_item_locked(struct mpsc_pbuf_buffer *buffer } void mpsc_pbuf_put_word(struct mpsc_pbuf_buffer *buffer, - union mpsc_pbuf_generic item) + const union mpsc_pbuf_generic item) { bool cont; uint32_t free_wlen; @@ -305,7 +305,8 @@ void mpsc_pbuf_commit(struct mpsc_pbuf_buffer *buffer, } void mpsc_pbuf_put_word_ext(struct mpsc_pbuf_buffer *buffer, - union mpsc_pbuf_generic item, void *data) + const union mpsc_pbuf_generic item, + const void *data) { static const size_t l = (sizeof(item) + sizeof(data)) / sizeof(uint32_t); @@ -327,7 +328,7 @@ void mpsc_pbuf_put_word_ext(struct mpsc_pbuf_buffer *buffer, void **p = (void **)&buffer->buf[buffer->tmp_wr_idx + 1]; - *p = data; + *p = (void *)data; buffer->tmp_wr_idx = idx_inc(buffer, buffer->tmp_wr_idx, l); buffer->wr_idx = idx_inc(buffer, buffer->wr_idx, l); @@ -352,7 +353,7 @@ void mpsc_pbuf_put_word_ext(struct mpsc_pbuf_buffer *buffer, } while (cont); } -void mpsc_pbuf_put_data(struct mpsc_pbuf_buffer *buffer, uint32_t *data, +void mpsc_pbuf_put_data(struct mpsc_pbuf_buffer *buffer, const uint32_t *data, size_t wlen) { bool cont; @@ -395,7 +396,7 @@ void mpsc_pbuf_put_data(struct mpsc_pbuf_buffer *buffer, uint32_t *data, } while (cont); } -union mpsc_pbuf_generic *mpsc_pbuf_claim(struct mpsc_pbuf_buffer *buffer) +const union mpsc_pbuf_generic *mpsc_pbuf_claim(struct mpsc_pbuf_buffer *buffer) { union mpsc_pbuf_generic *item; bool cont; diff --git a/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_lp_timer_zephyr.c b/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_lp_timer_zephyr.c index 6ecc2042fb1b..9fc0306dc89b 100644 --- a/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_lp_timer_zephyr.c +++ b/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_lp_timer_zephyr.c @@ -15,51 +15,146 @@ #include "platform/nrf_802154_clock.h" #include "nrf_802154_sl_utils.h" +struct timer_desc { + z_nrf_rtc_timer_compare_handler_t handler; + uint64_t target_time; + int32_t chan; + int32_t int_lock_key; + bool is_running; +}; + +static struct timer_desc m_timer; +static struct timer_desc m_sync_timer; static volatile bool m_clock_ready; -static bool m_is_running; -static int32_t m_rtc_channel; static bool m_in_critical_section; -void rtc_irq_handler(int32_t id, uint32_t cc_value, void *user_data) +/** + * @brief RTC IRQ handler for LP timer channel. + */ +void timer_handler(int32_t id, uint64_t expire_time, void *user_data) { - (void)cc_value; + (void)expire_time; (void)user_data; - nrf_802154_sl_mcu_critical_state_t state; - assert(id == m_rtc_channel); + assert(id == m_timer.chan); - nrf_802154_sl_mcu_critical_enter(state); + m_timer.is_running = false; - m_is_running = false; - (void)z_nrf_rtc_timer_compare_int_lock(m_rtc_channel); + nrf_802154_lp_timer_fired(); +} - nrf_802154_sl_mcu_critical_exit(state); +/** + * @brief RTC IRQ handler for synchronization timer channel. + */ +void sync_timer_handler(int32_t id, uint64_t expire_time, void *user_data) +{ + (void)user_data; - nrf_802154_lp_timer_fired(); + assert(id == m_sync_timer.chan); + + m_sync_timer.is_running = false; + /** + * Expire time might have been different than the desired target + * time. Update it so that a more accurate value can be returned + * by nrf_802154_lp_timer_sync_time_get. + */ + m_sync_timer.target_time = NRF_802154_SL_RTC_TICKS_TO_US(expire_time); + + nrf_802154_lp_timer_synchronized(); +} + +/** + * @brief Convert 32-bit target time to absolute 64-bit target time. + */ +uint64_t target_time_convert_to_64_bits(uint32_t t0, uint32_t dt) +{ + /** + * Target time is provided as two 32-bit integers defining a moment in time + * in microsecond domain. In order to use bit-shifting instead of modulo + * division, calculations are performed in microsecond domain, not in RTC ticks. + * + * Maximum possible value of target time specified with two 32-bit unsigned + * integers is equal 2 * (2^32 - 1), or 2^33 - 2. However, instead of extending + * the bit-width to 64 to fit that number, let the addition of t0 and dt + * overflow at 32 bits. + * + * The target time can point to a moment in the future, but can be overdue + * as well. In order to determine what's the case and correctly set the + * absolute target time, it's necessary to compare the least significant + * 32 bits of the current time, 64-bit time with the provided 32-bit target + * time. Let's assume that half of the 32-bit range can be used for specifying + * target times in the future, and the other half - in the past. + */ + uint64_t now_us = NRF_802154_SL_RTC_TICKS_TO_US(z_nrf_rtc_timer_read()); + uint32_t now_us_wrapped = (uint32_t)now_us; + uint32_t target_time_us_wrapped = (uint32_t)(t0 + dt); + uint32_t time_diff = target_time_us_wrapped - now_us_wrapped; + uint64_t result = UINT64_C(0); + + if (time_diff < 0x80000000) { + /** + * Target time is assumed to be in the future. Check if a 32-bit overflow + * occurs between the current time and the target time. + */ + if (now_us_wrapped > target_time_us_wrapped) { + /** + * Add a 32-bit overflow and replace the least significant 32 bits + * with the provided target time. + */ + result = now_us + UINT32_MAX + 1; + result &= ~(uint64_t)UINT32_MAX; + result |= target_time_us_wrapped; + } else { + /** + * Leave the most significant 32 bits and replace the least significant + * 32 bits with the provided target time. + */ + result = (now_us & (~(uint64_t)UINT32_MAX)) | target_time_us_wrapped; + } + } else { + /** + * Target time is assumed to be in the past. Check if a 32-bit overflow + * occurs between the target time and the current time. + */ + if (now_us_wrapped > target_time_us_wrapped) { + /** + * Leave the most significant 32 bits and replace the least significant + * 32 bits with the provided target time. + */ + result = (now_us & (~(uint64_t)UINT32_MAX)) | target_time_us_wrapped; + } else { + /** + * Subtract a 32-bit overflow and replace the least significant + * 32 bits with the provided target time. + */ + result = now_us - (UINT32_MAX + 1); + result &= ~(uint64_t)UINT32_MAX; + result |= target_time_us_wrapped; + } + } + + /* Convert the result from microseconds domain to RTC ticks domain. */ + return NRF_802154_SL_US_TO_RTC_TICKS(result); } /** * @brief Start one-shot timer that expires at specified time on desired channel. * - * Start one-shot timer that will expire @p dt microseconds after @p t0 time on channel @p channel. + * Start one-shot timer that will expire when @p target_time is reached on channel @p channel. * - * @param[in] channel Compare channel on which timer will be started. - * @param[in] t0 Number of microseconds representing timer start time. - * @param[in] dt Time of timer expiration as time elapsed from @p t0 [us]. + * @param[inout] timer Pointer to descriptor of timer to set. + * @param[in] target_time Absolute target time in microseconds. */ -static void timer_start_at(uint32_t channel, - uint32_t t0, - uint32_t dt) +static void timer_start_at(struct timer_desc *timer, uint64_t target_time) { - uint32_t cc_value = NRF_802154_SL_US_TO_RTC_TICKS(t0 + dt); nrf_802154_sl_mcu_critical_state_t state; - z_nrf_rtc_timer_compare_set(m_rtc_channel, cc_value, rtc_irq_handler, NULL); + z_nrf_rtc_timer_set(timer->chan, target_time, timer->handler, NULL); nrf_802154_sl_mcu_critical_enter(state); - m_is_running = true; - z_nrf_rtc_timer_compare_int_unlock(m_rtc_channel, (m_in_critical_section == false)); + timer->is_running = true; + timer->target_time = NRF_802154_SL_RTC_TICKS_TO_US(target_time); nrf_802154_sl_mcu_critical_exit(state); } @@ -72,7 +167,10 @@ void nrf_802154_clock_lfclk_ready(void) void nrf_802154_lp_timer_init(void) { m_in_critical_section = false; - m_is_running = false; + m_timer.is_running = false; + m_timer.handler = timer_handler; + m_sync_timer.is_running = false; + m_sync_timer.handler = sync_timer_handler; /* Setup low frequency clock. */ nrf_802154_clock_lfclk_start(); @@ -81,20 +179,27 @@ void nrf_802154_lp_timer_init(void) /* Intentionally empty */ } - m_rtc_channel = z_nrf_rtc_timer_chan_alloc(); - if (m_rtc_channel < 0) { + m_timer.chan = z_nrf_rtc_timer_chan_alloc(); + if (m_timer.chan < 0) { assert(false); return; } - (void)z_nrf_rtc_timer_compare_int_lock(m_rtc_channel); + m_sync_timer.chan = z_nrf_rtc_timer_chan_alloc(); + if (m_sync_timer.chan < 0) { + assert(false); + return; + } } void nrf_802154_lp_timer_deinit(void) { - (void)z_nrf_rtc_timer_compare_int_lock(m_rtc_channel); + (void)z_nrf_rtc_timer_compare_int_lock(m_timer.chan); + + nrf_802154_lp_timer_sync_stop(); - z_nrf_rtc_timer_chan_free(m_rtc_channel); + z_nrf_rtc_timer_chan_free(m_timer.chan); + z_nrf_rtc_timer_chan_free(m_sync_timer.chan); nrf_802154_clock_lfclk_stop(); } @@ -106,7 +211,8 @@ void nrf_802154_lp_timer_critical_section_enter(void) nrf_802154_sl_mcu_critical_enter(state); if (!m_in_critical_section) { - (void)z_nrf_rtc_timer_compare_int_lock(m_rtc_channel); + m_timer.int_lock_key = z_nrf_rtc_timer_compare_int_lock(m_timer.chan); + m_sync_timer.int_lock_key = z_nrf_rtc_timer_compare_int_lock(m_sync_timer.chan); m_in_critical_section = true; } @@ -121,15 +227,15 @@ void nrf_802154_lp_timer_critical_section_exit(void) m_in_critical_section = false; - z_nrf_rtc_timer_compare_int_unlock(m_rtc_channel, m_is_running); + z_nrf_rtc_timer_compare_int_unlock(m_timer.chan, m_timer.int_lock_key); + z_nrf_rtc_timer_compare_int_unlock(m_sync_timer.chan, m_sync_timer.int_lock_key); nrf_802154_sl_mcu_critical_exit(state); } uint32_t nrf_802154_lp_timer_time_get(void) { - /* Please note that this function does not handle RTC overflow */ - return NRF_802154_SL_RTC_TICKS_TO_US(z_nrf_rtc_timer_read()); + return (uint32_t)NRF_802154_SL_RTC_TICKS_TO_US(z_nrf_rtc_timer_read()); } uint32_t nrf_802154_lp_timer_granularity_get(void) @@ -139,12 +245,15 @@ uint32_t nrf_802154_lp_timer_granularity_get(void) void nrf_802154_lp_timer_start(uint32_t t0, uint32_t dt) { - timer_start_at(m_rtc_channel, t0, dt); + uint64_t target_time = target_time_convert_to_64_bits(t0, dt); + + timer_start_at(&m_timer, target_time); } bool nrf_802154_lp_timer_is_running(void) { - return m_is_running; + /* We're not interested here if synchronization timer is running. */ + return m_timer.is_running; } void nrf_802154_lp_timer_stop(void) @@ -153,39 +262,42 @@ void nrf_802154_lp_timer_stop(void) nrf_802154_sl_mcu_critical_enter(state); - m_is_running = false; - (void)z_nrf_rtc_timer_compare_int_lock(m_rtc_channel); + m_timer.is_running = false; nrf_802154_sl_mcu_critical_exit(state); } void nrf_802154_lp_timer_sync_start_now(void) { - /* Currently not supported */ + uint64_t now = z_nrf_rtc_timer_read(); + + /** + * Despite this function's name, synchronization is not expected to be + * scheduled for the current tick. Add a safe 3-tick margin + */ + timer_start_at(&m_sync_timer, now + 3); } void nrf_802154_lp_timer_sync_start_at(uint32_t t0, uint32_t dt) { - (void)t0; - (void)dt; - /* Currently not supported */ + uint64_t target_time = target_time_convert_to_64_bits(t0, dt); + + timer_start_at(&m_sync_timer, target_time); } void nrf_802154_lp_timer_sync_stop(void) { - /* Currently not supported */ + z_nrf_rtc_timer_abort(m_sync_timer.chan); } uint32_t nrf_802154_lp_timer_sync_event_get(void) { - /* Currently not supported */ - return 0; + return z_nrf_rtc_timer_compare_evt_address_get(m_sync_timer.chan); } uint32_t nrf_802154_lp_timer_sync_time_get(void) { - /* Currently not supported */ - return 0; + return m_sync_timer.target_time; } #ifndef UNITY_ON_TARGET diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 9af6ee81929d..4860f1ea3717 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -38,6 +38,8 @@ zephyr_compile_definitions_ifdef(CONFIG_NRF_SECURE_APPROTECT_LOCK ENABLE_SECURE_APPROTECT) zephyr_compile_definitions_ifdef(CONFIG_NRF_SECURE_APPROTECT_USER_HANDLING ENABLE_SECURE_APPROTECT_USER_HANDLING) +zephyr_library_compile_definitions_ifdef(CONFIG_NRF_TRACE_PORT + ENABLE_TRACE) # Connect Kconfig compilation option for Non-Secure software with option required by MDK/nrfx zephyr_compile_definitions_ifdef(CONFIG_ARM_NONSECURE_FIRMWARE NRF_TRUSTZONE_NONSECURE) diff --git a/modules/hal_nxp/usb/CMakeLists.txt b/modules/hal_nxp/usb/CMakeLists.txt index 83324e3173da..380aa3aef87a 100644 --- a/modules/hal_nxp/usb/CMakeLists.txt +++ b/modules/hal_nxp/usb/CMakeLists.txt @@ -3,6 +3,4 @@ # # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() - zephyr_include_directories(.) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index a7183c20e996..af4c5f793bc0 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -35,8 +35,7 @@ if(CONFIG_ARCH_POSIX AND CONFIG_ASAN AND NOT CONFIG_64BIT) endif () zephyr_library_link_libraries(mbedTLS) -else() - assert(CONFIG_MBEDTLS_LIBRARY "MBEDTLS was enabled, but neither BUILTIN or LIBRARY was selected.") +elseif (CONFIG_MBEDTLS_LIBRARY) # NB: CONFIG_MBEDTLS_LIBRARY is not regression tested and is # therefore susceptible to bit rot @@ -53,6 +52,10 @@ else() # Lib mbedtls_external depends on libgcc (I assume?) so to allow # mbedtls_external to link with gcc we need to ensure it is placed # after mbedtls_external on the linkers command line. +else() + # If none of either CONFIG_MBEDTLS_BUILTIN or CONFIG_MBEDTLS_LIBRARY + # are defined the users need to manually add the mbedtls library and + # included the required directories for mbedtls in their projects. endif() endif() diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 2d091b44f0ee..6e0e125dad71 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -23,8 +23,8 @@ set(TFM_CRYPTO_MODULES CRYPTO_MAC_MODULE CRYPTO_HASH_MODULE CRYPTO_CIPHER_MODULE - CRYPTO_GENERATOR_MODULE - CRYPTO_ASYMMETRIC_MODULE + CRYPTO_ASYM_ENCRYPT_MODULE + CRYPTO_ASYM_SIGN_MODULE CRYPTO_KEY_DERIVATION_MODULE ) @@ -205,12 +205,22 @@ if (CONFIG_BUILD_WITH_TFM) include(ExternalProject) + if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Windows) + # Set number of parallel jobs for TF-M build to 1. + # In some circumstances it has been experienced that building TF-M with + # multiple parallel jobs then `permission denied` may occur. Root cause on + # Windows has not been identified but current suspicion is around folder / + # file lock mechanism. To ensure correct behaviour in all cases, limit + # number of parallel jobs to 1. + set(PARALLEL_JOBS -j 1) + endif() + ExternalProject_Add( tfm SOURCE_DIR ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m BINARY_DIR ${TFM_BINARY_DIR} CONFIGURE_COMMAND "" - BUILD_COMMAND ${CMAKE_COMMAND} --build . + BUILD_COMMAND ${CMAKE_COMMAND} --build . ${PARALLEL_JOBS} INSTALL_COMMAND ${CMAKE_COMMAND} --install . BUILD_ALWAYS True USES_TERMINAL_BUILD True diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 92aadf519064..45ff11fc53b5 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -141,9 +141,12 @@ config TFM_ISOLATION_LEVEL config TFM_BL2 bool "Add MCUboot to TFM" default y + depends on !NORDIC_SECURITY_BACKEND help TFM is designed to run with MCUboot in a certain configuration. This config adds MCUboot to the build - built via TFM's build system. + We currently do not support builds with MCUboot and TF-M if the + Nordic Security backend is used. if TFM_BL2 diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 37aca7b5c28f..f2c1a73931ef 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -54,20 +54,20 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED Unset this option if the functionality provided by 'crypto_cipher.c' is not used. -config TFM_CRYPTO_GENERATOR_MODULE_ENABLED - bool "Enable GENERATOR crypto module" +config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED + bool "Enable ASYM ENCRYPT crypto module" default y help - Enables the GENERATOR crypto module within the crypto partition. - Unset this option if the key generation, generate, raw key and - key derivation features from 'tfm_crypto_secure_api.c' is not used. + Enables the ASYM ENCRYPT crypto module within the crypto partition. + Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' + is not used. -config TFM_CRYPTO_ASYMMETRIC_MODULE_ENABLED - bool "Enable ASYMMETRIC crypto module" +config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED + bool "Enable ASYM SIGN crypto module" default y help - Enables the ASYMMETRIC crypto module within the crypto partition. - Unset this option if the functionality provided by 'crypto_asymmetric.c' + Enables the ASYM SIGN crypto module within the crypto partition. + Unset this option if the sign functionality provided by 'crypto_asymmetric.c' is not used. config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED diff --git a/samples/bluetooth/direction_finding_connectionless_rx/src/main.c b/samples/bluetooth/direction_finding_connectionless_rx/src/main.c index 1b1d1c4c0009..a2712d9065e9 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/src/main.c +++ b/samples/bluetooth/direction_finding_connectionless_rx/src/main.c @@ -209,7 +209,8 @@ static void create_sync(void) printk("Creating Periodic Advertising Sync..."); bt_addr_le_copy(&sync_create_param.addr, &per_addr); - sync_create_param.options = 0; + + sync_create_param.options = BT_LE_PER_ADV_SYNC_OPT_SYNC_ONLY_CONST_TONE_EXT; sync_create_param.sid = per_sid; sync_create_param.skip = 0; sync_create_param.timeout = 0xa; diff --git a/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf new file mode 100644 index 000000000000..e6749ae63990 --- /dev/null +++ b/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf @@ -0,0 +1 @@ +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y diff --git a/samples/boards/96b_argonkey/sensors/src/main.c b/samples/boards/96b_argonkey/sensors/src/main.c index d8ca8c72bf2a..04bc437ec8e6 100644 --- a/samples/boards/96b_argonkey/sensors/src/main.c +++ b/samples/boards/96b_argonkey/sensors/src/main.c @@ -28,7 +28,7 @@ static inline float out_ev(struct sensor_value *val) static int lsm6dsl_trig_cnt; #ifdef CONFIG_LSM6DSL_TRIGGER static void lsm6dsl_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { #ifdef ARGONKEY_TEST_LOG char out_str[64]; diff --git a/samples/boards/qemu_cortex_a53/reserved_memory/linker_arm64_reserved.ld b/samples/boards/qemu_cortex_a53/reserved_memory/linker_arm64_reserved.ld index 89929d7c0e17..0906faadfad0 100644 --- a/samples/boards/qemu_cortex_a53/reserved_memory/linker_arm64_reserved.ld +++ b/samples/boards/qemu_cortex_a53/reserved_memory/linker_arm64_reserved.ld @@ -13,12 +13,12 @@ MEMORY { - DT_RESERVED_MEM_REGIONS() + LINKER_DT_RESERVED_MEM_REGIONS() } SECTIONS { - DT_RESERVED_MEM_SECTIONS() + LINKER_DT_RESERVED_MEM_SECTIONS() } #include diff --git a/samples/boards/qemu_cortex_a53/reserved_memory/src/main.c b/samples/boards/qemu_cortex_a53/reserved_memory/src/main.c index 5370b3964a5b..306bd866cf8d 100644 --- a/samples/boards/qemu_cortex_a53/reserved_memory/src/main.c +++ b/samples/boards/qemu_cortex_a53/reserved_memory/src/main.c @@ -5,7 +5,6 @@ */ #include -#include #include /* Variables placed in reserved sections */ @@ -18,17 +17,17 @@ void main(void) uint32_t res_size_outer, res_size_inner; res_ptr_outer = - DT_RESERVED_MEM_GET_PTR_BY_PHANDLE(DT_NODELABEL(sample_driver_outer), - memory_region); + LINKER_DT_RESERVED_MEM_GET_PTR_BY_PHANDLE(DT_NODELABEL(sample_driver_outer), + memory_region); res_size_outer = - DT_RESERVED_MEM_GET_SIZE_BY_PHANDLE(DT_NODELABEL(sample_driver_outer), - memory_region); + LINKER_DT_RESERVED_MEM_GET_SIZE_BY_PHANDLE(DT_NODELABEL(sample_driver_outer), + memory_region); printk("Reserved memory address for the outer driver: %p\n", res_ptr_outer); printk("Reserved memory size for the outer driver: %d\n", res_size_outer); - res_ptr_inner = DT_RESERVED_MEM_GET_PTR(DT_NODELABEL(res1)); - res_size_inner = DT_RESERVED_MEM_GET_SIZE(DT_NODELABEL(res1)); + res_ptr_inner = LINKER_DT_RESERVED_MEM_GET_PTR(DT_NODELABEL(res1)); + res_size_inner = LINKER_DT_RESERVED_MEM_GET_SIZE(DT_NODELABEL(res1)); printk("Reserved memory address for the inner driver: %p\n", res_ptr_inner); printk("Reserved memory size for the inner driver: %d\n", res_size_inner); diff --git a/samples/boards/reel_board/mesh_badge/src/periphs.c b/samples/boards/reel_board/mesh_badge/src/periphs.c index 14939d30dbd7..8cdf3322065e 100644 --- a/samples/boards/reel_board/mesh_badge/src/periphs.c +++ b/samples/boards/reel_board/mesh_badge/src/periphs.c @@ -104,7 +104,7 @@ static void motion_timeout(struct k_work *work) } static void motion_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { int err; diff --git a/samples/boards/sensortile_box/prj.conf b/samples/boards/sensortile_box/prj.conf index 0ea341d2ac8a..a5fa96419cbb 100644 --- a/samples/boards/sensortile_box/prj.conf +++ b/samples/boards/sensortile_box/prj.conf @@ -29,7 +29,6 @@ CONFIG_USB_DEVICE_PID=0x1234 CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC SensorTile.box" -CONFIG_USB_UART_CONSOLE=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_CBPRINTF_FP_SUPPORT=y diff --git a/samples/boards/sensortile_box/src/main.c b/samples/boards/sensortile_box/src/main.c index 762001ac3dca..645b940f451f 100644 --- a/samples/boards/sensortile_box/src/main.c +++ b/samples/boards/sensortile_box/src/main.c @@ -24,7 +24,7 @@ static int lps22hh_trig_cnt; static void lps22hh_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_PRESS); lps22hh_trig_cnt++; @@ -35,7 +35,7 @@ static void lps22hh_trigger_handler(const struct device *dev, static int lis2dw12_trig_cnt; static void lis2dw12_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); lis2dw12_trig_cnt++; @@ -48,21 +48,21 @@ static int lsm6dso_gyr_trig_cnt; static int lsm6dso_temp_trig_cnt; static void lsm6dso_acc_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); lsm6dso_acc_trig_cnt++; } static void lsm6dso_gyr_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_GYRO_XYZ); lsm6dso_gyr_trig_cnt++; } static void lsm6dso_temp_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_DIE_TEMP); lsm6dso_temp_trig_cnt++; @@ -73,7 +73,7 @@ static void lsm6dso_temp_trig_handler(const struct device *dev, static int stts751_trig_cnt; static void stts751_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { stts751_trig_cnt++; } @@ -83,7 +83,7 @@ static void stts751_trigger_handler(const struct device *dev, static int iis3dhhc_trig_cnt; static void iis3dhhc_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); iis3dhhc_trig_cnt++; diff --git a/samples/boards/stm32/power_mgmt/blinky/prj.conf b/samples/boards/stm32/power_mgmt/blinky/prj.conf index e3592321ed28..4921dcc3392b 100644 --- a/samples/boards/stm32/power_mgmt/blinky/prj.conf +++ b/samples/boards/stm32/power_mgmt/blinky/prj.conf @@ -1,5 +1,3 @@ -CONFIG_GPIO=y - CONFIG_PM=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/samples/modules/canopennode/README.rst b/samples/modules/canopennode/README.rst index 7da9b5ab306f..8ebafa01b034 100644 --- a/samples/modules/canopennode/README.rst +++ b/samples/modules/canopennode/README.rst @@ -34,7 +34,7 @@ LEDs). The sample can be built and executed for the TWR-KE18F as follows: .. zephyr-app-commands:: - :zephyr-app: samples/subsys/canbus/canopen + :zephyr-app: samples/modules/canopennode :board: twr_ke18f :goals: build flash :compact: @@ -53,7 +53,7 @@ LED indicators (red and green LEDs) The sample can be built and executed for the FRDM-K64F as follows: .. zephyr-app-commands:: - :zephyr-app: samples/subsys/canbus/canopen + :zephyr-app: samples/modules/canopennode :board: frdm_k64f :goals: build flash :compact: @@ -66,7 +66,7 @@ Building and Running for boards without storage partition The sample can be built for boards without a flash storage partition by using a different configuration file: .. zephyr-app-commands:: - :zephyr-app: samples/subsys/canbus/canopen + :zephyr-app: samples/modules/canopennode :board: :conf: "prj_no_storage.conf" :goals: build flash @@ -352,7 +352,7 @@ for the FRDM-K64F as follows: #. Rebuild the CANopen sample with MCUboot support: .. zephyr-app-commands:: - :zephyr-app: samples/subsys/canbus/canopen + :zephyr-app: samples/modules/canopennode :board: frdm_k64f :goals: build :gen-args: -DCONFIG_BOOTLOADER_MCUBOOT=y @@ -392,20 +392,20 @@ for the FRDM-K64F as follows: Modifying the Object Dictionary ******************************* The CANopen object dictionary used in this sample application can be -found under :zephyr_file:`samples/subsys/canbus/canopen/objdict` in +found under :zephyr_file:`samples/modules/canopennode/objdict` in the Zephyr tree. The object dictionary can be modified using any object dictionary editor supporting CANopenNode object dictionary code generation. A popular choice is the EDS editor from the `libedssharp`_ project. With that, the -:zephyr_file:`samples/subsys/canbus/canopen/objdict/objdicts.xml` +:zephyr_file:`samples/modules/canopennode/objdict/objdicts.xml` project file can be opened and modified, and new implementation files -(:zephyr_file:`samples/subsys/canbus/canopen/objdict/CO_OD.h` and -:zephyr_file:`samples/subsys/canbus/canopen/objdict/CO_OD.c`) can be +(:zephyr_file:`samples/modules/canopennode/objdict/CO_OD.h` and +:zephyr_file:`samples/modules/canopennode/objdict/CO_OD.c`) can be generated. The EDS editor can also export an updated Electronic Data Sheet (EDS) file -(:zephyr_file:`samples/subsys/canbus/canopen/objdict/objdicts.eds`). +(:zephyr_file:`samples/modules/canopennode/objdict/objdicts.eds`). .. _CANopenNode: https://github.com/CANopenNode/CANopenNode diff --git a/samples/modules/canopennode/objdict/objdict.xml b/samples/modules/canopennode/objdict/objdict.xml index 419c9ce49555..a72ea1677982 100644 --- a/samples/modules/canopennode/objdict/objdict.xml +++ b/samples/modules/canopennode/objdict/objdict.xml @@ -1018,7 +1018,7 @@ The counter can be reset by writing the value 0. - + 0 diff --git a/samples/net/cloud/tagoio_http_post/overlay-modem.conf b/samples/net/cloud/tagoio_http_post/overlay-modem.conf index cc14875d7514..4256d82f6da8 100644 --- a/samples/net/cloud/tagoio_http_post/overlay-modem.conf +++ b/samples/net/cloud/tagoio_http_post/overlay-modem.conf @@ -14,6 +14,7 @@ CONFIG_NET_CONNECTION_MANAGER=y # PPP networking support CONFIG_NET_NATIVE=y +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_NET_L2_PPP_TIMEOUT=10000 diff --git a/samples/net/gsm_modem/prj.conf b/samples/net/gsm_modem/prj.conf index 36e5996e08e5..3bb6689386ec 100644 --- a/samples/net/gsm_modem/prj.conf +++ b/samples/net/gsm_modem/prj.conf @@ -6,6 +6,7 @@ CONFIG_MODEM=y CONFIG_MODEM_GSM_PPP=y # PPP networking support +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_NET_NATIVE=y diff --git a/samples/net/sockets/echo_server/overlay-802154.conf b/samples/net/sockets/echo_server/overlay-802154.conf index fa9e68002772..ddfefd187692 100644 --- a/samples/net/sockets/echo_server/overlay-802154.conf +++ b/samples/net/sockets/echo_server/overlay-802154.conf @@ -14,3 +14,5 @@ CONFIG_NET_L2_IEEE802154_SHELL=y CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26 + +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 diff --git a/samples/net/sockets/echo_server/overlay-ppp.conf b/samples/net/sockets/echo_server/overlay-ppp.conf index 84237bea9bf6..156b981eb009 100644 --- a/samples/net/sockets/echo_server/overlay-ppp.conf +++ b/samples/net/sockets/echo_server/overlay-ppp.conf @@ -1,3 +1,4 @@ +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_NET_STATISTICS_PPP=y diff --git a/samples/net/sockets/echo_server/overlay-tfm.conf b/samples/net/sockets/echo_server/overlay-tfm.conf new file mode 100644 index 000000000000..44e2ab32b701 --- /dev/null +++ b/samples/net/sockets/echo_server/overlay-tfm.conf @@ -0,0 +1,7 @@ +# Kconfig fragment for building with TF-M and nRF Security +CONFIG_BUILD_WITH_TFM=y +CONFIG_NORDIC_SECURITY_BACKEND=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y + +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/sensor/adt7420/src/main.c b/samples/sensor/adt7420/src/main.c index dbe625867a3c..84bfa4a7978c 100644 --- a/samples/sensor/adt7420/src/main.c +++ b/samples/sensor/adt7420/src/main.c @@ -40,7 +40,7 @@ static const char *now_str(void) return buf; } static void trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { k_sem_give(&sem); } diff --git a/samples/sensor/adxl362/src/main.c b/samples/sensor/adxl362/src/main.c index 2c554696a64b..e3aea69f6229 100644 --- a/samples/sensor/adxl362/src/main.c +++ b/samples/sensor/adxl362/src/main.c @@ -12,7 +12,7 @@ K_SEM_DEFINE(sem, 0, 1); static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { switch (trig->type) { case SENSOR_TRIG_DATA_READY: diff --git a/samples/sensor/adxl372/src/main.c b/samples/sensor/adxl372/src/main.c index 934a9bb2a858..e8fa47561b68 100644 --- a/samples/sensor/adxl372/src/main.c +++ b/samples/sensor/adxl372/src/main.c @@ -33,7 +33,7 @@ static double sqrt(double value) K_SEM_DEFINE(sem, 0, 1); static void trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { ARG_UNUSED(trigger); diff --git a/samples/sensor/amg88xx/src/main.c b/samples/sensor/amg88xx/src/main.c index d1cd96663b64..e273908e38b2 100644 --- a/samples/sensor/amg88xx/src/main.c +++ b/samples/sensor/amg88xx/src/main.c @@ -15,7 +15,7 @@ static struct sensor_value temp_value[64]; K_SEM_DEFINE(sem, 0, 1); static void trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { ARG_UNUSED(dev); ARG_UNUSED(trigger); diff --git a/samples/sensor/apds9960/src/main.c b/samples/sensor/apds9960/src/main.c index f16f9a0432c7..bf4916e863ee 100644 --- a/samples/sensor/apds9960/src/main.c +++ b/samples/sensor/apds9960/src/main.c @@ -15,7 +15,7 @@ K_SEM_DEFINE(sem, 0, 1); static void trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { ARG_UNUSED(dev); ARG_UNUSED(trigger); diff --git a/samples/sensor/bmg160/src/main.c b/samples/sensor/bmg160/src/main.c index 7201dab40703..f75832e4fbc3 100644 --- a/samples/sensor/bmg160/src/main.c +++ b/samples/sensor/bmg160/src/main.c @@ -70,7 +70,7 @@ static void test_polling_mode(const struct device *bmg160) } static void trigger_handler(const struct device *bmg160, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { if (trigger->type != SENSOR_TRIG_DATA_READY && trigger->type != SENSOR_TRIG_DELTA) { diff --git a/samples/sensor/ccs811/src/main.c b/samples/sensor/ccs811/src/main.c index d86122c570b4..678c260c876e 100644 --- a/samples/sensor/ccs811/src/main.c +++ b/samples/sensor/ccs811/src/main.c @@ -79,7 +79,7 @@ static int do_fetch(const struct device *dev) #ifndef CONFIG_CCS811_TRIGGER_NONE static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { int rc = do_fetch(dev); diff --git a/samples/sensor/fdc2x1x/src/main.c b/samples/sensor/fdc2x1x/src/main.c index 04b40e9dfed7..4c65e9817120 100644 --- a/samples/sensor/fdc2x1x/src/main.c +++ b/samples/sensor/fdc2x1x/src/main.c @@ -17,7 +17,7 @@ K_SEM_DEFINE(sem, 0, 1); #ifdef CONFIG_FDC2X1X_TRIGGER static void trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { switch (trigger->type) { case SENSOR_TRIG_DATA_READY: @@ -36,9 +36,6 @@ static void trigger_handler(const struct device *dev, #ifdef CONFIG_PM_DEVICE static void pm_info(enum pm_device_state state, int status) { - ARG_UNUSED(dev); - ARG_UNUSED(arg); - switch (state) { case PM_DEVICE_STATE_ACTIVE: printk("Enter ACTIVE_STATE "); @@ -49,6 +46,8 @@ static void pm_info(enum pm_device_state state, int status) case PM_DEVICE_STATE_OFF: printk("Enter OFF_STATE "); break; + default: + printk("Unknown power state"); } if (status) { diff --git a/samples/sensor/fxas21002/src/main.c b/samples/sensor/fxas21002/src/main.c index 019e8e318c58..8007b05f9df6 100644 --- a/samples/sensor/fxas21002/src/main.c +++ b/samples/sensor/fxas21002/src/main.c @@ -11,7 +11,7 @@ K_SEM_DEFINE(sem, 0, 1); /* starts off "not available" */ static void trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { k_sem_give(&sem); } diff --git a/samples/sensor/fxos8700-hid/src/main.c b/samples/sensor/fxos8700-hid/src/main.c index ad2fe895ad04..61a182854076 100644 --- a/samples/sensor/fxos8700-hid/src/main.c +++ b/samples/sensor/fxos8700-hid/src/main.c @@ -160,7 +160,7 @@ static bool read_accel(const struct device *dev) } static void trigger_handler(const struct device *dev, - struct sensor_trigger *tr) + const struct sensor_trigger *tr) { ARG_UNUSED(tr); diff --git a/samples/sensor/fxos8700/src/main.c b/samples/sensor/fxos8700/src/main.c index 06c233d83300..594ccd1317b4 100644 --- a/samples/sensor/fxos8700/src/main.c +++ b/samples/sensor/fxos8700/src/main.c @@ -13,7 +13,7 @@ K_SEM_DEFINE(sem, 0, 1); /* starts off "not available" */ #if !defined(CONFIG_FXOS8700_TRIGGER_NONE) static void trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { ARG_UNUSED(trigger); diff --git a/samples/sensor/hts221/src/main.c b/samples/sensor/hts221/src/main.c index 142e2c0d191d..a6ba92816518 100644 --- a/samples/sensor/hts221/src/main.c +++ b/samples/sensor/hts221/src/main.c @@ -41,7 +41,7 @@ static void process_sample(const struct device *dev) } static void hts221_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { process_sample(dev); } diff --git a/samples/sensor/icm42605/src/main.c b/samples/sensor/icm42605/src/main.c index 105794c63ee6..1af97d1589c2 100644 --- a/samples/sensor/icm42605/src/main.c +++ b/samples/sensor/icm42605/src/main.c @@ -73,7 +73,7 @@ static struct sensor_trigger tap_trigger; static struct sensor_trigger double_tap_trigger; static void handle_icm42605_drdy(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { int rc = process_icm42605(dev); @@ -85,13 +85,13 @@ static void handle_icm42605_drdy(const struct device *dev, } static void handle_icm42605_tap(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { printf("Tap Detected!\n"); } static void handle_icm42605_double_tap(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { printf("Double Tap detected!\n"); } diff --git a/samples/sensor/isl29035/src/main.c b/samples/sensor/isl29035/src/main.c index cb1877feafa6..86a448ac2c9c 100644 --- a/samples/sensor/isl29035/src/main.c +++ b/samples/sensor/isl29035/src/main.c @@ -16,7 +16,7 @@ static volatile bool alerted; struct k_sem sem; static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { #ifdef CONFIG_ISL29035_TRIGGER alerted = !alerted; diff --git a/samples/sensor/lis2dh/src/main.c b/samples/sensor/lis2dh/src/main.c index d703651b3587..08669ee33149 100644 --- a/samples/sensor/lis2dh/src/main.c +++ b/samples/sensor/lis2dh/src/main.c @@ -42,7 +42,7 @@ static void fetch_and_display(const struct device *sensor) #ifdef CONFIG_LIS2DH_TRIGGER static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { fetch_and_display(dev); } diff --git a/samples/sensor/lps22hh/src/main.c b/samples/sensor/lps22hh/src/main.c index a1fa819c03cf..e5d29ed7c7d5 100644 --- a/samples/sensor/lps22hh/src/main.c +++ b/samples/sensor/lps22hh/src/main.c @@ -43,7 +43,7 @@ static void process_sample(const struct device *dev) } static void lps22hh_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { process_sample(dev); } diff --git a/samples/sensor/lsm6dsl/src/main.c b/samples/sensor/lsm6dsl/src/main.c index 86fff70c9202..c6a547cb6b0c 100644 --- a/samples/sensor/lsm6dsl/src/main.c +++ b/samples/sensor/lsm6dsl/src/main.c @@ -29,7 +29,7 @@ static struct sensor_value press_out, temp_out; #ifdef CONFIG_LSM6DSL_TRIGGER static void lsm6dsl_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { static struct sensor_value accel_x, accel_y, accel_z; static struct sensor_value gyro_x, gyro_y, gyro_z; diff --git a/samples/sensor/lsm6dso/src/main.c b/samples/sensor/lsm6dso/src/main.c index 1bab2623cf72..d9bc84f033bd 100644 --- a/samples/sensor/lsm6dso/src/main.c +++ b/samples/sensor/lsm6dso/src/main.c @@ -79,7 +79,7 @@ static int set_sampling_freq(const struct device *dev) #ifdef CONFIG_LSM6DSO_TRIGGER static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { fetch_and_display(dev); } diff --git a/samples/sensor/mcp9808/src/main.c b/samples/sensor/mcp9808/src/main.c index 6c2946212a80..370c0362e2c7 100644 --- a/samples/sensor/mcp9808/src/main.c +++ b/samples/sensor/mcp9808/src/main.c @@ -80,7 +80,7 @@ static inline int set_window_ucel(const struct device *dev, } static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { struct sensor_value temp; static size_t cnt; diff --git a/samples/sensor/mcux_acmp/src/main.c b/samples/sensor/mcux_acmp/src/main.c index f82a354ef55b..704565a439d9 100644 --- a/samples/sensor/mcux_acmp/src/main.c +++ b/samples/sensor/mcux_acmp/src/main.c @@ -64,7 +64,7 @@ static void acmp_input_handler(bool above_threshold) } static void acmp_trigger_handler(const struct device *dev, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { ARG_UNUSED(dev); diff --git a/samples/sensor/mpu6050/src/main.c b/samples/sensor/mpu6050/src/main.c index a3a481e381d7..9906435a8e2d 100644 --- a/samples/sensor/mpu6050/src/main.c +++ b/samples/sensor/mpu6050/src/main.c @@ -72,7 +72,7 @@ static int process_mpu6050(const struct device *dev) static struct sensor_trigger trigger; static void handle_mpu6050_drdy(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { int rc = process_mpu6050(dev); diff --git a/samples/sensor/sht3xd/src/main.c b/samples/sensor/sht3xd/src/main.c index ca2671bf760d..0180341d9e9d 100644 --- a/samples/sensor/sht3xd/src/main.c +++ b/samples/sensor/sht3xd/src/main.c @@ -16,7 +16,7 @@ static volatile bool alerted; static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { alerted = !alerted; } diff --git a/samples/sensor/sm351lt/src/main.c b/samples/sensor/sm351lt/src/main.c index 5c239dc9ce65..152766ff99a7 100644 --- a/samples/sensor/sm351lt/src/main.c +++ b/samples/sensor/sm351lt/src/main.c @@ -33,7 +33,7 @@ static void fetch_and_display(const struct device *sensor) #ifdef CONFIG_SM351LT_TRIGGER static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { fetch_and_display(dev); } diff --git a/samples/sensor/sx9500/src/main.c b/samples/sensor/sx9500/src/main.c index 07b757d09ae2..e9d759feae13 100644 --- a/samples/sensor/sx9500/src/main.c +++ b/samples/sensor/sx9500/src/main.c @@ -12,7 +12,7 @@ #ifdef CONFIG_SX9500_TRIGGER static void sensor_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { struct sensor_value prox_value; int ret; diff --git a/samples/sensor/vcnl4040/src/main.c b/samples/sensor/vcnl4040/src/main.c index e4267b6b8079..2db85aea0774 100644 --- a/samples/sensor/vcnl4040/src/main.c +++ b/samples/sensor/vcnl4040/src/main.c @@ -64,7 +64,7 @@ static void test_polling_mode(const struct device *dev) #if defined(CONFIG_VCNL4040_TRIGGER) static void trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { switch (trig->type) { case SENSOR_TRIG_THRESHOLD: diff --git a/samples/sensor/wsen_itds/src/main.c b/samples/sensor/wsen_itds/src/main.c index 6365aa186c5b..ca6052e54d6b 100644 --- a/samples/sensor/wsen_itds/src/main.c +++ b/samples/sensor/wsen_itds/src/main.c @@ -67,7 +67,7 @@ static void test_polling_mode(const struct device *itds) #if defined(CONFIG_ITDS_TRIGGER) static void trigger_handler(const struct device *itds, - struct sensor_trigger *trigger) + const struct sensor_trigger *trigger) { switch (trigger->type) { case SENSOR_TRIG_DATA_READY: diff --git a/samples/shields/x_nucleo_iks01a1/src/main.c b/samples/shields/x_nucleo_iks01a1/src/main.c index 9adf082bb81f..f3c2b3fa9729 100644 --- a/samples/shields/x_nucleo_iks01a1/src/main.c +++ b/samples/shields/x_nucleo_iks01a1/src/main.c @@ -14,7 +14,7 @@ static int lis3mdl_trig_cnt; static void lis3mdl_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, trig->chan); lis3mdl_trig_cnt++; diff --git a/samples/shields/x_nucleo_iks01a2/sensorhub/src/main.c b/samples/shields/x_nucleo_iks01a2/sensorhub/src/main.c index 1b3c3f3bbf33..42b211be3837 100644 --- a/samples/shields/x_nucleo_iks01a2/sensorhub/src/main.c +++ b/samples/shields/x_nucleo_iks01a2/sensorhub/src/main.c @@ -14,7 +14,7 @@ static int lsm6dsl_trig_cnt; static void lsm6dsl_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ALL); lsm6dsl_trig_cnt++; diff --git a/samples/shields/x_nucleo_iks01a2/standard/src/main.c b/samples/shields/x_nucleo_iks01a2/standard/src/main.c index 3108bda85850..589f7c6256ca 100644 --- a/samples/shields/x_nucleo_iks01a2/standard/src/main.c +++ b/samples/shields/x_nucleo_iks01a2/standard/src/main.c @@ -14,7 +14,7 @@ static int lsm6dsl_trig_cnt; static void lsm6dsl_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ALL); lsm6dsl_trig_cnt++; diff --git a/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c b/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c index c4e7eb9a83f9..66318b9e2552 100644 --- a/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c +++ b/samples/shields/x_nucleo_iks01a3/sensorhub/src/main.c @@ -14,7 +14,7 @@ static int lis2dw12_trig_cnt; static void lis2dw12_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); lis2dw12_trig_cnt++; @@ -27,21 +27,21 @@ static int lsm6dso_gyr_trig_cnt; static int lsm6dso_temp_trig_cnt; static void lsm6dso_acc_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); lsm6dso_acc_trig_cnt++; } static void lsm6dso_gyr_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_GYRO_XYZ); lsm6dso_gyr_trig_cnt++; } static void lsm6dso_temp_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_DIE_TEMP); lsm6dso_temp_trig_cnt++; diff --git a/samples/shields/x_nucleo_iks01a3/standard/src/main.c b/samples/shields/x_nucleo_iks01a3/standard/src/main.c index ab465ee3a586..c3ec7b588e57 100644 --- a/samples/shields/x_nucleo_iks01a3/standard/src/main.c +++ b/samples/shields/x_nucleo_iks01a3/standard/src/main.c @@ -14,7 +14,7 @@ static int lis2mdl_trig_cnt; static void lis2mdl_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ALL); lis2mdl_trig_cnt++; @@ -25,7 +25,7 @@ static void lis2mdl_trigger_handler(const struct device *dev, static int lps22hh_trig_cnt; static void lps22hh_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_PRESS); lps22hh_trig_cnt++; @@ -36,7 +36,7 @@ static void lps22hh_trigger_handler(const struct device *dev, static int stts751_trig_cnt; static void stts751_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { stts751_trig_cnt++; } @@ -46,7 +46,7 @@ static void stts751_trigger_handler(const struct device *dev, static int lis2dw12_trig_cnt; static void lis2dw12_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); lis2dw12_trig_cnt++; @@ -59,21 +59,21 @@ static int lsm6dso_gyr_trig_cnt; static int lsm6dso_temp_trig_cnt; static void lsm6dso_acc_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); lsm6dso_acc_trig_cnt++; } static void lsm6dso_gyr_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_GYRO_XYZ); lsm6dso_gyr_trig_cnt++; } static void lsm6dso_temp_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_DIE_TEMP); lsm6dso_temp_trig_cnt++; diff --git a/samples/shields/x_nucleo_iks02a1/sensorhub/src/main.c b/samples/shields/x_nucleo_iks02a1/sensorhub/src/main.c index 61c4622da7e6..9a1905a3180a 100644 --- a/samples/shields/x_nucleo_iks02a1/sensorhub/src/main.c +++ b/samples/shields/x_nucleo_iks02a1/sensorhub/src/main.c @@ -14,7 +14,7 @@ static int iis2dlpc_trig_cnt; static void iis2dlpc_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); iis2dlpc_trig_cnt++; @@ -27,21 +27,21 @@ static int ism330dhcx_gyr_trig_cnt; static int ism330dhcx_temp_trig_cnt; static void ism330dhcx_acc_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); ism330dhcx_acc_trig_cnt++; } static void ism330dhcx_gyr_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_GYRO_XYZ); ism330dhcx_gyr_trig_cnt++; } static void ism330dhcx_temp_trig_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_DIE_TEMP); ism330dhcx_temp_trig_cnt++; diff --git a/samples/shields/x_nucleo_iks02a1/standard/src/main.c b/samples/shields/x_nucleo_iks02a1/standard/src/main.c index cdef4befb6d7..3ef080584e38 100644 --- a/samples/shields/x_nucleo_iks02a1/standard/src/main.c +++ b/samples/shields/x_nucleo_iks02a1/standard/src/main.c @@ -14,7 +14,7 @@ static int iis2dlpc_trig_cnt; static void iis2dlpc_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); iis2dlpc_trig_cnt++; @@ -25,7 +25,7 @@ static void iis2dlpc_trigger_handler(const struct device *dev, static int iis2mdc_trig_cnt; static void iis2mdc_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ALL); iis2mdc_trig_cnt++; @@ -37,14 +37,14 @@ static int ism330dhcx_acc_trig_cnt; static int ism330dhcx_gyr_trig_cnt; static void ism330dhcx_acc_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ); ism330dhcx_acc_trig_cnt++; } static void ism330dhcx_gyr_trigger_handler(const struct device *dev, - struct sensor_trigger *trig) + const struct sensor_trigger *trig) { sensor_sample_fetch_chan(dev, SENSOR_CHAN_GYRO_XYZ); ism330dhcx_gyr_trig_cnt++; diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf b/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf index cfde2d6b8336..2e81ff1a317c 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf +++ b/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf @@ -3,6 +3,7 @@ CONFIG_MCUMGR=y # Some command handlers require a large stack. CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304 +CONFIG_MAIN_STACK_SIZE=2048 # Ensure an MCUboot-compatible binary is generated. CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/samples/subsys/mgmt/osdp/control_panel/sample.yaml b/samples/subsys/mgmt/osdp/control_panel/sample.yaml index 9684e5ee11e3..3e1fed716263 100644 --- a/samples/subsys/mgmt/osdp/control_panel/sample.yaml +++ b/samples/subsys/mgmt/osdp/control_panel/sample.yaml @@ -4,6 +4,7 @@ sample: tests: sample.mgmt.osdp.control_panel: tags: osdp + depends_on: gpio filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") and CONFIG_SERIAL harness: osdp integration_platforms: diff --git a/samples/subsys/mgmt/osdp/peripheral_device/sample.yaml b/samples/subsys/mgmt/osdp/peripheral_device/sample.yaml index 385a0e0012b1..51dc2b3227bd 100644 --- a/samples/subsys/mgmt/osdp/peripheral_device/sample.yaml +++ b/samples/subsys/mgmt/osdp/peripheral_device/sample.yaml @@ -4,6 +4,7 @@ sample: tests: sample.mgmt.osdp.peripheral_device: tags: osdp + depends_on: gpio filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") and CONFIG_SERIAL harness: osdp integration_platforms: diff --git a/samples/subsys/mgmt/updatehub/overlay-modem.conf b/samples/subsys/mgmt/updatehub/overlay-modem.conf index c21f4f1ce137..75ecbb3f58c4 100644 --- a/samples/subsys/mgmt/updatehub/overlay-modem.conf +++ b/samples/subsys/mgmt/updatehub/overlay-modem.conf @@ -18,6 +18,7 @@ CONFIG_MODEM_GSM_PPP=y CONFIG_MODEM_GSM_APN="" # PPP networking support +CONFIG_NET_DRIVERS=y CONFIG_NET_NATIVE=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y diff --git a/samples/subsys/modbus/rtu_client/sample.yaml b/samples/subsys/modbus/rtu_client/sample.yaml index 1740bf3b8703..96c4df001930 100644 --- a/samples/subsys/modbus/rtu_client/sample.yaml +++ b/samples/subsys/modbus/rtu_client/sample.yaml @@ -2,5 +2,6 @@ sample: name: Modbus RTU Client Sample tests: sample.modbus.rtu_client: + platform_allow: nrf52840dk_nrf52840 frdm_k64f tags: uart modbus - depends_on: gpio, arduino_serial + depends_on: gpio arduino_serial diff --git a/samples/subsys/modbus/rtu_server/sample.yaml b/samples/subsys/modbus/rtu_server/sample.yaml index 1ab3602c8108..617b71efcfc1 100644 --- a/samples/subsys/modbus/rtu_server/sample.yaml +++ b/samples/subsys/modbus/rtu_server/sample.yaml @@ -2,8 +2,9 @@ sample: name: Modbus RTU Server Sample tests: sample.modbus.rtu_server: + platform_allow: nrf52840dk_nrf52840 frdm_k64f tags: uart modbus - filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and - dt_compat_enabled_with_alias("gpio-leds", "led1") and - dt_compat_enabled_with_alias("gpio-leds", "led2") - depends_on: gpio, arduino_serial + filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") and + dt_enabled_alias_with_parent_compat("led1", "gpio-leds") and + dt_enabled_alias_with_parent_compat("led2", "gpio-leds") + depends_on: gpio arduino_serial diff --git a/samples/subsys/modbus/rtu_server/src/main.c b/samples/subsys/modbus/rtu_server/src/main.c index d83fe4d002bc..7113a7b7f845 100644 --- a/samples/subsys/modbus/rtu_server/src/main.c +++ b/samples/subsys/modbus/rtu_server/src/main.c @@ -109,7 +109,6 @@ const static struct modbus_iface_param server_param = { static int init_modbus_server(void) { - const uint32_t mb_rtu_br = 19200; const char iface_name[] = {DT_PROP(DT_INST(0, zephyr_modbus_serial), label)}; int iface; diff --git a/samples/subsys/modbus/tcp_gateway/sample.yaml b/samples/subsys/modbus/tcp_gateway/sample.yaml index 060f576b4fdc..845da615a5d2 100644 --- a/samples/subsys/modbus/tcp_gateway/sample.yaml +++ b/samples/subsys/modbus/tcp_gateway/sample.yaml @@ -2,7 +2,8 @@ sample: name: Modbus TCP to serial line gateway sample tests: sample.modbus.tcp_gateway: + platform_allow: frdm_k64f tags: modbus - depends_on: gpio, netif, arduino_serial + depends_on: gpio netif arduino_serial integration_platforms: - frdm_k64f diff --git a/samples/subsys/modbus/tcp_server/sample.yaml b/samples/subsys/modbus/tcp_server/sample.yaml index a34dbee87790..c1334959c924 100644 --- a/samples/subsys/modbus/tcp_server/sample.yaml +++ b/samples/subsys/modbus/tcp_server/sample.yaml @@ -2,8 +2,9 @@ sample: name: Modbus TCP Server Sample tests: sample.modbus.tcp_server: + platform_allow: frdm_k64f tags: modbus - filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and - dt_compat_enabled_with_alias("gpio-leds", "led1") and - dt_compat_enabled_with_alias("gpio-leds", "led2") - depends_on: gpio, netif + filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") and + dt_enabled_alias_with_parent_compat("led1", "gpio-leds") and + dt_enabled_alias_with_parent_compat("led2", "gpio-leds") + depends_on: gpio netif diff --git a/samples/subsys/nvs/src/main.c b/samples/subsys/nvs/src/main.c index fbc0fb893b9f..831848b7f56b 100644 --- a/samples/subsys/nvs/src/main.c +++ b/samples/subsys/nvs/src/main.c @@ -48,8 +48,7 @@ static struct nvs_fs fs; -#define STORAGE_NODE DT_NODE_BY_FIXED_PARTITION_LABEL(storage) -#define FLASH_NODE DT_MTD_FROM_FIXED_PARTITION(STORAGE_NODE) +#define STORAGE_NODE_LABEL storage /* 1000 msec = 1 sec */ #define SLEEP_TIME 100 @@ -78,7 +77,7 @@ void main(void) * 3 sectors * starting at FLASH_AREA_OFFSET(storage) */ - flash_dev = DEVICE_DT_GET(FLASH_NODE); + flash_dev = FLASH_AREA_DEVICE(STORAGE_NODE_LABEL); if (!device_is_ready(flash_dev)) { printk("Flash device %s is not ready\n", flash_dev->name); return; diff --git a/samples/subsys/shell/shell_module/overlay-usb.conf b/samples/subsys/shell/shell_module/overlay-usb.conf index 595379fe995b..e107d8b02683 100644 --- a/samples/subsys/shell/shell_module/overlay-usb.conf +++ b/samples/subsys/shell/shell_module/overlay-usb.conf @@ -1,5 +1,5 @@ CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr USB shell sample" -CONFIG_USB_UART_CONSOLE=y +CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR=y CONFIG_UART_LINE_CTRL=y CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY=51 diff --git a/samples/subsys/shell/shell_module/src/main.c b/samples/subsys/shell/shell_module/src/main.c index 1555b4f5a866..89eb0b3dc425 100644 --- a/samples/subsys/shell/shell_module/src/main.c +++ b/samples/subsys/shell/shell_module/src/main.c @@ -334,7 +334,7 @@ void main(void) login_init(); } -#if defined(CONFIG_USB_UART_CONSOLE) +#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_shell_uart), zephyr_cdc_acm_uart) const struct device *dev; uint32_t dtr = 0; diff --git a/samples/subsys/usb/console/prj.conf b/samples/subsys/usb/console/prj.conf index 0dd080781f1f..d47cffdd4893 100644 --- a/samples/subsys/usb/console/prj.conf +++ b/samples/subsys/usb/console/prj.conf @@ -2,5 +2,6 @@ CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr USB console sample" CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y CONFIG_UART_LINE_CTRL=y -CONFIG_USB_UART_CONSOLE=y diff --git a/samples/subsys/usb/usb.rst b/samples/subsys/usb/usb.rst index 8e282e37d32f..90b1c783b4ce 100644 --- a/samples/subsys/usb/usb.rst +++ b/samples/subsys/usb/usb.rst @@ -1,7 +1,7 @@ .. _usb-samples: -USB Samples -############### +USB device support samples +########################## .. toctree:: :maxdepth: 1 diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 7ddb20044b8e..2dc7f68a928b 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -257,6 +257,13 @@ def get_modules(self, modules_file): modules = [name for name in os.listdir(modules_dir) if os.path.exists(os.path.join(modules_dir, name, 'Kconfig'))] + nrf_modules_dir = ZEPHYR_BASE + '/../nrf/modules' + nrf_modules = [] + if os.path.exists(nrf_modules_dir): + nrf_modules = [name for name in os.listdir(nrf_modules_dir) if + os.path.exists(os.path.join(nrf_modules_dir, name, + 'Kconfig'))] + with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -266,6 +273,15 @@ def get_modules(self, modules_file): re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir + '/' + module + '/Kconfig' )) + for module in nrf_modules: + fp_module_file.write("ZEPHYR_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + nrf_modules_dir + '/' + module + '/Kconfig' + )) + fp_module_file.write("NCS_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + modules_dir + '/' + module + '/Kconfig' + )) fp_module_file.write(content) def parse_kconfig(self): diff --git a/scripts/gen_handles.py b/scripts/gen_handles.py index c8354d9ec838..558ce82c707c 100755 --- a/scripts/gen_handles.py +++ b/scripts/gen_handles.py @@ -246,19 +246,15 @@ def main(): hvi = 1 handle.dev_deps = [] handle.ext_deps = [] - handle.dev_sups = [] - hdls = handle.dev_deps + deps = handle.dev_deps while hvi < len(hv): h = hv[hvi] if h == DEVICE_HANDLE_ENDS: break if h == DEVICE_HANDLE_SEP: - if hdls == handle.dev_deps: - hdls = handle.ext_deps - else: - hdls = handle.dev_sups + deps = handle.ext_deps else: - hdls.append(h) + deps.append(h) n = edt hvi += 1 @@ -271,7 +267,6 @@ def main(): for sn in used_nodes: # Where we're storing the final set of nodes: these are all used sn.__depends = set() - sn.__supports = set() deps = set(sn.depends_on) debug("\nNode: %s\nOrig deps:\n\t%s" % (sn.path, "\n\t".join([dn.path for dn in deps]))) @@ -284,16 +279,7 @@ def main(): # forward the dependency up one level for ddn in dn.depends_on: deps.add(ddn) - debug("Final deps:\n\t%s\n" % ("\n\t".join([ _dn.path for _dn in sn.__depends]))) - - sups = set(sn.required_by) - debug("\nOrig sups:\n\t%s" % ("\n\t".join([dn.path for dn in sups]))) - while len(sups) > 0: - dn = sups.pop() - if dn in used_nodes: - # this is used - sn.__supports.add(dn) - debug("\nFinal sups:\n\t%s" % ("\n\t".join([dn.path for dn in sn.__supports]))) + debug("final deps:\n\t%s\n" % ("\n\t".join([ _dn.path for _dn in sn.__depends]))) with open(args.output_source, "w") as fp: fp.write('#include \n') @@ -304,7 +290,6 @@ def main(): assert hs, "no hs for %s" % (dev.sym.name,) dep_paths = [] ext_paths = [] - sup_paths = [] hdls = [] sn = hs.node @@ -315,32 +300,26 @@ def main(): dep_paths.append(dn.path) else: dep_paths.append('(%s)' % dn.path) - - # Force separator to signal start of injected dependencies - hdls.append(DEVICE_HANDLE_SEP) if len(hs.ext_deps) > 0: # TODO: map these to something smaller? ext_paths.extend(map(str, hs.ext_deps)) + hdls.append(DEVICE_HANDLE_SEP) hdls.extend(hs.ext_deps) - # Force separator to signal start of supported devices - hdls.append(DEVICE_HANDLE_SEP) - if len(hs.dev_sups) > 0: - for dn in sn.required_by: - if dn in sn.__supports: - sup_paths.append(dn.path) - else: - sup_paths.append('(%s)' % dn.path) - hdls.extend(dn.__device.dev_handle for dn in sn.__supports) - # When CONFIG_USERSPACE is enabled the pre-built elf is # also used to get hashes that identify kernel objects by # address. We can't allow the size of any object in the # final elf to change. We also must make sure at least one # DEVICE_HANDLE_ENDS is inserted. - assert len(hdls) < len(hs.handles), "%s no DEVICE_HANDLE_ENDS inserted" % (dev.sym.name,) - while len(hdls) < len(hs.handles): + padding = len(hs.handles) - len(hdls) + assert padding > 0, \ + (f"device {dev.sym.name}: " + "linker pass 1 left no room to insert DEVICE_HANDLE_ENDS. " + "To work around, increase CONFIG_DEVICE_HANDLE_PADDING by " + + str(1 + (-padding))) + while padding > 0: hdls.append(DEVICE_HANDLE_ENDS) + padding -= 1 assert len(hdls) == len(hs.handles), "%s handle overflow" % (dev.sym.name,) lines = [ @@ -349,14 +328,9 @@ def main(): ] if len(dep_paths) > 0: - lines.append(' * Direct Dependencies:') - lines.append(' * - %s' % ('\n * - '.join(dep_paths))) + lines.append(' * - %s' % ('\n * - '.join(dep_paths))) if len(ext_paths) > 0: - lines.append(' * Injected Dependencies:') - lines.append(' * - %s' % ('\n * - '.join(ext_paths))) - if len(sup_paths) > 0: - lines.append(' * Supported:') - lines.append(' * - %s' % ('\n * - '.join(sup_paths))) + lines.append(' * + %s' % ('\n * + '.join(ext_paths))) lines.extend([ ' */', diff --git a/scripts/kconfig/kconfig.py b/scripts/kconfig/kconfig.py index 77aafc91f6ff..7477f4223036 100755 --- a/scripts/kconfig/kconfig.py +++ b/scripts/kconfig/kconfig.py @@ -17,7 +17,7 @@ # Zephyr doesn't use tristate symbols. They're supported here just to make the # script a bit more generic. from kconfiglib import Kconfig, split_expr, expr_value, expr_str, BOOL, \ - TRISTATE, TRI_TO_STR, AND + TRISTATE, TRI_TO_STR, AND, OR def main(): @@ -62,6 +62,9 @@ def main(): check_assigned_sym_values(kconf) check_assigned_choice_values(kconf) + if kconf.syms['WARN_EXPERIMENTAL'].tri_value == 2: + check_experimental(kconf) + # Hack: Force all symbols to be evaluated, to catch warnings generated # during evaluation. Wait till the end to write the actual output files, so # that we don't generate any output if there are warnings-turned-errors. @@ -202,6 +205,17 @@ def check_assigned_choice_values(kconf): """ +def check_experimental(kconf): + experimental = kconf.syms['EXPERIMENTAL'] + dep_expr = experimental.rev_dep + + if dep_expr is not kconf.n: + selectors = [s for s in split_expr(dep_expr, OR) if expr_value(s) == 2] + for selector in selectors: + selector_name = split_expr(selector, AND)[0].name + warn(f'Experimental symbol {selector_name} is enabled.') + + def promptless(sym): # Returns True if 'sym' has no prompt. Since the symbol might be defined in # multiple locations, we need to check all locations. diff --git a/scripts/pylib/twister/twisterlib.py b/scripts/pylib/twister/twisterlib.py index f5846ec0e9db..57352a24eac6 100755 --- a/scripts/pylib/twister/twisterlib.py +++ b/scripts/pylib/twister/twisterlib.py @@ -25,7 +25,6 @@ import concurrent import xml.etree.ElementTree as ET import logging -import pty from pathlib import Path from distutils.spawn import find_executable from colorama import Fore @@ -58,6 +57,14 @@ except ImportError: print("Install psutil python module with pip to run in Qemu.") +try: + import pty +except ImportError as capture_error: + if os.name == "nt": # "nt" means that program is running on Windows OS + pass # "--device-serial-pty" option is not supported on Windows OS + else: + raise capture_error + ZEPHYR_BASE = os.getenv("ZEPHYR_BASE") if not ZEPHYR_BASE: sys.exit("$ZEPHYR_BASE environment variable undefined") @@ -436,6 +443,16 @@ def terminate(self, proc): proc.kill() self.terminated = True + def add_missing_testscases(self, harness): + """ + If testsuite was broken by some error (e.g. timeout) it is necessary to + add information about next testcases, which were not be + performed due to this error. + """ + for c in self.instance.testcase.cases: + if c not in harness.tests: + harness.tests[c] = "BLOCK" + class BinaryHandler(Handler): def __init__(self, instance, type_str): @@ -590,6 +607,7 @@ def handle(self): else: self.set_state("timeout", handler_time) self.instance.reason = "Timeout" + self.add_missing_testscases(harness) self.record(harness) @@ -722,7 +740,7 @@ def handle(self): else: serial_device = hardware.serial - logger.debug("Using serial device {}".format(serial_device)) + logger.debug("Using serial device {} @ {} baud".format(serial_device, hardware.serial_baud)) if (self.suite.west_flash is not None) or runner: command = ["west", "flash", "--skip-rebuild", "-d", self.build_dir] @@ -779,7 +797,7 @@ def handle(self): try: ser = serial.Serial( serial_device, - baudrate=115200, + baudrate=hardware.serial_baud, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, @@ -859,9 +877,7 @@ def handle(self): handler_time = time.time() - start_time if out_state in ["timeout", "flash_error"]: - for c in self.instance.testcase.cases: - if c not in harness.tests: - harness.tests[c] = "BLOCK" + self.add_missing_testscases(harness) if out_state == "timeout": self.instance.reason = "Timeout" @@ -1152,6 +1168,7 @@ def handle(self): self.instance.reason = "Timeout" else: self.instance.reason = "Exited with {}".format(self.returncode) + self.add_missing_testscases(harness) def get_fifo(self): return self.fifo_fn @@ -1986,7 +2003,7 @@ def run_build(self, args=[]): log.write(log_msg) if log_msg: - res = re.findall("region `(FLASH|RAM|ICCM|DCCM|SRAM)' overflowed by", log_msg) + res = re.findall("region `(FLASH|ROM|RAM|ICCM|DCCM|SRAM)' overflowed by", log_msg) if res and not self.overflow_as_errors: logger.debug("Test skipped due to {} Overflow".format(res[0])) self.instance.status = "skipped" @@ -2108,7 +2125,7 @@ def run_cmake_script(args=[]): else: logger.error("Cmake script failure: %s" % (args[0])) - results = {"returncode": p.returncode} + results = {"returncode": p.returncode, "returnmsg": out} return results @@ -2676,7 +2693,7 @@ def check_zephyr_version(self): logger.info("Cannot read zephyr version.") def get_platform_instances(self, platform): - filtered_dict = {k:v for k,v in self.instances.items() if k.startswith(platform + "/")} + filtered_dict = {k:v for k,v in self.instances.items() if k.startswith(platform + os.sep)} return filtered_dict def config(self): @@ -2898,7 +2915,7 @@ def get_toolchain(): try: if result['returncode']: - raise TwisterRuntimeError("E: Variable ZEPHYR_TOOLCHAIN_VARIANT is not defined") + raise TwisterRuntimeError(f"E: {result['returnmsg']}") except Exception as e: print(str(e)) sys.exit(2) @@ -3275,6 +3292,7 @@ def apply_filters(self, **kwargs): self.discards = discards self.selected_platforms = set(p.platform.name for p in self.instances.values()) + remove_from_discards = [] # configurations to be removed from discards. for instance in self.discards: instance.reason = self.discards[instance] # If integration mode is on all skips on integration_platforms are treated as errors. @@ -3284,6 +3302,8 @@ def apply_filters(self, **kwargs): instance.reason += " but is one of the integration platforms" instance.fill_results_by_status() self.instances[instance.name] = instance + # Such configuration has to be removed from discards to make sure it won't get skipped + remove_from_discards.append(instance) else: instance.status = "skipped" instance.fill_results_by_status() @@ -3291,6 +3311,10 @@ def apply_filters(self, **kwargs): self.filtered_platforms = set(p.platform.name for p in self.instances.values() if p.status != "skipped" ) + # Remove from discards configururations that must not be discarded (e.g. integration_platforms when --integration was used) + for instance in remove_from_discards: + del self.discards[instance] + return discards def add_instances(self, instance_list): @@ -3916,10 +3940,12 @@ def _generate(self, outdir, coveragelog): ["-o", os.path.join(subdir, "index.html")], stdout=coveragelog) + class DUT(object): def __init__(self, id=None, serial=None, + serial_baud=None, platform=None, product=None, serial_pty=None, @@ -3930,6 +3956,9 @@ def __init__(self, runner=None): self.serial = serial + self.serial_baud = 115200 + if serial_baud: + self.serial_baud = serial_baud self.platform = platform self.serial_pty = serial_pty self._counter = Value("i", 0) @@ -4021,8 +4050,8 @@ def __init__(self): self.detected = [] self.duts = [] - def add_device(self, serial, platform, pre_script, is_pty): - device = DUT(platform=platform, connected=True, pre_script=pre_script) + def add_device(self, serial, platform, pre_script, is_pty, baud=None): + device = DUT(platform=platform, connected=True, pre_script=pre_script, serial_baud=baud) if is_pty: device.serial_pty = serial @@ -4042,6 +4071,7 @@ def load(self, map_file): id = dut.get('id') runner = dut.get('runner') serial = dut.get('serial') + baud = dut.get('baud', None) product = dut.get('product') fixtures = dut.get('fixtures', []) new_dut = DUT(platform=platform, @@ -4049,6 +4079,7 @@ def load(self, map_file): runner=runner, id=id, serial=serial, + serial_baud=baud, connected=serial is not None, pre_script=pre_script, post_script=post_script, diff --git a/scripts/schemas/twister/hwmap-schema.yaml b/scripts/schemas/twister/hwmap-schema.yaml index 99c1f980cfba..e8f4eed6ee8e 100644 --- a/scripts/schemas/twister/hwmap-schema.yaml +++ b/scripts/schemas/twister/hwmap-schema.yaml @@ -30,6 +30,9 @@ sequence: "serial": type: str required: false + "baud": + type: int + required: false "post_script": type: str required: false diff --git a/scripts/twister b/scripts/twister index 38379ee69ca1..02ea54c45677 100755 --- a/scripts/twister +++ b/scripts/twister @@ -214,7 +214,7 @@ logger.setLevel(logging.DEBUG) def size_report(sc): logger.info(sc.filename) logger.info("SECTION NAME VMA LMA SIZE HEX SZ TYPE") - for i in range(len(sc.sections)): + for i in enumerate(sc.sections): v = sc.sections[i] logger.info("%-17s 0x%08x 0x%08x %8d 0x%05x %-7s" % @@ -621,6 +621,10 @@ structure in the main Zephyr tree: boards///""") "-X", "--fixture", action="append", default=[], help="Specify a fixture that a board might support") + parser.add_argument( + "--device-serial-baud", action="store", default=None, + help="Serial device baud rate (default 115200)") + serial = parser.add_mutually_exclusive_group() serial.add_argument("--device-serial", help="""Serial device for accessing the board @@ -631,6 +635,7 @@ structure in the main Zephyr tree: boards///""") help="""Script for controlling pseudoterminal. Twister believes that it interacts with a terminal when it actually interacts with the script. + Not supported on Windows OS. E.g "twister --device-testing --device-serial-pty