diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 12701a1822f..9d249cfff2b 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,6 +1,6 @@ name: Backport on: - pull_request_target: + pull_request: types: - closed - labeled @@ -12,8 +12,11 @@ jobs: runs-on: ubuntu-18.04 name: Backport steps: - - name: Backport - uses: zephyrproject-rtos/action-backport@v1.1.1-1 + - name: Backport Bot + uses: Gaurav0/backport@v1.0.24 with: + bot_username: NordicBuilder + bot_token: 151a9b45052f9ee8be5a59963d31ad7b92c3ecb5 + bot_token_key: 67bb1f1f998d546859786a4088917c65415c0ebd github_token: ${{ secrets.ZB_GITHUB_TOKEN }} issue_labels: backport diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 5c32e0e3eef..05c0483ce34 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -38,13 +38,16 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 + path: ./zephyr - name: west setup + working-directory: ./zephyr run: | west init -l . || true west update - name: Check Environment + working-directory: ./zephyr run: | cmake --version ${CLANG_ROOT_DIR}/bin/clang --version @@ -52,6 +55,7 @@ jobs: ls -la - name: Run Tests with Twister + working-directory: ./zephyr run: | #source zephyr-env.sh export ZEPHYR_BASE=${PWD} @@ -63,7 +67,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: Unit Test Results (Subset ${{ matrix.subset }}) - path: twister-out/twister.xml + path: zephyr/twister-out/twister.xml publish-test-results: name: "Publish Unit Tests Results" diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index b3f891d84d3..6b733a2284f 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -37,6 +37,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|fromlist|toup|noup|temphack|fromtree)\]" && { echo 'Sauce tag missing'; exit 1; } git rebase origin/${BASE_REF} # debug git log --pretty=oneline | head -n 10 @@ -53,7 +55,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/CMakeLists.txt b/CMakeLists.txt index 242e30cd2e4..01f64ae011a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1295,6 +1295,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 "") diff --git a/CODEOWNERS b/CODEOWNERS index 59655cdc967..34dd6fed037 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -13,8 +13,7 @@ # Do not use wildcard on all source yet # * @galak @nashif -/.github/ @nashif -/.github/workflows/ @galak @nashif +/.github/ @thst-nordic /.buildkite/ @galak /MAINTAINERS.yml @ioannisg @MaureenHelm /arch/arc/ @abrodkin @ruuddw @evgeniy-paltsev @@ -492,6 +491,7 @@ /include/toolchain.h @dcpleung @andyross @nashif /include/toolchain/ @dcpleung @nashif @andyross /include/zephyr.h @dcpleung @nashif @andyross +/Jenkinsfile @thst-nordic /kernel/ @dcpleung @nashif @andyross /lib/util/ @carlescufi @jakub-uC /lib/util/fnmatch/ @carlescufi @jakub-uC diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..3b9cf002239 --- /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 50cce1a41a6..33159fe6eaa 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -110,9 +110,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 diff --git a/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig b/boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig index d8049d263ed..b5f5e306484 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_CPUAPPNS + # Temporarily disable building Non-Secure images with TF-M support by + # default. + # default y if BOARD_NRF5340DK_NRF5340_CPUAPPNS + default n if BUILD_WITH_TFM diff --git a/boards/arm/nrf9160dk_nrf9160/Kconfig.defconfig b/boards/arm/nrf9160dk_nrf9160/Kconfig.defconfig index 4b345de10d7..7c1001f96f3 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_NRF9160NS 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_NRF9160NS - if BUILD_WITH_TFM # By default, if we build with TF-M, instruct build system to diff --git a/boards/arm/thingy53_nrf5340/board.c b/boards/arm/thingy53_nrf5340/board.c index e18689732cb..f3da9e00b8d 100644 --- a/boards/arm/thingy53_nrf5340/board.c +++ b/boards/arm/thingy53_nrf5340/board.c @@ -39,8 +39,10 @@ LOG_MODULE_REGISTER(thingy53_board_init); * introduced in the board start up file. Below asserts ensure correct initialization order: * on board regulators, board init (this), sensors init. */ +#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) BUILD_ASSERT(CONFIG_THINGY53_INIT_PRIORITY > CONFIG_REGULATOR_FIXED_INIT_PRIORITY, "CONFIG_THINGY53_INIT_PRIORITY must be higher than CONFIG_REGULATOR_FIXED_INIT_PRIORITY"); +#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ #if defined(CONFIG_SENSOR) BUILD_ASSERT(CONFIG_THINGY53_INIT_PRIORITY < CONFIG_SENSOR_INIT_PRIORITY, "CONFIG_THINGY53_INIT_PRIORITY must be less than CONFIG_SENSOR_INIT_PRIORITY"); diff --git a/cmake/app/boilerplate.cmake b/cmake/app/boilerplate.cmake index d5208b8fb3c..4230c82173e 100644 --- a/cmake/app/boilerplate.cmake +++ b/cmake/app/boilerplate.cmake @@ -664,6 +664,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/doc/CMakeLists.txt b/doc/CMakeLists.txt index 3cc99283812..31afa616ccc 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -283,6 +283,14 @@ set(SPHINX_BUILD_HTML_COMMAND ZEPHYR_BASE=${ZEPHYR_BASE} ZEPHYR_BUILD=${CMAKE_CURRENT_BINARY_DIR} DOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} + + # nRF-specific hack to pass these through to nrf/doc/zephyr/conf.py (the + # Sphinx configuration file). We use it for Intersphinx. See + # nrf/doc/CMakeLists.txt. + ZEPHYR_OUTPUT=${SPHINX_OUTPUT_DIR} + ZEPHYR_RST_SRC=${RST_OUT}/doc + KCONFIG_OUTPUT=${KCONFIG_OUTPUT} + ${SPHINXBUILD} -W -N -t ${DOC_TAG} -b html ${ALLSPHINXOPTS} ${RST_OUT}/doc ${SPHINX_OUTPUT_DIR_HTML}) # The sphinx-html target is provided as a convenience for incremental @@ -380,7 +388,10 @@ endif() # # Dependencies and final targets # -add_dependencies(html content kconfig devicetree) + +# nRF-specific: No 'kconfig' dependency here, because we use a shared Kconfig +# documentation set instead +add_dependencies(html content devicetree) add_custom_target( htmldocs diff --git a/doc/README.rst b/doc/README.rst index 62c22d5e46d..45cdfa1faf0 100644 --- a/doc/README.rst +++ b/doc/README.rst @@ -64,6 +64,8 @@ described in :ref:`getting_started`. Then install additional tools that are only required to generate the documentation, as described below: +.. doc_processors_installation_start + .. tabs:: .. group-tab:: Linux @@ -96,6 +98,8 @@ as described below: .. group-tab:: macOS + Use ``brew`` and ``tlmgr`` to install the tools: + .. code-block:: console brew install doxygen mactex librsvg @@ -104,7 +108,7 @@ as described below: .. group-tab:: Windows - Run in an Administrator ``cmd.exe`` prompt: + Open a ``cmd.exe`` window as **Administrator** and run the following command: .. code-block:: console @@ -113,10 +117,12 @@ as described below: .. note:: On Windows, the Sphinx executable ``sphinx-build.exe`` is placed in the ``Scripts`` folder of your Python installation path. - Dependending on how you have installed Python, you may need to + Dependending on how you have installed Python, you might need to add this folder to your ``PATH`` environment variable. Follow the instructions in `Windows Python Path`_ to add those if needed. +.. doc_processors_installation_end + Documentation presentation theme ******************************** diff --git a/doc/_extensions/zephyr/doxyrunner.py b/doc/_extensions/zephyr/doxyrunner.py index 6e9d62c4fac..2dcf90fa515 100644 --- a/doc/_extensions/zephyr/doxyrunner.py +++ b/doc/_extensions/zephyr/doxyrunner.py @@ -238,24 +238,26 @@ def sync_doxygen(doxyfile: str, new: Path, prev: Path) -> None: prev: Previous Doxygen build output directory. """ - html_output = get_doxygen_option(doxyfile, "HTML_OUTPUT") - if not html_output: - raise ValueError("No HTML_OUTPUT set in Doxyfile") + generate_html = get_doxygen_option(doxyfile, "GENERATE_HTML") + if generate_html == "YES": + html_output = get_doxygen_option(doxyfile, "HTML_OUTPUT") + if not html_output: + raise ValueError("No HTML_OUTPUT set in Doxyfile") + + new_htmldir = new / html_output[0] + prev_htmldir = prev / html_output[0] + + if prev_htmldir.exists(): + shutil.rmtree(prev_htmldir) + new_htmldir.rename(prev_htmldir) xml_output = get_doxygen_option(doxyfile, "XML_OUTPUT") if not xml_output: raise ValueError("No XML_OUTPUT set in Doxyfile") - new_htmldir = new / html_output[0] - prev_htmldir = prev / html_output[0] - new_xmldir = new / xml_output[0] prev_xmldir = prev / xml_output[0] - if prev_htmldir.exists(): - shutil.rmtree(prev_htmldir) - new_htmldir.rename(prev_htmldir) - if prev_xmldir.exists(): dcmp = filecmp.dircmp(new_xmldir, prev_xmldir) diff --git a/doc/_scripts/gen_kconfig_rest.py b/doc/_scripts/gen_kconfig_rest.py index 7c6ac7cc90f..1b8db4e9775 100755 --- a/doc/_scripts/gen_kconfig_rest.py +++ b/doc/_scripts/gen_kconfig_rest.py @@ -16,6 +16,7 @@ from operator import attrgetter import os import pathlib +import re import sys import textwrap @@ -23,6 +24,22 @@ import gen_helpers +NO_MAX_WIDTH = """ + +.. raw:: html + + + + +""" + +def escape_inline_rst(text): + # Escape reStructuredText inline markup characters + return re.sub(r"(\*|_|`)", r"\\\1", text) + def rst_link(sc): # Returns an RST link (string) for the symbol/choice 'sc', or the normal # Kconfig expression format (e.g. just the name) for 'sc' if it can't be @@ -318,6 +335,7 @@ def write_main_index_page(): index_header(title="All Configuration Options", link="configuration_options_all", desc_path=None) + + NO_MAX_WIDTH + sym_table_rst("Configuration Options", kconf.unique_defined_syms)) @@ -332,6 +350,7 @@ def write_main_index_page(): """ + "\n".join(" index-" + suffix for _, suffix, _, _, in modules) if not separate_all_index: + rst += NO_MAX_WIDTH # Put index of all symbols in index.rst rst += sym_table_rst("All configuration options", kconf.unique_defined_syms) @@ -359,6 +378,7 @@ def write_module_index_pages(): link="configuration_options_" + suffix, desc_path=desc_path) + rst += NO_MAX_WIDTH rst += sym_table_rst("Configuration Options", module2syms[title]) @@ -379,7 +399,7 @@ def sym_table_rst(title, syms): :widths: auto * - Symbol name - - Help/prompt + - Prompt """ for sym in sorted(syms, key=attrgetter("name")): @@ -394,15 +414,9 @@ def sym_table_rst(title, syms): def sym_index_desc(sym): # Returns the description used for 'sym' on the index page - # Use the first help text, if available - for node in sym.nodes: - if node.help is not None: - return node.help.replace("\n", "\n ") - - # If there's no help, use the first prompt string for node in sym.nodes: if node.prompt: - return node.prompt[0] + return escape_inline_rst(node.prompt[0]) # No help text or prompt return "" @@ -532,7 +546,7 @@ def choice_header_rst(choice): def prompt_rst(sc): # Returns RST that lists the prompts of 'sc' (symbol or choice) - return "\n\n".join(f"*{node.prompt[0]}*" + return "\n\n".join(f"*{escape_inline_rst(node.prompt[0])}*" for node in sc.nodes if node.prompt) \ or "*(No prompt -- not directly user assignable.)*" @@ -548,7 +562,8 @@ def help_rst(sc): if node.help is not None: rst += "Help\n" \ "====\n\n" \ - f"{node.help}\n\n" + ".. code-block:: none\n\n" \ + f"{textwrap.indent(node.help, 4 * ' ')}\n\n" return rst @@ -721,15 +736,13 @@ def menu_path(node): if len(sc.nodes) > 1: heading += "s" rst = f"{heading}\n{len(heading)*'='}\n\n" - rst += ".. highlight:: kconfig" - for node in sc.nodes: rst += "\n\n" \ f"At ``{strip_module_path(node.filename)}:{node.linenr}``\n\n" \ f"{include_path(node)}" \ f"Menu path: {menu_path(node)}\n\n" \ - ".. parsed-literal::\n\n" \ - f"{textwrap.indent(node.custom_str(rst_link), 4*' ')}" + ".. code-block:: kconfig\n\n" \ + f"{textwrap.indent(str(node), 4*' ')}" # Not the last node? if node is not sc.nodes[-1]: diff --git a/doc/conf.py b/doc/conf.py index 905bd4c9195..5a463421e26 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -118,15 +118,15 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_theme_options = {"prev_next_buttons_location": None} html_title = "Zephyr Project Documentation" -html_logo = "_static/images/logo.svg" -html_favicon = "images/zp_favicon.png" +html_logo = str(ZEPHYR_BASE / "doc" / "_static" / "images" / "logo.svg") +html_favicon = str(ZEPHYR_BASE / "doc" / "images" / "zp_favicon.png") html_static_path = [str(ZEPHYR_BASE / "doc" / "_static")] html_last_updated_fmt = "%b %d, %Y" html_domain_indices = False html_split_index = True html_show_sourcelink = False html_show_sphinx = False -html_search_scorer = "_static/js/scorer.js" +html_search_scorer = str(ZEPHYR_BASE / "doc" / "_static" / "js" / "scorer.js") is_release = tags.has("release") # pylint: disable=undefined-variable docs_title = "Docs / {}".format(version if is_release else "Latest") @@ -166,17 +166,14 @@ # -- Options for Breathe plugin ------------------------------------------- -breathe_projects = { - "Zephyr": str(doxyrunner_outdir / "xml"), - "doc-examples": str(doxyrunner_outdir / "xml"), -} +breathe_projects = {"Zephyr": str(doxyrunner_outdir / "xml")} breathe_default_project = "Zephyr" breathe_domain_by_extension = { "h": "c", "c": "c", } -breathe_separate_member_pages = True breathe_show_enumvalue_initializer = True +breathe_default_members = ("members", ) cpp_id_attributes = [ "__syscall", diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index 994de14f635..abe92a1e876 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -57,7 +57,9 @@ Next, you'll install some host dependencies using your package manager. .. group-tab:: Ubuntu - #. Use ``apt`` to install dependencies: + .. _install_dependencies_ubuntu: + + #. Use ``apt`` to install the required dependencies: .. code-block:: bash @@ -66,13 +68,13 @@ Next, you'll install some host dependencies using your package manager. python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \ make gcc gcc-multilib g++-multilib libsdl2-dev - #. Verify the version of cmake installed on your system using:: + #. Verify the version of cmake that is installed on your system by entering:: cmake --version - If it's not version 3.13.1 or higher, follow these steps to - add the `Kitware third-party apt repository `__ - to get an updated version of cmake. + The version must be 3.13.1 or later. If your version is older, complete the following + steps to add the `Kitware third-party apt repository `__, + which contains an updated version of cmake. a) Add the Kitware signing key: @@ -87,7 +89,7 @@ Next, you'll install some host dependencies using your package manager. sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' - c) Then install the updated cmake with ``apt``: + c) Then install the updated version of cmake with ``apt``: .. code-block:: bash @@ -96,13 +98,15 @@ Next, you'll install some host dependencies using your package manager. .. group-tab:: macOS + .. _install_dependencies_macos: + #. Install `Homebrew `_: .. code-block:: bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - #. Use ``brew`` to install dependencies: + #. Use ``brew`` to install the required dependencies: .. code-block:: bash @@ -130,27 +134,29 @@ Next, you'll install some host dependencies using your package manager. |p| - #. `Install chocolatey`_ + .. _install_dependencies_windows: + + #. `Install chocolatey`_. - #. Open an **Administrator** ``cmd.exe`` window: press the Windows key, - type "cmd.exe", right-click the result, and choose "Run as - Administrator". + #. Open a ``cmd.exe`` window as **Administrator**. To do so, press the Windows key, + type "cmd.exe", right-click the result, and choose :guilabel:`Run as + Administrator`. - #. Disable global confirmation to avoid having to confirm + #. Disable global confirmation to avoid having to confirm the installation of individual programs: .. code-block:: console choco feature enable -n allowGlobalConfirmation - #. Use ``choco`` to install dependencies: + #. Use ``choco`` to install the required dependencies: .. code-block:: console choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' choco install ninja gperf python git - #. Open a new ``cmd.exe`` window **as a regular user** to continue. + #. Close the window and open a new ``cmd.exe`` window **as a regular user** to continue. .. _Chocolatey: https://chocolatey.org/ .. _Install chocolatey: https://chocolatey.org/install diff --git a/doc/guides/flash_debug/coredump.rst b/doc/guides/flash_debug/coredump.rst index 56930ea34a1..cfa204177f8 100644 --- a/doc/guides/flash_debug/coredump.rst +++ b/doc/guides/flash_debug/coredump.rst @@ -341,7 +341,5 @@ API documentation ***************** .. doxygengroup:: coredump_apis - :project: Zephyr .. doxygengroup:: arch-coredump - :project: Zephyr diff --git a/doc/guides/flash_debug/thread-analyzer.rst b/doc/guides/flash_debug/thread-analyzer.rst index 9abeffefb25..39fd8bd9c9d 100644 --- a/doc/guides/flash_debug/thread-analyzer.rst +++ b/doc/guides/flash_debug/thread-analyzer.rst @@ -85,4 +85,3 @@ API documentation ***************** .. doxygengroup:: thread_analyzer - :project: Zephyr diff --git a/doc/guides/porting/arch.rst b/doc/guides/porting/arch.rst index a2915061287..0cbd59e6a0e 100644 --- a/doc/guides/porting/arch.rst +++ b/doc/guides/porting/arch.rst @@ -863,49 +863,40 @@ Timing ====== .. doxygengroup:: arch-timing - :project: Zephyr Threads ======= .. doxygengroup:: arch-threads - :project: Zephyr .. doxygengroup:: arch-tls - :project: Zephyr Power Management ================ .. doxygengroup:: arch-pm - :project: Zephyr Symmetric Multi-Processing ========================== .. doxygengroup:: arch-smp - :project: Zephyr Interrupts ========== .. doxygengroup:: arch-irq - :project: Zephyr Userspace ========= .. doxygengroup:: arch-userspace - :project: Zephyr Memory Management ================= .. doxygengroup:: arch-mmu - :project: Zephyr Miscellaneous Architecture APIs =============================== .. doxygengroup:: arch-misc - :project: Zephyr diff --git a/doc/guides/test/ztest.rst b/doc/guides/test/ztest.rst index e97a351a182..5f68fb3450c 100644 --- a/doc/guides/test/ztest.rst +++ b/doc/guides/test/ztest.rst @@ -300,7 +300,6 @@ Running tests ============= .. doxygengroup:: ztest_test - :project: Zephyr Assertions ========== @@ -320,7 +319,6 @@ Example output for a failed macro from Aborted at unit test function .. doxygengroup:: ztest_assert - :project: Zephyr Mocking ======= @@ -340,7 +338,6 @@ expect the values ``a=2`` and ``b=3``, and telling ``returns_int`` to return :linenos: .. doxygengroup:: ztest_mock - :project: Zephyr Customizing Test Output *********************** diff --git a/doc/guides/tracing/index.rst b/doc/guides/tracing/index.rst index 942b67992f6..d8e95cf4cf0 100644 --- a/doc/guides/tracing/index.rst +++ b/doc/guides/tracing/index.rst @@ -25,7 +25,6 @@ format by overriding the macros declared in :zephyr_file:`include/tracing/tracing.h`. .. doxygengroup:: tracing_apis - :project: Zephyr Different formats, transports and host tools are avialable and supported in Zephyr. diff --git a/doc/known-warnings.txt b/doc/known-warnings.txt index 4e9601ae457..08b0d760674 100644 --- a/doc/known-warnings.txt +++ b/doc/known-warnings.txt @@ -1,16 +1,16 @@ # Each line should contain the regular expression of a known Sphinx warning # that should be filtered out -.*Duplicate C declaration.*\n.*'\.\. c:struct:: dma_config'.* -.*Duplicate C declaration.*\n.*'\.\. c:struct:: zsock_fd_set'.* -.*Duplicate C declaration.*\n.*'\.\. c:struct:: net_if_mcast_monitor'.* -.*Duplicate C declaration.*\n.*'\.\. c:struct:: fs_statvfs'.* -.*Duplicate C declaration.*\n.*'\.\. c:function:: .*dmic_trigger.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:var:: uint16_t id'.* -.*Duplicate C declaration.*\n.*'\.\. c:function:: .*net_if_ipv4_addr_mask_cmp.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:function:: .*net_if_ipv4_is_addr_bcast.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:function:: .*net_if_ipv4_addr_lookup.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:function:: .*net_if_ipv6_addr_lookup.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:function:: .*net_if_ipv6_maddr_lookup.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:None:: .*struct in_addr.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:None:: .*struct in6_addr.*'.* -.*Duplicate C declaration.*\n.*'\.\. c:None:: .*struct net_if.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: dma_config'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: zsock_fd_set'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: net_if_mcast_monitor'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: fs_statvfs'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*dmic_trigger.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: uint16_t id'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_addr_mask_cmp.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_is_addr_bcast.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_addr_lookup.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv6_addr_lookup.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv6_maddr_lookup.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct in_addr.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct in6_addr.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct net_if.*'.* diff --git a/doc/reference/audio/codec.rst b/doc/reference/audio/codec.rst index 34c9c4a2a30..b5bad0c5a02 100644 --- a/doc/reference/audio/codec.rst +++ b/doc/reference/audio/codec.rst @@ -19,4 +19,3 @@ API Reference ************* .. doxygengroup:: audio_codec_interface - :project: Zephyr diff --git a/doc/reference/audio/dmic.rst b/doc/reference/audio/dmic.rst index 5ec64c7c55f..6186d6a76c7 100644 --- a/doc/reference/audio/dmic.rst +++ b/doc/reference/audio/dmic.rst @@ -19,4 +19,3 @@ API Reference ************* .. doxygengroup:: audio_dmic_interface - :project: Zephyr diff --git a/doc/reference/audio/i2s.rst b/doc/reference/audio/i2s.rst index 1100b2ce6d8..71519b8d70c 100644 --- a/doc/reference/audio/i2s.rst +++ b/doc/reference/audio/i2s.rst @@ -22,4 +22,3 @@ API Reference ************* .. doxygengroup:: i2s_interface - :project: Zephyr diff --git a/doc/reference/bluetooth/connection_mgmt.rst b/doc/reference/bluetooth/connection_mgmt.rst index 10eb91d08bd..183fc5e6379 100644 --- a/doc/reference/bluetooth/connection_mgmt.rst +++ b/doc/reference/bluetooth/connection_mgmt.rst @@ -28,5 +28,4 @@ API Reference ************* .. doxygengroup:: bt_conn - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/controller.rst b/doc/reference/bluetooth/controller.rst index 53fd86dc688..d2b8bdbed52 100644 --- a/doc/reference/bluetooth/controller.rst +++ b/doc/reference/bluetooth/controller.rst @@ -8,5 +8,4 @@ API Reference ************* .. doxygengroup:: bt_ctrl - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/crypto.rst b/doc/reference/bluetooth/crypto.rst index 85ddb24965d..86bb717d1bb 100644 --- a/doc/reference/bluetooth/crypto.rst +++ b/doc/reference/bluetooth/crypto.rst @@ -8,5 +8,4 @@ API Reference ************* .. doxygengroup:: bt_crypto - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/data_buffer.rst b/doc/reference/bluetooth/data_buffer.rst index c941a410d27..6c96b851b90 100644 --- a/doc/reference/bluetooth/data_buffer.rst +++ b/doc/reference/bluetooth/data_buffer.rst @@ -8,5 +8,4 @@ API Reference ************* .. doxygengroup:: bt_buf - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/gap.rst b/doc/reference/bluetooth/gap.rst index b195d480109..792b4102347 100644 --- a/doc/reference/bluetooth/gap.rst +++ b/doc/reference/bluetooth/gap.rst @@ -7,13 +7,10 @@ API Reference ************* .. doxygengroup:: bt_gap - :project: Zephyr :members: .. doxygengroup:: bt_addr - :project: Zephyr :members: .. doxygengroup:: bt_gap_defines - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/gatt.rst b/doc/reference/bluetooth/gatt.rst index 3229923383e..2e8e06730d3 100644 --- a/doc/reference/bluetooth/gatt.rst +++ b/doc/reference/bluetooth/gatt.rst @@ -96,19 +96,16 @@ API Reference ************* .. doxygengroup:: bt_gatt - :project: Zephyr :members: GATT Server =========== .. doxygengroup:: bt_gatt_server - :project: Zephyr :members: GATT Client =========== .. doxygengroup:: bt_gatt_client - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/hci_drivers.rst b/doc/reference/bluetooth/hci_drivers.rst index c89dbcb8bb9..c9bdddedcfd 100644 --- a/doc/reference/bluetooth/hci_drivers.rst +++ b/doc/reference/bluetooth/hci_drivers.rst @@ -9,5 +9,4 @@ API Reference ************* .. doxygengroup:: bt_hci_driver - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/hci_raw.rst b/doc/reference/bluetooth/hci_raw.rst index 3be8955cab8..10b93178ef6 100644 --- a/doc/reference/bluetooth/hci_raw.rst +++ b/doc/reference/bluetooth/hci_raw.rst @@ -16,5 +16,4 @@ API Reference ************* .. doxygengroup:: hci_raw - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/hfp.rst b/doc/reference/bluetooth/hfp.rst index 16b93e58863..003bfd35ec5 100644 --- a/doc/reference/bluetooth/hfp.rst +++ b/doc/reference/bluetooth/hfp.rst @@ -8,5 +8,4 @@ API Reference ************* .. doxygengroup:: bt_hfp - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/l2cap.rst b/doc/reference/bluetooth/l2cap.rst index 277c5220833..22d0e5f6869 100644 --- a/doc/reference/bluetooth/l2cap.rst +++ b/doc/reference/bluetooth/l2cap.rst @@ -39,5 +39,4 @@ API Reference ************* .. doxygengroup:: bt_l2cap - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/access.rst b/doc/reference/bluetooth/mesh/access.rst index e7ea80b9200..76ade9fe729 100644 --- a/doc/reference/bluetooth/mesh/access.rst +++ b/doc/reference/bluetooth/mesh/access.rst @@ -143,5 +143,4 @@ API reference ************* .. doxygengroup:: bt_mesh_access - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/cfg.rst b/doc/reference/bluetooth/mesh/cfg.rst index af38e17abb6..2aece88d06d 100644 --- a/doc/reference/bluetooth/mesh/cfg.rst +++ b/doc/reference/bluetooth/mesh/cfg.rst @@ -19,5 +19,4 @@ API reference ************* .. doxygengroup:: bt_mesh_cfg - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/cfg_cli.rst b/doc/reference/bluetooth/mesh/cfg_cli.rst index 6cf2a5deddf..cee2bec47aa 100644 --- a/doc/reference/bluetooth/mesh/cfg_cli.rst +++ b/doc/reference/bluetooth/mesh/cfg_cli.rst @@ -24,5 +24,4 @@ API reference ************* .. doxygengroup:: bt_mesh_cfg_cli - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/cfg_srv.rst b/doc/reference/bluetooth/mesh/cfg_srv.rst index 0e85127fb34..f48099b2cb0 100644 --- a/doc/reference/bluetooth/mesh/cfg_srv.rst +++ b/doc/reference/bluetooth/mesh/cfg_srv.rst @@ -21,5 +21,4 @@ API reference ************* .. doxygengroup:: bt_mesh_cfg_srv - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/core.rst b/doc/reference/bluetooth/mesh/core.rst index 8320be23992..338ea4801c9 100644 --- a/doc/reference/bluetooth/mesh/core.rst +++ b/doc/reference/bluetooth/mesh/core.rst @@ -25,5 +25,4 @@ API reference ************** .. doxygengroup:: bt_mesh - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/health_cli.rst b/doc/reference/bluetooth/mesh/health_cli.rst index 865fd9d85b3..25d1c1e01aa 100644 --- a/doc/reference/bluetooth/mesh/health_cli.rst +++ b/doc/reference/bluetooth/mesh/health_cli.rst @@ -21,5 +21,4 @@ API reference ************* .. doxygengroup:: bt_mesh_health_cli - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/health_srv.rst b/doc/reference/bluetooth/mesh/health_srv.rst index a3435d41f10..8d978d3c3ad 100644 --- a/doc/reference/bluetooth/mesh/health_srv.rst +++ b/doc/reference/bluetooth/mesh/health_srv.rst @@ -49,7 +49,6 @@ API reference ************* .. doxygengroup:: bt_mesh_health_srv - :project: Zephyr :members: .. _bluetooth_mesh_health_faults: @@ -60,5 +59,4 @@ Bluetooth Mesh Health Faults Fault values defined by the Bluetooth Mesh specification. .. doxygengroup:: bt_mesh_health_faults - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/heartbeat.rst b/doc/reference/bluetooth/mesh/heartbeat.rst index c867b051965..77b100afacd 100644 --- a/doc/reference/bluetooth/mesh/heartbeat.rst +++ b/doc/reference/bluetooth/mesh/heartbeat.rst @@ -63,5 +63,4 @@ API reference ************** .. doxygengroup:: bt_mesh_heartbeat - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/msg.rst b/doc/reference/bluetooth/mesh/msg.rst index 8f0acd6b83d..8345550598e 100644 --- a/doc/reference/bluetooth/mesh/msg.rst +++ b/doc/reference/bluetooth/mesh/msg.rst @@ -10,5 +10,4 @@ API reference ************* .. doxygengroup:: bt_mesh_msg - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/provisioning.rst b/doc/reference/bluetooth/mesh/provisioning.rst index 64a25dcacc7..03a226a58c7 100644 --- a/doc/reference/bluetooth/mesh/provisioning.rst +++ b/doc/reference/bluetooth/mesh/provisioning.rst @@ -132,5 +132,4 @@ API reference ************* .. doxygengroup:: bt_mesh_prov - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/mesh/proxy.rst b/doc/reference/bluetooth/mesh/proxy.rst index 6f31a15b478..18101dc0f72 100644 --- a/doc/reference/bluetooth/mesh/proxy.rst +++ b/doc/reference/bluetooth/mesh/proxy.rst @@ -13,5 +13,4 @@ API reference ************* .. doxygengroup:: bt_mesh_proxy - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/rfcomm.rst b/doc/reference/bluetooth/rfcomm.rst index fe07ef61b2e..4d88ae4ce15 100644 --- a/doc/reference/bluetooth/rfcomm.rst +++ b/doc/reference/bluetooth/rfcomm.rst @@ -9,5 +9,4 @@ API Reference ************* .. doxygengroup:: bt_rfcomm - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/sdp.rst b/doc/reference/bluetooth/sdp.rst index c708df7b6a8..0ce83962df5 100644 --- a/doc/reference/bluetooth/sdp.rst +++ b/doc/reference/bluetooth/sdp.rst @@ -7,5 +7,4 @@ API Reference ************** .. doxygengroup:: bt_sdp - :project: Zephyr :members: diff --git a/doc/reference/bluetooth/uuid.rst b/doc/reference/bluetooth/uuid.rst index 02b82a25295..84551c56072 100644 --- a/doc/reference/bluetooth/uuid.rst +++ b/doc/reference/bluetooth/uuid.rst @@ -8,5 +8,4 @@ API Reference ************* .. doxygengroup:: bt_uuid - :project: Zephyr :members: diff --git a/doc/reference/crypto/index.rst b/doc/reference/crypto/index.rst index dbd56b0a782..cdcb333a9b8 100644 --- a/doc/reference/crypto/index.rst +++ b/doc/reference/crypto/index.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: crypto_cipher - :project: Zephyr diff --git a/doc/reference/data_structures/dlist.rst b/doc/reference/data_structures/dlist.rst index addb929f8de..179a1035855 100644 --- a/doc/reference/data_structures/dlist.rst +++ b/doc/reference/data_structures/dlist.rst @@ -98,4 +98,3 @@ Doubly-linked List API Reference -------------------------------- .. doxygengroup:: doubly-linked-list_apis - :project: Zephyr diff --git a/doc/reference/data_structures/rbtree.rst b/doc/reference/data_structures/rbtree.rst index 52910fa243b..d644da308ec 100644 --- a/doc/reference/data_structures/rbtree.rst +++ b/doc/reference/data_structures/rbtree.rst @@ -119,4 +119,3 @@ Red/Black Tree API Reference -------------------------------- .. doxygengroup:: rbtree_apis - :project: Zephyr diff --git a/doc/reference/data_structures/ring_buffers.rst b/doc/reference/data_structures/ring_buffers.rst index c6258687957..982fd8ebc75 100644 --- a/doc/reference/data_structures/ring_buffers.rst +++ b/doc/reference/data_structures/ring_buffers.rst @@ -413,4 +413,3 @@ API Reference The following ring buffer APIs are provided by :zephyr_file:`include/sys/ring_buffer.h`: .. doxygengroup:: ring_buffer_apis - :project: Zephyr diff --git a/doc/reference/data_structures/slist.rst b/doc/reference/data_structures/slist.rst index 7e36bb592ee..add76e869a6 100644 --- a/doc/reference/data_structures/slist.rst +++ b/doc/reference/data_structures/slist.rst @@ -118,10 +118,8 @@ Single-linked List API Reference -------------------------------- .. doxygengroup:: single-linked-list_apis - :project: Zephyr Flagged List API Reference -------------------------------- .. doxygengroup:: flagged-single-linked-list_apis - :project: Zephyr diff --git a/doc/reference/devicetree/api.rst b/doc/reference/devicetree/api.rst index d81b67aac58..6c3a38fa444 100644 --- a/doc/reference/devicetree/api.rst +++ b/doc/reference/devicetree/api.rst @@ -39,7 +39,6 @@ child node, respectively. The following macros create or operate on node identifiers. .. doxygengroup:: devicetree-generic-id - :project: Zephyr .. _devicetree-property-access: @@ -54,7 +53,6 @@ Property values can be read using these macros even if the node is disabled, as long as it has a matching binding. .. doxygengroup:: devicetree-generic-prop - :project: Zephyr .. _devicetree-reg-property: @@ -67,7 +65,6 @@ devicetree specification, these macros can be used even for nodes without matching bindings. .. doxygengroup:: devicetree-reg-prop - :project: Zephyr .. _devicetree-interrupts-property: @@ -82,7 +79,6 @@ some of these macros can be used even for nodes without matching bindings. This does not apply to macros which take cell names as arguments. .. doxygengroup:: devicetree-interrupts-prop - :project: Zephyr For-each macros =============== @@ -96,7 +92,6 @@ There are special-purpose for-each macros, like be defined before use. .. doxygengroup:: devicetree-generic-foreach - :project: Zephyr Existence checks ================ @@ -108,7 +103,6 @@ properties, etc. Some macros used for special purposes (such as documented elsewhere on this page. .. doxygengroup:: devicetree-generic-exist - :project: Zephyr .. _devicetree-dep-ord: @@ -146,7 +140,6 @@ There are instance number-based conveniences as well; see :c:func:`DT_INST_DEP_ORD` and subsequent documentation. .. doxygengroup:: devicetree-dep-ord - :project: Zephyr Bus helpers =========== @@ -157,7 +150,6 @@ In this case, child nodes are considered to be on a bus of the given type, and the following APIs may be used. .. doxygengroup:: devicetree-generic-bus - :project: Zephyr .. _devicetree-inst-apis: @@ -207,7 +199,6 @@ Note that there are also helpers available for specific hardware; these are documented in :ref:`devicetree-hw-api`. .. doxygengroup:: devicetree-inst - :project: Zephyr .. _devicetree-hw-api: @@ -224,7 +215,6 @@ These conveniences may be used for nodes which describe clock sources, and properties related to them. .. doxygengroup:: devicetree-clocks - :project: Zephyr DMA === @@ -233,7 +223,6 @@ These conveniences may be used for nodes which describe direct memory access controllers or channels, and properties related to them. .. doxygengroup:: devicetree-dmas - :project: Zephyr .. _devicetree-flash-api: @@ -246,7 +235,6 @@ device tree. See :zephyr_file:`dts/bindings/mtd/partition.yaml` for this compatible's binding. .. doxygengroup:: devicetree-fixed-partition - :project: Zephyr .. _devicetree-gpio-api: @@ -257,7 +245,6 @@ These conveniences may be used for nodes which describe GPIO controllers/pins, and properties related to them. .. doxygengroup:: devicetree-gpio - :project: Zephyr IO channels =========== @@ -266,7 +253,6 @@ These are commonly used by device drivers which need to use IO channels (e.g. ADC or DAC channels) for conversion. .. doxygengroup:: devicetree-io-channels - :project: Zephyr PWM === @@ -275,7 +261,6 @@ These conveniences may be used for nodes which describe PWM controllers and properties related to them. .. doxygengroup:: devicetree-pwms - :project: Zephyr SPI === @@ -284,7 +269,6 @@ These conveniences may be used for nodes which describe either SPI controllers or devices, depending on the case. .. doxygengroup:: devicetree-spi - :project: Zephyr .. _devicetree-chosen-nodes: diff --git a/doc/reference/display/index.rst b/doc/reference/display/index.rst index a4c0995d4c0..905412cf69f 100644 --- a/doc/reference/display/index.rst +++ b/doc/reference/display/index.rst @@ -16,22 +16,18 @@ Generic Display Interface ========================= .. doxygengroup:: display_interface - :project: Zephyr Grove LCD Display ================= .. doxygengroup:: grove_display - :project: Zephyr BBC micro:bit Display ===================== .. doxygengroup:: mb_display - :project: Zephyr Monochrome Character Framebuffer ================================ .. doxygengroup:: monochrome_character_framebuffer - :project: Zephyr diff --git a/doc/reference/drivers/index.rst b/doc/reference/drivers/index.rst index 9a82be4875b..af33e7a5861 100644 --- a/doc/reference/drivers/index.rst +++ b/doc/reference/drivers/index.rst @@ -593,4 +593,3 @@ API Reference ************** .. doxygengroup:: device_model - :project: Zephyr diff --git a/doc/reference/edac/index.rst b/doc/reference/edac/index.rst index aab6ffa0717..a3401b96ad7 100644 --- a/doc/reference/edac/index.rst +++ b/doc/reference/edac/index.rst @@ -7,4 +7,3 @@ API Reference ************* .. doxygengroup:: edac - :project: Zephyr diff --git a/doc/reference/file_system/index.rst b/doc/reference/file_system/index.rst index 9174deb868b..74476da6dc0 100644 --- a/doc/reference/file_system/index.rst +++ b/doc/reference/file_system/index.rst @@ -61,4 +61,3 @@ API Reference ************* .. doxygengroup:: file_system_api - :project: Zephyr diff --git a/doc/reference/index.rst b/doc/reference/index.rst index 73ec4d55e77..5d99d9de299 100644 --- a/doc/reference/index.rst +++ b/doc/reference/index.rst @@ -3,6 +3,9 @@ API Reference ############# +.. nRF-specific: There's a shared Kconfig documentation set, so + no kconfig/index.rst below + .. toctree:: :maxdepth: 1 @@ -10,7 +13,6 @@ API Reference audio/index.rst misc/notify.rst bluetooth/index.rst - kconfig/index.rst crypto/index.rst devicetree/index.rst drivers/index.rst diff --git a/doc/reference/kernel/data_passing/fifos.rst b/doc/reference/kernel/data_passing/fifos.rst index ebf884ba5fa..c9d20979168 100644 --- a/doc/reference/kernel/data_passing/fifos.rst +++ b/doc/reference/kernel/data_passing/fifos.rst @@ -160,4 +160,3 @@ API Reference ************* .. doxygengroup:: fifo_apis - :project: Zephyr diff --git a/doc/reference/kernel/data_passing/lifos.rst b/doc/reference/kernel/data_passing/lifos.rst index 89ad681b886..699bd5d11b5 100644 --- a/doc/reference/kernel/data_passing/lifos.rst +++ b/doc/reference/kernel/data_passing/lifos.rst @@ -148,4 +148,3 @@ API Reference ************* .. doxygengroup:: lifo_apis - :project: Zephyr diff --git a/doc/reference/kernel/data_passing/mailboxes.rst b/doc/reference/kernel/data_passing/mailboxes.rst index 22c1a7c96a2..f2486b3e8f8 100644 --- a/doc/reference/kernel/data_passing/mailboxes.rst +++ b/doc/reference/kernel/data_passing/mailboxes.rst @@ -635,4 +635,3 @@ API Reference ************* .. doxygengroup:: mailbox_apis - :project: Zephyr diff --git a/doc/reference/kernel/data_passing/message_queues.rst b/doc/reference/kernel/data_passing/message_queues.rst index d246deaa98a..7f7e450d59e 100644 --- a/doc/reference/kernel/data_passing/message_queues.rst +++ b/doc/reference/kernel/data_passing/message_queues.rst @@ -221,4 +221,3 @@ API Reference ************* .. doxygengroup:: msgq_apis - :project: Zephyr diff --git a/doc/reference/kernel/data_passing/pipes.rst b/doc/reference/kernel/data_passing/pipes.rst index 998ae90d800..ca461600c1b 100644 --- a/doc/reference/kernel/data_passing/pipes.rst +++ b/doc/reference/kernel/data_passing/pipes.rst @@ -178,4 +178,3 @@ API Reference ************* .. doxygengroup:: pipe_apis - :project: Zephyr diff --git a/doc/reference/kernel/data_passing/queues.rst b/doc/reference/kernel/data_passing/queues.rst index 58ad970ca18..8fc6d3ecdf8 100644 --- a/doc/reference/kernel/data_passing/queues.rst +++ b/doc/reference/kernel/data_passing/queues.rst @@ -15,4 +15,3 @@ API Reference ************* .. doxygengroup:: queue_apis - :project: Zephyr diff --git a/doc/reference/kernel/data_passing/stacks.rst b/doc/reference/kernel/data_passing/stacks.rst index 27d87193009..89c0ff5dc39 100644 --- a/doc/reference/kernel/data_passing/stacks.rst +++ b/doc/reference/kernel/data_passing/stacks.rst @@ -140,4 +140,3 @@ API Reference ************* .. doxygengroup:: stack_apis - :project: Zephyr diff --git a/doc/reference/kernel/memory/heap.rst b/doc/reference/kernel/memory/heap.rst index 51d9d88dba6..e172b5b1cd4 100644 --- a/doc/reference/kernel/memory/heap.rst +++ b/doc/reference/kernel/memory/heap.rst @@ -181,4 +181,3 @@ API Reference ============= .. doxygengroup:: heap_apis - :project: Zephyr diff --git a/doc/reference/kernel/memory/slabs.rst b/doc/reference/kernel/memory/slabs.rst index 4e71b2a0615..e2335e850b0 100644 --- a/doc/reference/kernel/memory/slabs.rst +++ b/doc/reference/kernel/memory/slabs.rst @@ -145,4 +145,3 @@ API Reference ************* .. doxygengroup:: mem_slab_apis - :project: Zephyr diff --git a/doc/reference/kernel/other/atomic.rst b/doc/reference/kernel/other/atomic.rst index abeb9af9755..364a2698223 100644 --- a/doc/reference/kernel/other/atomic.rst +++ b/doc/reference/kernel/other/atomic.rst @@ -117,4 +117,3 @@ API Reference All atomic services APIs can be used by both threads and ISRs. .. doxygengroup:: atomic_apis - :project: Zephyr diff --git a/doc/reference/kernel/other/cpu_idle.rst b/doc/reference/kernel/other/cpu_idle.rst index 7290ba66e15..99ce9ad96e7 100644 --- a/doc/reference/kernel/other/cpu_idle.rst +++ b/doc/reference/kernel/other/cpu_idle.rst @@ -139,4 +139,3 @@ API Reference ************* .. doxygengroup:: cpu_idle_apis - :project: Zephyr diff --git a/doc/reference/kernel/other/fatal.rst b/doc/reference/kernel/other/fatal.rst index 8d58519d36f..61ae26e349a 100644 --- a/doc/reference/kernel/other/fatal.rst +++ b/doc/reference/kernel/other/fatal.rst @@ -257,4 +257,3 @@ API Reference ************* .. doxygengroup:: fatal_apis - :project: Zephyr diff --git a/doc/reference/kernel/other/float.rst b/doc/reference/kernel/other/float.rst index d9a1e85c2a2..529245730e2 100644 --- a/doc/reference/kernel/other/float.rst +++ b/doc/reference/kernel/other/float.rst @@ -352,4 +352,3 @@ API Reference ************* .. doxygengroup:: float_apis - :project: Zephyr diff --git a/doc/reference/kernel/other/interrupts.rst b/doc/reference/kernel/other/interrupts.rst index 2624501b05a..e7b1a4082cc 100644 --- a/doc/reference/kernel/other/interrupts.rst +++ b/doc/reference/kernel/other/interrupts.rst @@ -479,4 +479,3 @@ API Reference ************* .. doxygengroup:: isr_apis - :project: Zephyr diff --git a/doc/reference/kernel/other/polling.rst b/doc/reference/kernel/other/polling.rst index 281dfe2b117..9945753fadd 100644 --- a/doc/reference/kernel/other/polling.rst +++ b/doc/reference/kernel/other/polling.rst @@ -283,4 +283,3 @@ API Reference ************* .. doxygengroup:: poll_apis - :project: Zephyr diff --git a/doc/reference/kernel/other/version.rst b/doc/reference/kernel/other/version.rst index 34fcf81470b..dde8f693004 100644 --- a/doc/reference/kernel/other/version.rst +++ b/doc/reference/kernel/other/version.rst @@ -9,5 +9,4 @@ API Reference ************** .. doxygengroup:: version_apis - :project: Zephyr :content-only: diff --git a/doc/reference/kernel/synchronization/condvar.rst b/doc/reference/kernel/synchronization/condvar.rst index 42b375f4096..77bcb1ace0f 100644 --- a/doc/reference/kernel/synchronization/condvar.rst +++ b/doc/reference/kernel/synchronization/condvar.rst @@ -136,4 +136,3 @@ API Reference ************** .. doxygengroup:: condvar_apis - :project: Zephyr diff --git a/doc/reference/kernel/synchronization/mutexes.rst b/doc/reference/kernel/synchronization/mutexes.rst index 829ab693ade..d0d1d85a167 100644 --- a/doc/reference/kernel/synchronization/mutexes.rst +++ b/doc/reference/kernel/synchronization/mutexes.rst @@ -165,7 +165,6 @@ API Reference ************* .. doxygengroup:: mutex_apis - :project: Zephyr Futex API Reference ******************* @@ -177,7 +176,6 @@ user memory so that any access bypasses the kernel object permission management mechanism. .. doxygengroup:: futex_apis - :project: Zephyr User Mode Mutex API Reference ***************************** @@ -187,4 +185,3 @@ that a sys_mutex instance can reside in user memory. When user mode isn't enabled, sys_mutex behaves like k_mutex. .. doxygengroup:: user_mutex_apis - :project: Zephyr diff --git a/doc/reference/kernel/synchronization/semaphores.rst b/doc/reference/kernel/synchronization/semaphores.rst index fd3f414f18b..b2e1f704ef0 100644 --- a/doc/reference/kernel/synchronization/semaphores.rst +++ b/doc/reference/kernel/synchronization/semaphores.rst @@ -129,7 +129,6 @@ API Reference ************** .. doxygengroup:: semaphore_apis - :project: Zephyr User Mode Semaphore API Reference ********************************* @@ -139,4 +138,3 @@ thread when user mode enabled. When user mode isn't enabled, sys_sem behaves like k_sem. .. doxygengroup:: user_semaphore_apis - :project: Zephyr diff --git a/doc/reference/kernel/threads/index.rst b/doc/reference/kernel/threads/index.rst index 11d26a3f236..ddfa41cb8da 100644 --- a/doc/reference/kernel/threads/index.rst +++ b/doc/reference/kernel/threads/index.rst @@ -541,4 +541,5 @@ API Reference ************** .. doxygengroup:: thread_apis - :project: Zephyr + +.. doxygengroup:: thread_stack_api diff --git a/doc/reference/kernel/threads/workqueue.rst b/doc/reference/kernel/threads/workqueue.rst index 16ad9213841..d967aa176f1 100644 --- a/doc/reference/kernel/threads/workqueue.rst +++ b/doc/reference/kernel/threads/workqueue.rst @@ -546,4 +546,3 @@ API Reference ************** .. doxygengroup:: workqueue_apis - :project: Zephyr diff --git a/doc/reference/kernel/timing/timers.rst b/doc/reference/kernel/timing/timers.rst index b42c3a717a6..9220618556f 100644 --- a/doc/reference/kernel/timing/timers.rst +++ b/doc/reference/kernel/timing/timers.rst @@ -243,4 +243,3 @@ API Reference ************* .. doxygengroup:: timer_apis - :project: Zephyr diff --git a/doc/reference/logging/index.rst b/doc/reference/logging/index.rst index 8bccaa252d3..3781f647f7f 100644 --- a/doc/reference/logging/index.rst +++ b/doc/reference/logging/index.rst @@ -796,28 +796,23 @@ Logger API ========== .. doxygengroup:: log_api - :project: Zephyr Logger control ============== .. doxygengroup:: log_ctrl - :project: Zephyr Log message =========== .. doxygengroup:: log_msg - :project: Zephyr Logger backend interface ======================== .. doxygengroup:: log_backend - :project: Zephyr Logger output formatting ======================== .. doxygengroup:: log_output - :project: Zephyr diff --git a/doc/reference/misc/formatted_output.rst b/doc/reference/misc/formatted_output.rst index 7bb0ce2a2f3..24c96f7a869 100644 --- a/doc/reference/misc/formatted_output.rst +++ b/doc/reference/misc/formatted_output.rst @@ -130,4 +130,3 @@ API Reference ************* .. doxygengroup:: cbprintf_apis - :project: Zephyr diff --git a/doc/reference/misc/index.rst b/doc/reference/misc/index.rst index 21f931d2234..dae0b8ef0d2 100644 --- a/doc/reference/misc/index.rst +++ b/doc/reference/misc/index.rst @@ -15,7 +15,6 @@ CRC ===== .. doxygengroup:: crc - :project: Zephyr Structured Data APIs ******************** @@ -24,7 +23,6 @@ JSON ==== .. doxygengroup:: json - :project: Zephyr JWT === @@ -36,4 +34,3 @@ this API is limited to creating the simplistic tokens needed to authenticate with the Google Core IoT infrastructure. .. doxygengroup:: jwt - :project: Zephyr diff --git a/doc/reference/misc/notify.rst b/doc/reference/misc/notify.rst index f2ce395b273..014277cc7e6 100644 --- a/doc/reference/misc/notify.rst +++ b/doc/reference/misc/notify.rst @@ -35,4 +35,3 @@ API Reference ************* .. doxygengroup:: sys_notify_apis - :project: Zephyr diff --git a/doc/reference/misc/timeutil.rst b/doc/reference/misc/timeutil.rst index 4ed3c7178b9..072f63ee034 100644 --- a/doc/reference/misc/timeutil.rst +++ b/doc/reference/misc/timeutil.rst @@ -66,7 +66,6 @@ information about time zones. Zephyr provides this transformation with :c:func:`timeutil_timegm` and :c:func:`timeutil_timegm64`. .. doxygengroup:: timeutil_repr_apis - :project: Zephyr .. _timeutil_sync: @@ -106,7 +105,6 @@ process: :c:func:`timeutil_sync_estimate_skew`. .. doxygengroup:: timeutil_sync_apis - :project: Zephyr .. _timeutil_concepts: diff --git a/doc/reference/modbus/index.rst b/doc/reference/modbus/index.rst index 57357238fc0..df01c09bf8d 100644 --- a/doc/reference/modbus/index.rst +++ b/doc/reference/modbus/index.rst @@ -38,6 +38,5 @@ API Reference ************* .. doxygengroup:: modbus - :project: Zephyr .. _`MODBUS Protocol Specifications`: https://www.modbus.org/specs.php diff --git a/doc/reference/networking/can_api.rst b/doc/reference/networking/can_api.rst index 4fa3b8dd403..a29084ce4d6 100644 --- a/doc/reference/networking/can_api.rst +++ b/doc/reference/networking/can_api.rst @@ -376,4 +376,3 @@ API Reference ************* .. doxygengroup:: can_interface - :project: Zephyr diff --git a/doc/reference/networking/can_isotp.rst b/doc/reference/networking/can_isotp.rst index c241ec9438e..f8ad3f6e683 100644 --- a/doc/reference/networking/can_isotp.rst +++ b/doc/reference/networking/can_isotp.rst @@ -45,4 +45,3 @@ API Reference ************* .. doxygengroup:: can_isotp - :project: Zephyr diff --git a/doc/reference/networking/capture.rst b/doc/reference/networking/capture.rst index 478b7397870..ba6e347170d 100644 --- a/doc/reference/networking/capture.rst +++ b/doc/reference/networking/capture.rst @@ -26,4 +26,3 @@ API Reference ************* .. doxygengroup:: net_capture - :project: Zephyr diff --git a/doc/reference/networking/coap.rst b/doc/reference/networking/coap.rst index 59b493c0c1f..ed5e2b1fa05 100644 --- a/doc/reference/networking/coap.rst +++ b/doc/reference/networking/coap.rst @@ -204,4 +204,3 @@ API Reference ************* .. doxygengroup:: coap - :project: Zephyr diff --git a/doc/reference/networking/dhcpv4.rst b/doc/reference/networking/dhcpv4.rst index 321fe37c911..f9588e9dda4 100644 --- a/doc/reference/networking/dhcpv4.rst +++ b/doc/reference/networking/dhcpv4.rst @@ -29,4 +29,3 @@ API Reference ************* .. doxygengroup:: dhcpv4 - :project: Zephyr diff --git a/doc/reference/networking/dns_resolve.rst b/doc/reference/networking/dns_resolve.rst index 3426de93734..cf433f8b5e6 100644 --- a/doc/reference/networking/dns_resolve.rst +++ b/doc/reference/networking/dns_resolve.rst @@ -41,4 +41,3 @@ API Reference ************* .. doxygengroup:: dns_resolve - :project: Zephyr diff --git a/doc/reference/networking/ethernet.rst b/doc/reference/networking/ethernet.rst index fa1c74526df..891d6f8cafd 100644 --- a/doc/reference/networking/ethernet.rst +++ b/doc/reference/networking/ethernet.rst @@ -43,7 +43,5 @@ API Reference ************* .. doxygengroup:: ethernet - :project: Zephyr .. doxygengroup:: ethernet_mii - :project: Zephyr diff --git a/doc/reference/networking/ethernet_mgmt.rst b/doc/reference/networking/ethernet_mgmt.rst index 6d89e595bdb..34cf3b19550 100644 --- a/doc/reference/networking/ethernet_mgmt.rst +++ b/doc/reference/networking/ethernet_mgmt.rst @@ -31,4 +31,3 @@ API Reference ************* .. doxygengroup:: ethernet_mgmt - :project: Zephyr diff --git a/doc/reference/networking/gptp.rst b/doc/reference/networking/gptp.rst index f8c27c141c8..ce3eba8ec0a 100644 --- a/doc/reference/networking/gptp.rst +++ b/doc/reference/networking/gptp.rst @@ -73,4 +73,3 @@ API Reference ************* .. doxygengroup:: gptp - :project: Zephyr diff --git a/doc/reference/networking/ieee802154.rst b/doc/reference/networking/ieee802154.rst index 54d1df2a8ff..ab838477e1f 100644 --- a/doc/reference/networking/ieee802154.rst +++ b/doc/reference/networking/ieee802154.rst @@ -29,10 +29,8 @@ IEEE 802.15.4 ============= .. doxygengroup:: ieee802154 - :project: Zephyr IEEE 802.15.4 Management ======================== .. doxygengroup:: ieee802154_mgmt - :project: Zephyr diff --git a/doc/reference/networking/ip_4_6.rst b/doc/reference/networking/ip_4_6.rst index df125b737ca..c6f66b1f4bd 100644 --- a/doc/reference/networking/ip_4_6.rst +++ b/doc/reference/networking/ip_4_6.rst @@ -16,4 +16,3 @@ API Reference ************* .. doxygengroup:: ip_4_6 - :project: Zephyr diff --git a/doc/reference/networking/lldp.rst b/doc/reference/networking/lldp.rst index a64d4cf4c62..6487f573a7e 100644 --- a/doc/reference/networking/lldp.rst +++ b/doc/reference/networking/lldp.rst @@ -21,4 +21,3 @@ API Reference ************* .. doxygengroup:: lldp - :project: Zephyr diff --git a/doc/reference/networking/lwm2m.rst b/doc/reference/networking/lwm2m.rst index 09ad70b11d5..e291c7b00e0 100644 --- a/doc/reference/networking/lwm2m.rst +++ b/doc/reference/networking/lwm2m.rst @@ -416,7 +416,6 @@ API Reference ************* .. doxygengroup:: lwm2m_api - :project: Zephyr .. _LwM2M: https://www.omaspecworks.org/what-is-oma-specworks/iot/lightweight-m2m-lwm2m/ diff --git a/doc/reference/networking/mqtt.rst b/doc/reference/networking/mqtt.rst index f32b4be871f..b1090c8d394 100644 --- a/doc/reference/networking/mqtt.rst +++ b/doc/reference/networking/mqtt.rst @@ -170,4 +170,3 @@ API Reference ************* .. doxygengroup:: mqtt_socket - :project: Zephyr diff --git a/doc/reference/networking/net_buf.rst b/doc/reference/networking/net_buf.rst index 668462ee6c3..00747fac97f 100644 --- a/doc/reference/networking/net_buf.rst +++ b/doc/reference/networking/net_buf.rst @@ -137,4 +137,3 @@ API Reference ************* .. doxygengroup:: net_buf - :project: Zephyr diff --git a/doc/reference/networking/net_config.rst b/doc/reference/networking/net_config.rst index e09144fe9c5..82e6aa45705 100644 --- a/doc/reference/networking/net_config.rst +++ b/doc/reference/networking/net_config.rst @@ -72,4 +72,3 @@ API Reference ************* .. doxygengroup:: net_config - :project: Zephyr diff --git a/doc/reference/networking/net_core.rst b/doc/reference/networking/net_core.rst index db71aaae2fd..f510d27801c 100644 --- a/doc/reference/networking/net_core.rst +++ b/doc/reference/networking/net_core.rst @@ -24,4 +24,3 @@ API Reference ************* .. doxygengroup:: net_core - :project: Zephyr diff --git a/doc/reference/networking/net_hostname.rst b/doc/reference/networking/net_hostname.rst index 2c667af8f83..adaa470573e 100644 --- a/doc/reference/networking/net_hostname.rst +++ b/doc/reference/networking/net_hostname.rst @@ -36,4 +36,3 @@ API Reference ************* .. doxygengroup:: net_hostname - :project: Zephyr diff --git a/doc/reference/networking/net_if.rst b/doc/reference/networking/net_if.rst index 7a754e1b6e1..4310c1116f3 100644 --- a/doc/reference/networking/net_if.rst +++ b/doc/reference/networking/net_if.rst @@ -59,4 +59,3 @@ API Reference ************* .. doxygengroup:: net_if - :project: Zephyr diff --git a/doc/reference/networking/net_l2.rst b/doc/reference/networking/net_l2.rst index d547e668a7a..05c4c2fd02b 100644 --- a/doc/reference/networking/net_l2.rst +++ b/doc/reference/networking/net_l2.rst @@ -154,4 +154,3 @@ API Reference ************* .. doxygengroup:: net_l2 - :project: Zephyr diff --git a/doc/reference/networking/net_linkaddr.rst b/doc/reference/networking/net_linkaddr.rst index 3ca676fc8a0..648b1c08b76 100644 --- a/doc/reference/networking/net_linkaddr.rst +++ b/doc/reference/networking/net_linkaddr.rst @@ -19,4 +19,3 @@ API Reference ************* .. doxygengroup:: net_linkaddr - :project: Zephyr diff --git a/doc/reference/networking/net_mgmt.rst b/doc/reference/networking/net_mgmt.rst index 84b1f50d25c..1911797a377 100644 --- a/doc/reference/networking/net_mgmt.rst +++ b/doc/reference/networking/net_mgmt.rst @@ -171,4 +171,3 @@ API Reference ************* .. doxygengroup:: net_mgmt - :project: Zephyr diff --git a/doc/reference/networking/net_offload.rst b/doc/reference/networking/net_offload.rst index bc69a8d8425..1c096d4e978 100644 --- a/doc/reference/networking/net_offload.rst +++ b/doc/reference/networking/net_offload.rst @@ -22,7 +22,6 @@ API Reference ************* .. doxygengroup:: net_offload - :project: Zephyr .. _net_socket_offloading: diff --git a/doc/reference/networking/net_pkt.rst b/doc/reference/networking/net_pkt.rst index 1bf0ab9d9d7..968204922d4 100644 --- a/doc/reference/networking/net_pkt.rst +++ b/doc/reference/networking/net_pkt.rst @@ -360,4 +360,3 @@ API Reference ************* .. doxygengroup:: net_pkt - :project: Zephyr diff --git a/doc/reference/networking/net_stats.rst b/doc/reference/networking/net_stats.rst index f2b44185359..2f390355bed 100644 --- a/doc/reference/networking/net_stats.rst +++ b/doc/reference/networking/net_stats.rst @@ -36,4 +36,3 @@ API Reference ************* .. doxygengroup:: net_stats - :project: Zephyr diff --git a/doc/reference/networking/net_timeout.rst b/doc/reference/networking/net_timeout.rst index 65719af8b56..6da8ca0d2fd 100644 --- a/doc/reference/networking/net_timeout.rst +++ b/doc/reference/networking/net_timeout.rst @@ -59,4 +59,3 @@ API Reference ************* .. doxygengroup:: net_timeout - :project: Zephyr diff --git a/doc/reference/networking/promiscuous.rst b/doc/reference/networking/promiscuous.rst index b1098acfc6b..c5e18f58fb0 100644 --- a/doc/reference/networking/promiscuous.rst +++ b/doc/reference/networking/promiscuous.rst @@ -77,4 +77,3 @@ API Reference ************* .. doxygengroup:: promiscuous - :project: Zephyr diff --git a/doc/reference/networking/ptp_time.rst b/doc/reference/networking/ptp_time.rst index ecfeb1cfb42..f19046da25b 100644 --- a/doc/reference/networking/ptp_time.rst +++ b/doc/reference/networking/ptp_time.rst @@ -20,4 +20,3 @@ API Reference ************* .. doxygengroup:: ptp_time - :project: Zephyr diff --git a/doc/reference/networking/sntp.rst b/doc/reference/networking/sntp.rst index f3723662d7e..016c5c2d1bc 100644 --- a/doc/reference/networking/sntp.rst +++ b/doc/reference/networking/sntp.rst @@ -20,4 +20,3 @@ API Reference ************* .. doxygengroup:: sntp - :project: Zephyr diff --git a/doc/reference/networking/sockets.rst b/doc/reference/networking/sockets.rst index 47920d3843b..298101211c1 100644 --- a/doc/reference/networking/sockets.rst +++ b/doc/reference/networking/sockets.rst @@ -155,10 +155,8 @@ BSD Sockets =========== .. doxygengroup:: bsd_sockets - :project: Zephyr TLS Credentials =============== .. doxygengroup:: tls_credentials - :project: Zephyr diff --git a/doc/reference/networking/trickle.rst b/doc/reference/networking/trickle.rst index ef0144686fa..8cd31834e10 100644 --- a/doc/reference/networking/trickle.rst +++ b/doc/reference/networking/trickle.rst @@ -22,4 +22,3 @@ API Reference ************* .. doxygengroup:: trickle - :project: Zephyr diff --git a/doc/reference/networking/vlan.rst b/doc/reference/networking/vlan.rst index 5cce838a88b..91d7d48706f 100644 --- a/doc/reference/networking/vlan.rst +++ b/doc/reference/networking/vlan.rst @@ -52,4 +52,3 @@ API Reference ************* .. doxygengroup:: vlan_api - :project: Zephyr diff --git a/doc/reference/networking/websocket.rst b/doc/reference/networking/websocket.rst index 4bc19603933..870b756a012 100644 --- a/doc/reference/networking/websocket.rst +++ b/doc/reference/networking/websocket.rst @@ -75,4 +75,3 @@ API Reference ************* .. doxygengroup:: websocket - :project: Zephyr diff --git a/doc/reference/peripherals/adc.rst b/doc/reference/peripherals/adc.rst index 93bf6c6fab2..cfdcfb2f1c9 100644 --- a/doc/reference/peripherals/adc.rst +++ b/doc/reference/peripherals/adc.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: adc_interface - :project: Zephyr diff --git a/doc/reference/peripherals/clock_control.rst b/doc/reference/peripherals/clock_control.rst index c9f3d6219cb..784b5b9b683 100644 --- a/doc/reference/peripherals/clock_control.rst +++ b/doc/reference/peripherals/clock_control.rst @@ -20,4 +20,3 @@ API Reference ************* .. doxygengroup:: clock_control_interface - :project: Zephyr diff --git a/doc/reference/peripherals/counter.rst b/doc/reference/peripherals/counter.rst index bb41fdcbe7d..45c252209fa 100644 --- a/doc/reference/peripherals/counter.rst +++ b/doc/reference/peripherals/counter.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: counter_interface - :project: Zephyr diff --git a/doc/reference/peripherals/dac.rst b/doc/reference/peripherals/dac.rst index f21d93c7f0a..448072a7e4c 100644 --- a/doc/reference/peripherals/dac.rst +++ b/doc/reference/peripherals/dac.rst @@ -19,4 +19,3 @@ API Reference ************* .. doxygengroup:: dac_interface - :project: Zephyr diff --git a/doc/reference/peripherals/dma.rst b/doc/reference/peripherals/dma.rst index 6e4261b3d6f..8072f9a689f 100644 --- a/doc/reference/peripherals/dma.rst +++ b/doc/reference/peripherals/dma.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: dma_interface - :project: Zephyr diff --git a/doc/reference/peripherals/ec_host_cmd_periph.rst b/doc/reference/peripherals/ec_host_cmd_periph.rst index aa8d33c4895..ee5ef462d14 100644 --- a/doc/reference/peripherals/ec_host_cmd_periph.rst +++ b/doc/reference/peripherals/ec_host_cmd_periph.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: ec_host_cmd_periph_interface - :project: Zephyr diff --git a/doc/reference/peripherals/eeprom.rst b/doc/reference/peripherals/eeprom.rst index 1121813b945..12897e3ce49 100644 --- a/doc/reference/peripherals/eeprom.rst +++ b/doc/reference/peripherals/eeprom.rst @@ -23,4 +23,3 @@ API Reference ************* .. doxygengroup:: eeprom_interface - :project: Zephyr diff --git a/doc/reference/peripherals/entropy.rst b/doc/reference/peripherals/entropy.rst index 89cacb91127..1a00600834c 100644 --- a/doc/reference/peripherals/entropy.rst +++ b/doc/reference/peripherals/entropy.rst @@ -15,4 +15,3 @@ API Reference ************* .. doxygengroup:: entropy_interface - :project: Zephyr diff --git a/doc/reference/peripherals/flash.rst b/doc/reference/peripherals/flash.rst index 30a30c4e2a5..13f306f3127 100644 --- a/doc/reference/peripherals/flash.rst +++ b/doc/reference/peripherals/flash.rst @@ -22,9 +22,7 @@ API for retrieving the layout of pages). User API Reference ****************** .. doxygengroup:: flash_interface - :project: Zephyr Implementation interface API Reference ************************************** .. doxygengroup:: flash_internal_interface - :project: Zephyr diff --git a/doc/reference/peripherals/gna.rst b/doc/reference/peripherals/gna.rst index fcade26c8bf..b019cee04d3 100644 --- a/doc/reference/peripherals/gna.rst +++ b/doc/reference/peripherals/gna.rst @@ -20,4 +20,3 @@ API Reference ************* .. doxygengroup:: gna_interface - :project: Zephyr diff --git a/doc/reference/peripherals/gpio.rst b/doc/reference/peripherals/gpio.rst index 40896dee2e3..1033b86f704 100644 --- a/doc/reference/peripherals/gpio.rst +++ b/doc/reference/peripherals/gpio.rst @@ -18,4 +18,3 @@ API Reference ************* .. doxygengroup:: gpio_interface - :project: Zephyr diff --git a/doc/reference/peripherals/hwinfo.rst b/doc/reference/peripherals/hwinfo.rst index d7c2c8568b8..dac0f4b0849 100644 --- a/doc/reference/peripherals/hwinfo.rst +++ b/doc/reference/peripherals/hwinfo.rst @@ -20,4 +20,3 @@ API Reference ************* .. doxygengroup:: hwinfo_interface - :project: Zephyr diff --git a/doc/reference/peripherals/i2c.rst b/doc/reference/peripherals/i2c.rst index e95a252a8f8..bc3dd11c061 100644 --- a/doc/reference/peripherals/i2c.rst +++ b/doc/reference/peripherals/i2c.rst @@ -63,7 +63,6 @@ API Reference ************* .. doxygengroup:: i2c_interface - :project: Zephyr .. _i2c-specification: https://www.nxp.com/docs/en/user-guide/UM10204.pdf diff --git a/doc/reference/peripherals/i2c_eeprom_slave.rst b/doc/reference/peripherals/i2c_eeprom_slave.rst index c753938a14d..af50c906d66 100644 --- a/doc/reference/peripherals/i2c_eeprom_slave.rst +++ b/doc/reference/peripherals/i2c_eeprom_slave.rst @@ -10,4 +10,3 @@ API Reference ************** .. doxygengroup:: i2c_eeprom_slave_api - :project: Zephyr diff --git a/doc/reference/peripherals/ipm.rst b/doc/reference/peripherals/ipm.rst index 7c43f754737..9b6a6d9c4a4 100644 --- a/doc/reference/peripherals/ipm.rst +++ b/doc/reference/peripherals/ipm.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: ipm_interface - :project: Zephyr diff --git a/doc/reference/peripherals/kscan.rst b/doc/reference/peripherals/kscan.rst index f3a0b6293f2..2622f0eeb83 100644 --- a/doc/reference/peripherals/kscan.rst +++ b/doc/reference/peripherals/kscan.rst @@ -29,4 +29,3 @@ API Reference ************* .. doxygengroup:: kscan_interface - :project: Zephyr diff --git a/doc/reference/peripherals/led.rst b/doc/reference/peripherals/led.rst index 334c8e442f8..8b9d9d07061 100644 --- a/doc/reference/peripherals/led.rst +++ b/doc/reference/peripherals/led.rst @@ -24,10 +24,8 @@ LED === .. doxygengroup:: led_interface - :project: Zephyr LED Strip ========= .. doxygengroup:: led_strip_interface - :project: Zephyr diff --git a/doc/reference/peripherals/peci.rst b/doc/reference/peripherals/peci.rst index 522362265d7..222f897892f 100644 --- a/doc/reference/peripherals/peci.rst +++ b/doc/reference/peripherals/peci.rst @@ -25,4 +25,3 @@ API Reference ************* .. doxygengroup:: peci_interface - :project: Zephyr diff --git a/doc/reference/peripherals/pinmux.rst b/doc/reference/peripherals/pinmux.rst index 91ca3e18e1f..1aef9ae4328 100644 --- a/doc/reference/peripherals/pinmux.rst +++ b/doc/reference/peripherals/pinmux.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: pinmux_interface - :project: Zephyr diff --git a/doc/reference/peripherals/ps2.rst b/doc/reference/peripherals/ps2.rst index 8dc4df70469..6f65bb1e008 100644 --- a/doc/reference/peripherals/ps2.rst +++ b/doc/reference/peripherals/ps2.rst @@ -25,4 +25,3 @@ API Reference ************* .. doxygengroup:: ps2_interface - :project: Zephyr diff --git a/doc/reference/peripherals/pwm.rst b/doc/reference/peripherals/pwm.rst index 005ded68ce7..06e7814b56f 100644 --- a/doc/reference/peripherals/pwm.rst +++ b/doc/reference/peripherals/pwm.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: pwm_interface - :project: Zephyr diff --git a/doc/reference/peripherals/regulators.rst b/doc/reference/peripherals/regulators.rst index 58ad4951e8f..be48c74d822 100644 --- a/doc/reference/peripherals/regulators.rst +++ b/doc/reference/peripherals/regulators.rst @@ -41,4 +41,3 @@ API Reference ************** .. doxygengroup:: regulator_interface - :project: Zephyr diff --git a/doc/reference/peripherals/rtc.rst b/doc/reference/peripherals/rtc.rst index 173b7b7fd20..68b7d16c2da 100644 --- a/doc/reference/peripherals/rtc.rst +++ b/doc/reference/peripherals/rtc.rst @@ -14,4 +14,3 @@ API Reference ************* .. doxygengroup:: rtc_interface - :project: Zephyr diff --git a/doc/reference/peripherals/sensor.rst b/doc/reference/peripherals/sensor.rst index 46b5c803ada..a1192e27aee 100644 --- a/doc/reference/peripherals/sensor.rst +++ b/doc/reference/peripherals/sensor.rst @@ -121,4 +121,3 @@ API Reference ************** .. doxygengroup:: sensor_interface - :project: Zephyr diff --git a/doc/reference/peripherals/spi.rst b/doc/reference/peripherals/spi.rst index 8cadfa62c36..1355eaaef60 100644 --- a/doc/reference/peripherals/spi.rst +++ b/doc/reference/peripherals/spi.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: spi_interface - :project: Zephyr diff --git a/doc/reference/peripherals/uart.rst b/doc/reference/peripherals/uart.rst index 97203019731..f1dc1a99a82 100644 --- a/doc/reference/peripherals/uart.rst +++ b/doc/reference/peripherals/uart.rst @@ -10,4 +10,3 @@ API Reference ************* .. doxygengroup:: uart_interface - :project: Zephyr diff --git a/doc/reference/peripherals/video.rst b/doc/reference/peripherals/video.rst index 1d8e8860394..e644e960081 100644 --- a/doc/reference/peripherals/video.rst +++ b/doc/reference/peripherals/video.rst @@ -54,7 +54,5 @@ API Reference ************* .. doxygengroup:: video_interface - :project: Zephyr .. doxygengroup:: video_controls - :project: Zephyr diff --git a/doc/reference/peripherals/watchdog.rst b/doc/reference/peripherals/watchdog.rst index df42d535a09..084fbda6be8 100644 --- a/doc/reference/peripherals/watchdog.rst +++ b/doc/reference/peripherals/watchdog.rst @@ -11,4 +11,3 @@ API Reference ************* .. doxygengroup:: watchdog_interface - :project: Zephyr diff --git a/doc/reference/power_management/index.rst b/doc/reference/power_management/index.rst index 4befa772be7..507ceb5df9b 100644 --- a/doc/reference/power_management/index.rst +++ b/doc/reference/power_management/index.rst @@ -73,25 +73,18 @@ general power states with higher indexes will offer greater power savings and have higher wake latencies. Following is a thorough list of available states: .. doxygenenumvalue:: PM_STATE_ACTIVE - :project: Zephyr .. doxygenenumvalue:: PM_STATE_RUNTIME_IDLE - :project: Zephyr .. doxygenenumvalue:: PM_STATE_SUSPEND_TO_IDLE - :project: Zephyr .. doxygenenumvalue:: PM_STATE_STANDBY - :project: Zephyr .. doxygenenumvalue:: PM_STATE_SUSPEND_TO_RAM - :project: Zephyr .. doxygenenumvalue:: PM_STATE_SUSPEND_TO_DISK - :project: Zephyr .. doxygenenumvalue:: PM_STATE_SOFT_OFF - :project: Zephyr .. _pm_constraints: @@ -106,13 +99,10 @@ lose context. Constraints can be set, released and checked using the follow APIs: .. doxygenfunction:: pm_constraint_set - :project: Zephyr .. doxygenfunction:: pm_constraint_release - :project: Zephyr .. doxygenfunction:: pm_constraint_get - :project: Zephyr Power Management Policies ========================= @@ -491,16 +481,13 @@ Power Management Hook Interface =============================== .. doxygengroup:: power_management_hook_interface - :project: Zephyr System Power Management APIs ============================ .. doxygengroup:: system_power_management_api - :project: Zephyr Device Power Management APIs ============================ .. doxygengroup:: device_power_management_api - :project: Zephyr diff --git a/doc/reference/random/index.rst b/doc/reference/random/index.rst index b0536ea783f..48526a98e8b 100644 --- a/doc/reference/random/index.rst +++ b/doc/reference/random/index.rst @@ -90,4 +90,3 @@ API Reference ************* .. doxygengroup:: random_api - :project: Zephyr diff --git a/doc/reference/resource_management/index.rst b/doc/reference/resource_management/index.rst index 533ee011797..3bdf3e19416 100644 --- a/doc/reference/resource_management/index.rst +++ b/doc/reference/resource_management/index.rst @@ -85,4 +85,3 @@ state. (primarily no support for the monitor API). .. doxygengroup:: resource_mgmt_onoff_apis - :project: Zephyr diff --git a/doc/reference/settings/index.rst b/doc/reference/settings/index.rst index 6871bf3c854..5a84675bc45 100644 --- a/doc/reference/settings/index.rst +++ b/doc/reference/settings/index.rst @@ -305,19 +305,15 @@ The Settings subsystem APIs are provided by ``settings.h``: API for general settings usage ============================== .. doxygengroup:: settings - :project: Zephyr API for key-name processing =========================== .. doxygengroup:: settings_name_proc - :project: Zephyr API for runtime settings manipulation ===================================== .. doxygengroup:: settings_rt - :project: Zephyr API of backend interface ======================== .. doxygengroup:: settings_backend - :project: Zephyr diff --git a/doc/reference/shell/index.rst b/doc/reference/shell/index.rst index d981adc3358..15e46183ff7 100644 --- a/doc/reference/shell/index.rst +++ b/doc/reference/shell/index.rst @@ -642,4 +642,3 @@ API Reference ************* .. doxygengroup:: shell_api - :project: Zephyr diff --git a/doc/reference/storage/disk/access.rst b/doc/reference/storage/disk/access.rst index abf07fc56ab..86171de6b0e 100644 --- a/doc/reference/storage/disk/access.rst +++ b/doc/reference/storage/disk/access.rst @@ -63,7 +63,6 @@ API Reference ************* .. doxygengroup:: disk_access_interface - :project: Zephyr Disk Driver Configuration Options ********************************* @@ -76,4 +75,3 @@ Disk Driver Interface ********************* .. doxygengroup:: disk_driver_interface - :project: Zephyr diff --git a/doc/reference/storage/fcb/fcb.rst b/doc/reference/storage/fcb/fcb.rst index ab31690a0ab..2092eeaefba 100644 --- a/doc/reference/storage/fcb/fcb.rst +++ b/doc/reference/storage/fcb/fcb.rst @@ -72,9 +72,7 @@ The FCB subsystem APIs are provided by ``fcb.h``: Data structures =============== .. doxygengroup:: fcb_data_structures - :project: Zephyr API functions ============= .. doxygengroup:: fcb_api - :project: Zephyr diff --git a/doc/reference/storage/flash_map/flash_map.rst b/doc/reference/storage/flash_map/flash_map.rst index 2dab4f6598c..69f56578c0b 100644 --- a/doc/reference/storage/flash_map/flash_map.rst +++ b/doc/reference/storage/flash_map/flash_map.rst @@ -95,5 +95,4 @@ API Reference ************* .. doxygengroup:: flash_area_api - :project: Zephyr :members: diff --git a/doc/reference/storage/nvs/nvs.rst b/doc/reference/storage/nvs/nvs.rst index 6180df5dc79..c1020db73e9 100644 --- a/doc/reference/storage/nvs/nvs.rst +++ b/doc/reference/storage/nvs/nvs.rst @@ -126,10 +126,8 @@ API Reference The NVS subsystem APIs are provided by ``nvs.h``: .. doxygengroup:: nvs_data_structures - :project: Zephyr .. doxygengroup:: nvs_high_level_api - :project: Zephyr .. comment not documenting diff --git a/doc/reference/storage/stream/stream_flash.rst b/doc/reference/storage/stream/stream_flash.rst index 61623881f96..d801f1e4c70 100644 --- a/doc/reference/storage/stream/stream_flash.rst +++ b/doc/reference/storage/stream/stream_flash.rst @@ -32,4 +32,3 @@ API Reference ************* .. doxygengroup:: stream_flash - :project: Zephyr diff --git a/doc/reference/task_wdt/index.rst b/doc/reference/task_wdt/index.rst index ddd4593e33c..84b98d9ba26 100644 --- a/doc/reference/task_wdt/index.rst +++ b/doc/reference/task_wdt/index.rst @@ -52,4 +52,3 @@ API Reference ************* .. doxygengroup:: task_wdt_api - :project: Zephyr diff --git a/doc/reference/timing_functions/index.rst b/doc/reference/timing_functions/index.rst index a0e7313affd..8ffdcca3749 100644 --- a/doc/reference/timing_functions/index.rst +++ b/doc/reference/timing_functions/index.rst @@ -78,4 +78,3 @@ API documentation ***************** .. doxygengroup:: timing_api - :project: Zephyr diff --git a/doc/reference/usb/index.rst b/doc/reference/usb/index.rst index 0f15dc168d1..64f81553e9b 100644 --- a/doc/reference/usb/index.rst +++ b/doc/reference/usb/index.rst @@ -52,7 +52,6 @@ USB Device Controller API ========================= .. doxygengroup:: _usb_device_controller_api - :project: Zephyr USB device core layer ********************* @@ -95,7 +94,6 @@ High level API generic usb_transfer_ep_callback. .. doxygengroup:: _usb_device_core_api - :project: Zephyr USB device class drivers ************************ @@ -235,10 +233,8 @@ Example of a HID Report Descriptor: .. doxygengroup:: usb_hid_items - :project: Zephyr .. doxygengroup:: usb_hid_types - :project: Zephyr HID Mouse and Keyboard report descriptors ========================================= @@ -247,7 +243,6 @@ 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 - :project: Zephyr HID Class Device API ******************** @@ -255,4 +250,3 @@ HID Class Device API USB HID devices like mouse, keyboard, or any other specific device use this API. .. doxygengroup:: usb_hid_device_api - :project: Zephyr diff --git a/doc/reference/usermode/kernelobjects.rst b/doc/reference/usermode/kernelobjects.rst index eecdeaeb361..f7c47a14939 100644 --- a/doc/reference/usermode/kernelobjects.rst +++ b/doc/reference/usermode/kernelobjects.rst @@ -270,4 +270,3 @@ API Reference ************* .. doxygengroup:: usermode_apis - :project: Zephyr diff --git a/doc/reference/usermode/memory_domain.rst b/doc/reference/usermode/memory_domain.rst index e2f5b35c2cd..cc7bca3d233 100644 --- a/doc/reference/usermode/memory_domain.rst +++ b/doc/reference/usermode/memory_domain.rst @@ -441,4 +441,3 @@ API Reference The following memory domain APIs are provided by :zephyr_file:`include/kernel.h`: .. doxygengroup:: mem_domain_apis - :project: Zephyr diff --git a/doc/reference/util/index.rst b/doc/reference/util/index.rst index 98bd47a553c..1679c32ab60 100644 --- a/doc/reference/util/index.rst +++ b/doc/reference/util/index.rst @@ -7,4 +7,3 @@ This page contains reference documentation for ````, which provides miscellaneous utility functions and macros. .. doxygengroup:: sys-util - :project: Zephyr diff --git a/doc/reference/virtualization/ivshmem.rst b/doc/reference/virtualization/ivshmem.rst index 9cb6314bc25..1c81d949075 100644 --- a/doc/reference/virtualization/ivshmem.rst +++ b/doc/reference/virtualization/ivshmem.rst @@ -42,4 +42,3 @@ API Reference ************* .. doxygengroup:: ivshmem - :project: Zephyr diff --git a/doc/zephyr.doxyfile.in b/doc/zephyr.doxyfile.in index c27e278645f..ab13db51c2d 100644 --- a/doc/zephyr.doxyfile.in +++ b/doc/zephyr.doxyfile.in @@ -51,7 +51,7 @@ PROJECT_BRIEF = "A Scalable Open Source RTOS for IoT Embedded Devices" # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = "images/Zephyr-Kite-small.png" +PROJECT_LOGO = @ZEPHYR_BASE@/doc/images/Zephyr-Kite-small.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -202,7 +202,7 @@ INHERIT_DOCS = YES # of the file/class/namespace that contains it. # The default value is: NO. -SEPARATE_MEMBER_PAGES = YES +SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. @@ -754,7 +754,7 @@ WARN_LOGFILE = # This MUST be kept in sync with DOXY_SOURCES in doc/CMakeLists.txt # for incremental (and faster) builds to work correctly. -INPUT = custom-doxygen/mainpage.md \ +INPUT = @ZEPHYR_BASE@/doc/custom-doxygen/mainpage.md \ @ZEPHYR_BASE@/kernel/include/kernel_arch_interface.h \ @ZEPHYR_BASE@/include/ \ @ZEPHYR_BASE@/lib/libc/minimal/include/ \ @@ -1072,7 +1072,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = custom-doxygen/header.html +HTML_HEADER = @ZEPHYR_BASE@/doc/custom-doxygen/header.html # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1107,7 +1107,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = custom-doxygen/customdoxygen.css +HTML_EXTRA_STYLESHEET = @ZEPHYR_BASE@/doc/custom-doxygen/customdoxygen.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note diff --git a/drivers/console/rtt_console.c b/drivers/console/rtt_console.c index 281156c48fc..867209749b0 100644 --- a/drivers/console/rtt_console.c +++ b/drivers/console/rtt_console.c @@ -25,7 +25,7 @@ static bool host_present; */ static void wait(void) { - if (k_is_in_isr()) { + if (!IS_ENABLED(CONFIG_MULTITHREADING) || k_is_in_isr()) { if (IS_ENABLED(CONFIG_RTT_TX_RETRY_IN_INTERRUPT)) { k_busy_wait(1000*CONFIG_RTT_TX_RETRY_DELAY_MS); } diff --git a/drivers/debug/Kconfig.rtt b/drivers/debug/Kconfig.rtt index 6a506d30f72..9cab870b8c0 100644 --- a/drivers/debug/Kconfig.rtt +++ b/drivers/debug/Kconfig.rtt @@ -16,6 +16,11 @@ config USE_SEGGER_RTT if USE_SEGGER_RTT +config SEGGER_RTT_CUSTOM_LOCKING + bool "Enable custom locking" + help + Enable custom locking using a mutex. + config SEGGER_RTT_MAX_NUM_UP_BUFFERS int "Maximum number of up-buffers" default 3 diff --git a/drivers/ethernet/eth_enc424j600.c b/drivers/ethernet/eth_enc424j600.c index 417b66ae07d..0b4177a8820 100644 --- a/drivers/ethernet/eth_enc424j600.c +++ b/drivers/ethernet/eth_enc424j600.c @@ -484,7 +484,13 @@ static void enc424j600_rx_thread(struct enc424j600_runtime *context) } } else { LOG_ERR("Unknown Interrupt, EIR: 0x%04x", eir); - continue; + /* + * Terminate interrupt handling thread + * only when debugging. + */ + if (CONFIG_ETHERNET_LOG_LEVEL == LOG_LEVEL_DBG) { + k_oops(); + } } enc424j600_set_sfru(context->dev, ENC424J600_SFR3_EIEL, @@ -684,6 +690,15 @@ static int enc424j600_init(const struct device *dev) return -EIO; } + /* Disable INTIE and setup interrupt logic */ + enc424j600_write_sfru(dev, ENC424J600_SFR3_EIEL, + ENC424J600_EIE_PKTIE | ENC424J600_EIE_LINKIE); + + if (CONFIG_ETHERNET_LOG_LEVEL == LOG_LEVEL_DBG) { + enc424j600_read_sfru(dev, ENC424J600_SFR3_EIEL, &tmp); + LOG_DBG("EIE: 0x%04x", tmp); + } + /* Configure TX and RX buffer */ enc424j600_write_sfru(dev, ENC424J600_SFR0_ETXSTL, ENC424J600_TXSTART); @@ -715,15 +730,6 @@ static int enc424j600_init(const struct device *dev) enc424j600_init_filters(dev); enc424j600_init_phy(dev); - /* Setup interrupt logic */ - enc424j600_set_sfru(dev, ENC424J600_SFR3_EIEL, - ENC424J600_EIE_PKTIE | ENC424J600_EIE_LINKIE); - - if (CONFIG_ETHERNET_LOG_LEVEL == LOG_LEVEL_DBG) { - enc424j600_read_sfru(dev, ENC424J600_SFR3_EIEL, &tmp); - LOG_DBG("EIE: 0x%04x", tmp); - } - /* Enable Reception */ enc424j600_set_sfru(dev, ENC424J600_SFRX_ECON1L, ENC424J600_ECON1_RXEN); if (CONFIG_ETHERNET_LOG_LEVEL == LOG_LEVEL_DBG) { diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index f15a7ccdf56..5b29f064756 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -390,7 +390,6 @@ static int anomaly_122_init(const struct device *dev) static void anomaly_122_uninit(const struct device *dev) { - struct qspi_nor_data *dev_data = get_dev_data(dev); bool last = true; if (!nrf52_errata_122()) { @@ -400,6 +399,8 @@ static void anomaly_122_uninit(const struct device *dev) qspi_lock(dev); #ifdef CONFIG_MULTITHREADING + struct qspi_nor_data *dev_data = get_dev_data(dev); + /* The last thread to finish using the driver uninit the QSPI */ (void) k_sem_take(&dev_data->count, K_NO_WAIT); last = (k_sem_count_get(&dev_data->count) == 0); @@ -407,7 +408,11 @@ static void anomaly_122_uninit(const struct device *dev) if (last) { while (nrfx_qspi_mem_busy_check() != NRFX_SUCCESS) { - k_msleep(50); + if (IS_ENABLED(CONFIG_MULTITHREADING)) { + k_msleep(50); + } else { + k_busy_wait(50000); + } } nrf_gpio_cfg_output(QSPI_PROP_AT(csn_pins, 0)); diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index f6833430cb6..81e6b3aab39 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,6 +37,13 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_ARM_NONSECURE_FIRMWARE && CONFIG_SPM +#include +#if USE_PARTITION_MANAGER +#include +#endif /* USE_PARTITION_MANAGER */ +#endif /* CONFIG_ARM_NONSECURE_FIRMWARE && CONFIG_SPM */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -146,6 +153,13 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } +#if CONFIG_ARM_NONSECURE_FIRMWARE && CONFIG_SPM && USE_PARTITION_MANAGER \ + && CONFIG_SPM_SECURE_SERVICES + if (addr < PM_APP_ADDRESS) { + return spm_request_read(data, addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig index 611af2b01b9..ab363bbaf78 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 230aa1bc2e9..6f3f15f694f 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -39,6 +39,11 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include +#if defined(CONFIG_SOC_NRF5340_CPUAPP) && \ + defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#include +#endif + #include "ieee802154_nrf5.h" #include "nrf_802154.h" @@ -60,13 +65,21 @@ static struct nrf5_802154_data nrf5_data; #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 */ @@ -107,7 +120,17 @@ static void nrf5_get_eui64(uint8_t *mac) #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 + int ret = -EPERM; +#if defined(CONFIG_SPM) + ret = spm_request_read(&factoryAddress, + (uint32_t)&EUI64_ADDR[EUI64_ADDR_HIGH], + sizeof(factoryAddress)); +#endif + if (ret != 0) { + LOG_ERR("Unable to read EUI64 from the secure zone."); + 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; @@ -141,7 +164,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; @@ -847,9 +871,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 e0c05ba33d8..c30ea617959 100644 --- a/drivers/led/led_pwm.c +++ b/drivers/led/led_pwm.c @@ -176,17 +176,17 @@ static int led_pwm_pm_set_state(const struct device *dev, uint32_t new_state) } static int led_pwm_pm_control(const struct device *dev, uint32_t ctrl_command, - void *context, pm_device_cb cb, void *arg) + uint32_t *state, pm_device_cb cb, void *arg) { int err; switch (ctrl_command) { case PM_DEVICE_STATE_GET: - err = led_pwm_pm_get_state(dev, context); + err = led_pwm_pm_get_state(dev, state); break; case PM_DEVICE_STATE_SET: - err = led_pwm_pm_set_state(dev, *((uint32_t *)context)); + err = led_pwm_pm_set_state(dev, *state); break; default: @@ -195,7 +195,7 @@ static int led_pwm_pm_control(const struct device *dev, uint32_t ctrl_command, } if (cb) { - cb(dev, err, context, arg); + cb(dev, err, state, arg); } return err; diff --git a/drivers/serial/Kconfig.rtt b/drivers/serial/Kconfig.rtt index 803f1740dcf..2438ef05e83 100644 --- a/drivers/serial/Kconfig.rtt +++ b/drivers/serial/Kconfig.rtt @@ -6,6 +6,7 @@ menuconfig UART_RTT bool "Enable UART RTT driver" depends on USE_SEGGER_RTT + select SEGGER_RTT_CUSTOM_LOCKING help This option enables access RTT channel as UART device. diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 8b7442dfa68..93501422f4d 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -34,14 +34,14 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, LOG_LEVEL_ERR); #endif -#if (defined(CONFIG_UART_0_NRF_UARTE) && \ - defined(CONFIG_UART_0_INTERRUPT_DRIVEN)) || \ - (defined(CONFIG_UART_1_NRF_UARTE) && \ - defined(CONFIG_UART_1_INTERRUPT_DRIVEN)) || \ - (defined(CONFIG_UART_2_NRF_UARTE) && \ - defined(CONFIG_UART_2_INTERRUPT_DRIVEN)) || \ - (defined(CONFIG_UART_3_NRF_UARTE) && \ - defined(CONFIG_UART_3_INTERRUPT_DRIVEN)) +#if (defined(CONFIG_UART_0_NRF_UARTE) && \ + defined(CONFIG_UART_0_INTERRUPT_DRIVEN)) || \ + (defined(CONFIG_UART_1_NRF_UARTE) && \ + defined(CONFIG_UART_1_INTERRUPT_DRIVEN)) || \ + (defined(CONFIG_UART_2_NRF_UARTE) && \ + defined(CONFIG_UART_2_INTERRUPT_DRIVEN)) || \ + (defined(CONFIG_UART_3_NRF_UARTE) && \ + defined(CONFIG_UART_3_INTERRUPT_DRIVEN)) #define UARTE_INTERRUPT_DRIVEN 1 #endif @@ -241,7 +241,7 @@ static void uarte_nrfx_isr_int(void *arg) #ifdef UARTE_INTERRUPT_DRIVEN struct uarte_nrfx_data *data = get_dev_data(dev); - if (!data->int_driven) + if (!data->int_driven || data->int_driven->fifo_fill_lock == 0) #endif { nrf_uarte_int_disable(uarte, @@ -514,16 +514,19 @@ static void uarte_enable(const struct device *dev, uint32_t mask) { #ifdef CONFIG_UART_ASYNC_API struct uarte_nrfx_data *data = get_dev_data(dev); - bool disabled = data->async->low_power_mask == 0; - data->async->low_power_mask |= mask; - if (hw_rx_counting_enabled(data) && disabled) { - const nrfx_timer_t *timer = &get_dev_config(dev)->timer; + if (data->async) { + bool disabled = data->async->low_power_mask == 0; + + data->async->low_power_mask |= mask; + if (hw_rx_counting_enabled(data) && disabled) { + const nrfx_timer_t *timer = &get_dev_config(dev)->timer; - nrfx_timer_enable(timer); + nrfx_timer_enable(timer); - for (int i = 0; i < data->async->rx_flush_cnt; i++) { - nrfx_timer_increment(timer); + for (int i = 0; i < data->async->rx_flush_cnt; i++) { + nrfx_timer_increment(timer); + } } } #endif @@ -546,6 +549,24 @@ static void tx_start(const struct device *dev, const uint8_t *buf, size_t len) nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTTX); } +#if defined(CONFIG_UART_ASYNC_API) || defined(CONFIG_PM_DEVICE) +static void uart_disable(const struct device *dev) +{ +#ifdef CONFIG_UART_ASYNC_API + struct uarte_nrfx_data *data = get_dev_data(dev); + + if (data->async && hw_rx_counting_enabled(data)) { + nrfx_timer_disable(&get_dev_config(dev)->timer); + /* Timer/counter value is reset when disabled. */ + data->async->rx_total_byte_cnt = 0; + data->async->rx_total_user_byte_cnt = 0; + } +#endif + + nrf_uarte_disable(get_uarte_instance(dev)); +} +#endif + #ifdef CONFIG_UART_ASYNC_API static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -678,10 +699,9 @@ static int uarte_nrfx_tx(const struct device *dev, const uint8_t *buf, if (data->async->tx_size) { irq_unlock(key); return -EBUSY; - } else { - data->async->tx_size = len; } + data->async->tx_size = len; nrf_uarte_int_enable(uarte, NRF_UARTE_INT_TXSTOPPED_MASK); if (!is_tx_ready(dev)) { @@ -835,7 +855,7 @@ static int uarte_nrfx_rx_buf_rsp(const struct device *dev, uint8_t *buf, NRF_UARTE_Type *uarte = get_uarte_instance(dev); int key = irq_lock(); - if ((data->async->rx_buf == NULL)) { + if (data->async->rx_buf == NULL) { err = -EACCES; } else if (data->async->rx_next_buf == NULL) { data->async->rx_next_buf = buf; @@ -858,6 +878,10 @@ static int uarte_nrfx_callback_set(const struct device *dev, { struct uarte_nrfx_data *data = get_dev_data(dev); + if (!data->async) { + return -ENOTSUP; + } + data->async->user_callback = callback; data->async->user_data = user_data; @@ -935,6 +959,17 @@ static void rx_timeout(struct k_timer *timer) int32_t len = data->async->rx_total_byte_cnt - data->async->rx_total_user_byte_cnt; + if (!hw_rx_counting_enabled(data) && + (len < 0)) { + /* Prevent too low value of rx_cnt.cnt which may occur due to + * latencies in handling of the RXRDY interrupt. + * At this point, the number of received bytes is at least + * equal to what was reported to the user. + */ + data->async->rx_cnt.cnt = data->async->rx_total_user_byte_cnt; + len = 0; + } + /* Check for current buffer being full. * if the UART receives characters before the the ENDRX is handled * and the 'next' buffer is set up, then the SHORT between ENDRX and @@ -1043,15 +1078,6 @@ static void endrx_isr(const struct device *dev) data->async->rx_total_user_byte_cnt += rx_len; - if (!hw_rx_counting_enabled(data)) { - /* Prevent too low value of rx_cnt.cnt which may occur due to - * latencies in handling of the RXRDY interrupt. Because whole - * buffer was filled we can be sure that rx_total_user_byte_cnt - * is current total number of received bytes. - */ - data->async->rx_cnt.cnt = data->async->rx_total_user_byte_cnt; - } - /* Only send the RX_RDY event if there is something to send */ if (rx_len > 0) { notify_uart_rx_rdy(dev, rx_len); @@ -1168,20 +1194,6 @@ static uint8_t rx_flush(const struct device *dev, uint8_t *buf, uint32_t len) return 0; } -static void async_uart_disable(const struct device *dev) -{ - struct uarte_nrfx_data *data = get_dev_data(dev); - - if (hw_rx_counting_enabled(data)) { - nrfx_timer_disable(&get_dev_config(dev)->timer); - /* Timer/counter value is reset when disabled. */ - data->async->rx_total_byte_cnt = 0; - data->async->rx_total_user_byte_cnt = 0; - } - - nrf_uarte_disable(get_uarte_instance(dev)); -} - static void async_uart_release(const struct device *dev, uint32_t dir_mask) { struct uarte_nrfx_data *data = get_dev_data(dev); @@ -1195,7 +1207,7 @@ static void async_uart_release(const struct device *dev, uint32_t dir_mask) sizeof(data->async->rx_flush_buffer)); } - async_uart_disable(dev); + uart_disable(dev); } irq_unlock(key); @@ -1376,11 +1388,6 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c) bool isr_mode = k_is_in_isr() || k_is_pre_kernel(); int key; -#ifdef CONFIG_PM_DEVICE - if (data->pm_state != PM_DEVICE_STATE_ACTIVE) { - return; - } -#endif if (isr_mode) { while (1) { key = irq_lock(); @@ -1405,8 +1412,13 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c) /* At this point we should have irq locked and any previous transfer * completed. Transfer can be started, no need to wait for completion. */ - data->char_out = c; - tx_start(dev, &data->char_out, 1); +#if CONFIG_PM_DEVICE + if (data->pm_state == PM_DEVICE_STATE_ACTIVE) +#endif + { + data->char_out = c; + tx_start(dev, &data->char_out, 1); + } irq_unlock(key); } @@ -1769,6 +1781,41 @@ static void uarte_nrfx_pins_enable(const struct device *dev, bool enable) } } +/** @brief Pend until TX is stopped. + * + * There are 2 configurations that must be handled: + * - ENDTX->TXSTOPPED PPI enabled - just pend until TXSTOPPED event is set + * - disable ENDTX interrupt and manually trigger STOPTX, pend for TXSTOPPED + */ +static void wait_for_tx_stopped(const struct device *dev) +{ + bool ppi_endtx = get_dev_config(dev)->flags & UARTE_CFG_FLAG_PPI_ENDTX; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + bool res; + + if (!ppi_endtx) { + /* We assume here that it can be called from any context, + * including the one that uarte interrupt will not preempt. + * Disable endtx interrupt to ensure that it will not be triggered + * (if in lower priority context) and stop TX if necessary. + */ + nrf_uarte_int_disable(uarte, NRF_UARTE_INT_ENDTX_MASK); + NRFX_WAIT_FOR(is_tx_ready(dev), 1000, 1, res); + if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_TXSTOPPED)) { + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDTX); + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPTX); + } + } + + NRFX_WAIT_FOR(nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_TXSTOPPED), + 1000, 1, res); + + if (!ppi_endtx) { + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_ENDTX_MASK); + } +} + + static void uarte_nrfx_set_power_state(const struct device *dev, uint32_t new_state) { @@ -1789,8 +1836,7 @@ static void uarte_nrfx_set_power_state(const struct device *dev, return; } #endif - if (nrf_uarte_rx_pin_get(uarte) != - NRF_UARTE_PSEL_DISCONNECTED) { + if (nrf_uarte_rx_pin_get(uarte) != NRF_UARTE_PSEL_DISCONNECTED) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); @@ -1821,19 +1867,12 @@ static void uarte_nrfx_set_power_state(const struct device *dev, */ #ifdef CONFIG_UART_ASYNC_API if (get_dev_data(dev)->async) { - /* Wait for the transmitter to go idle. - * While the async API can wait for transmission to - * complete before disabling the peripheral, the poll - * API exits before the character is sent on the wire. - * If the transmission is ongoing when the peripheral - * is disabled, the ENDTX and TXSTOPPED events will - * never be generated. This will block the driver in - * any future calls to poll_out. + /* Entering inactive state requires device to be no + * active asynchronous calls. */ - irq_unlock(wait_tx_ready(dev)); - async_uart_disable(dev); - uarte_nrfx_pins_enable(dev, false); - return; + __ASSERT_NO_MSG(!data->async->rx_enabled); + __ASSERT_NO_MSG(!data->async->tx_size); + } #endif if (nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { @@ -1852,13 +1891,16 @@ static void uarte_nrfx_set_power_state(const struct device *dev, while (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXTO) && !nrf_uarte_event_check(uarte, - NRF_UARTE_EVENT_ERROR)) { + NRF_UARTE_EVENT_ERROR)) { /* Busy wait for event to register */ } nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); } - nrf_uarte_disable(uarte); + + wait_for_tx_stopped(dev); + uart_disable(dev); uarte_nrfx_pins_enable(dev, false); } } diff --git a/drivers/timer/sys_clock_init.c b/drivers/timer/sys_clock_init.c index 62ddcfe216f..c994525cff4 100644 --- a/drivers/timer/sys_clock_init.c +++ b/drivers/timer/sys_clock_init.c @@ -34,7 +34,7 @@ int __weak sys_clock_device_ctrl(const struct device *dev, uint32_t ctrl_command, uint32_t *context, pm_device_cb cb, void *arg) { - return -ENOTSUP; + return -ENOSYS; } void __weak sys_clock_set_timeout(int32_t ticks, bool idle) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 89e385b957b..738f0a3ef49 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; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 74a5027cc26..e59b0b50b54 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_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index 11d89b1639e..37272a235be 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 { @@ -60,6 +69,14 @@ status = "disabled"; label = "GPIOTE_1"; }; + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc312-sw"; + #address-cells = <0>; + label = "CRYPTOCELL_SW"; + }; + }; }; diff --git a/dts/arm/nordic/nrf9160.dtsi b/dts/arm/nordic/nrf9160.dtsi index 7940c2ba569..e797d79ab52 100644 --- a/dts/arm/nordic/nrf9160.dtsi +++ b/dts/arm/nordic/nrf9160.dtsi @@ -18,7 +18,6 @@ reg = <0>; #address-cells = <1>; #size-cells = <1>; - swo-ref-frequency = <32000000>; mpu: mpu@e000ed90 { compatible = "arm,armv8m-mpu"; @@ -29,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 af04db0abe5..03b3133aff5 100644 --- a/dts/arm/nordic/nrf9160ns.dtsi +++ b/dts/arm/nordic/nrf9160ns.dtsi @@ -18,7 +18,6 @@ reg = <0>; #address-cells = <1>; #size-cells = <1>; - swo-ref-frequency = <32000000>; mpu: mpu@e000ed90 { compatible = "arm,armv8m-mpu"; @@ -30,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 +62,13 @@ status = "disabled"; label = "GPIOTE_1"; }; + + /* For cryptocell access via platform library; see above */ + cryptocell_sw: cryptocell-sw { + compatible = "nordic,nrf-cc310-sw"; + #address-cells = <0>; + label = "CRYPTOCELL_SW"; + }; }; }; 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 00000000000..a0724a45938 --- /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 00000000000..9c3f936bf20 --- /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/include/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld index 8a1c233a50a..34613eb19cb 100644 --- a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -34,6 +34,36 @@ #define _DATA_IN_ROM #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 @@ -60,6 +90,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/arch/arm/aarch32/thread.h b/include/arch/arm/aarch32/thread.h index 4a4938c7e03..a50c6f8ca4a 100644 --- a/include/arch/arm/aarch32/thread.h +++ b/include/arch/arm/aarch32/thread.h @@ -111,7 +111,7 @@ struct _thread_arch { uint32_t mode; #if defined(CONFIG_ARM_STORE_EXC_RETURN) - __packed struct { + struct { uint8_t mode_bits; uint8_t mode_exc_return; uint16_t mode_reserved2; diff --git a/include/drivers/display.h b/include/drivers/display.h index 3b03bb2bc03..7ac8186a9fd 100644 --- a/include/drivers/display.h +++ b/include/drivers/display.h @@ -81,58 +81,31 @@ enum display_orientation { DISPLAY_ORIENTATION_ROTATED_270, }; -/** - * @struct display_capabilities - * @brief Structure holding display capabilities - * - * @var uint16_t display_capabilities::x_resolution - * Display resolution in the X direction - * - * @var uint16_t display_capabilities::y_resolution - * Display resolution in the Y direction - * - * @var uint32_t display_capabilities::supported_pixel_formats - * Bitwise or of pixel formats supported by the display - * - * @var uint32_t display_capabilities::screen_info - * Information about display panel - * - * @var enum display_pixel_format display_capabilities::current_pixel_format - * Currently active pixel format for the display - * - * @var enum display_orientation display_capabilities::current_orientation - * Current display orientation - */ +/** @brief Structure holding display capabilities. */ struct display_capabilities { + /** Display resolution in the X direction */ uint16_t x_resolution; + /** Display resolution in the Y direction */ uint16_t y_resolution; + /** Bitwise or of pixel formats supported by the display */ uint32_t supported_pixel_formats; + /** Information about display panel */ uint32_t screen_info; + /** Currently active pixel format for the display */ enum display_pixel_format current_pixel_format; + /** Current display orientation */ enum display_orientation current_orientation; }; -/** - * @struct display_buffer_descriptor - * @brief Structure to describe display data buffer layout - * - * @var uint32_t display_buffer_descriptor::buf_size - * Data buffer size in bytes - * - * @var uint16_t display_buffer_descriptor::width - * Data buffer row width in pixels - * - * @var uint16_t display_buffer_descriptor::height - * Data buffer column height in pixels - * - * @var uint16_t display_buffer_descriptor::pitch - * Number of pixels between consecutive rows in the data buffer - * - */ +/** @brief Structure to describe display data buffer layout */ struct display_buffer_descriptor { + /** Data buffer size in bytes */ uint32_t buf_size; + /** Data buffer row width in pixels */ uint16_t width; + /** Data buffer column height in pixels */ uint16_t height; + /** Number of pixels between consecutive rows in the data buffer */ uint16_t pitch; }; diff --git a/include/sys/thread_stack.h b/include/kernel/thread_stack.h similarity index 98% rename from include/sys/thread_stack.h rename to include/kernel/thread_stack.h index 358ac8d885a..2b7e338c1fc 100644 --- a/include/sys/thread_stack.h +++ b/include/kernel/thread_stack.h @@ -10,6 +10,14 @@ * @brief Macros for declaring thread stacks */ +/** + * @brief Thread Stack APIs + * @ingroup kernel_apis + * @defgroup thread_stack_api Thread Stack APIs + * @{ + * @} + */ + #ifndef ZEPHYR_INCLUDE_SYS_THREAD_STACK_H #define ZEPHYR_INCLUDE_SYS_THREAD_STACK_H @@ -107,7 +115,7 @@ static inline char *z_stack_ptr_align(char *ptr) #define K_KERNEL_STACK_EXTERN(sym) extern k_thread_stack_t sym[] /** - * @addtogroup stack_apis + * @addtogroup thread_stack_api * @{ */ @@ -288,7 +296,7 @@ static inline char *Z_KERNEL_STACK_BUFFER(k_thread_stack_t *sym) #define K_THREAD_STACK_EXTERN(sym) extern k_thread_stack_t sym[] /** - * @addtogroup stack_apis + * @addtogroup thread_stack_api * @{ */ diff --git a/include/kernel_includes.h b/include/kernel_includes.h index 1cc0167c6ac..179ca6ae47e 100644 --- a/include/kernel_includes.h +++ b/include/kernel_includes.h @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/logging/log_msg2.h b/include/logging/log_msg2.h index 23fc4553804..df68c5d2b13 100644 --- a/include/logging/log_msg2.h +++ b/include/logging/log_msg2.h @@ -176,11 +176,14 @@ enum z_log_msg2_mode { #define Z_LOG_MSG_DESC_INITIALIZER(_domain_id, _level, _plen, _dlen) \ { \ + .valid = 0, \ + .busy = 0, \ .type = Z_LOG_MSG2_LOG, \ .domain = _domain_id, \ .level = _level, \ .package_len = _plen, \ .data_len = _dlen, \ + .reserved = 0, \ } /* Messages are aligned to alignment required by cbprintf package. */ diff --git a/include/net/mqtt.h b/include/net/mqtt.h index ba63d8b8b46..d783a5eff82 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_ip.h b/include/net/net_ip.h index e794f18f5dd..d597dba552f 100644 --- a/include/net/net_ip.h +++ b/include/net/net_ip.h @@ -47,6 +47,7 @@ extern "C" { #define PF_NET_MGMT 5 /**< Network management info. */ #define PF_LOCAL 6 /**< Inter-process communication */ #define PF_UNIX PF_LOCAL /**< Inter-process communication */ +#define PF_LTE 102 /**< Specific to LTE. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC /**< Unspecified address family. */ @@ -57,6 +58,7 @@ extern "C" { #define AF_NET_MGMT PF_NET_MGMT /**< Network management info. */ #define AF_LOCAL PF_LOCAL /**< Inter-process communication */ #define AF_UNIX PF_UNIX /**< Inter-process communication */ +#define AF_LTE PF_LTE /**< Specific to LTE. */ /** Protocol numbers from IANA/BSD */ enum net_ip_protocol { @@ -80,11 +82,23 @@ enum net_ip_protocol_secure { IPPROTO_DTLS_1_2 = 273, /**< DTLS 1.2 protocol */ }; +/* Protocol numbers for LTE protocols */ +enum net_lte_protocol { + NPROTO_AT = 513, + NPROTO_PDN = 514 +}; + +/* Protocol numbers for LOCAL protocols */ +enum net_local_protocol { + NPROTO_DFU = 515 +}; + /** Socket type */ enum net_sock_type { - SOCK_STREAM = 1, /**< Stream socket type */ - SOCK_DGRAM, /**< Datagram socket type */ - SOCK_RAW /**< RAW socket type */ + SOCK_STREAM = 1, /**< Stream socket type */ + SOCK_DGRAM, /**< Datagram socket type */ + SOCK_RAW, /**< RAW socket type */ + SOCK_MGMT /**< Management socket type */ }; /** @brief Convert 16-bit value from network to host byte order. diff --git a/include/net/net_l2.h b/include/net/net_l2.h index cbbe48473c6..05a172091f0 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 f41b902ba5e..2475a469997 100644 --- a/include/net/socket.h +++ b/include/net/socket.h @@ -55,14 +55,12 @@ struct zsock_pollfd { /** zsock_recv: Read data without removing it from socket input queue */ #define ZSOCK_MSG_PEEK 0x02 -/** zsock_recv: return the real length of the datagram, even when it was longer - * than the passed buffer - */ -#define ZSOCK_MSG_TRUNC 0x20 +/** zsock_recv: Control received data truncation */ +#define ZSOCK_MSG_TRUNC 0x10 +/** zsock_recv: Request a blocking operation until the request is satisfied. */ +#define ZSOCK_MSG_WAITALL 0x20 /** zsock_recv/zsock_send: Override operation to non-blocking */ #define ZSOCK_MSG_DONTWAIT 0x40 -/** zsock_recv: block until the full amount of data can be returned */ -#define ZSOCK_MSG_WAITALL 0x100 /* Well-known values, e.g. from Linux man 2 shutdown: * "The constants SHUT_RD, SHUT_WR, SHUT_RDWR have the value 0, 1, 2, @@ -126,6 +124,7 @@ struct zsock_pollfd { * - 1 - server */ #define TLS_DTLS_ROLE 6 + /** Socket option for setting the supported Application Layer Protocols. * It accepts and returns a const char array of NULL terminated strings * representing the supported application layer protocols listed during @@ -139,6 +138,12 @@ struct zsock_pollfd { #define TLS_DTLS_HANDSHAKE_TIMEOUT_MIN 8 #define TLS_DTLS_HANDSHAKE_TIMEOUT_MAX 9 +/** Socket option to control TLS session caching. Accepted values: + * - 0 - Disabled. + * - 1 - Enabled. + */ +#define TLS_SESSION_CACHE 8 + /** @} */ /* Valid values for TLS_PEER_VERIFY option */ @@ -150,6 +155,10 @@ struct zsock_pollfd { #define TLS_DTLS_ROLE_CLIENT 0 /**< Client role in a DTLS session. */ #define TLS_DTLS_ROLE_SERVER 1 /**< Server role in a DTLS session. */ +/* 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. */ + struct zsock_addrinfo { struct zsock_addrinfo *ai_next; int ai_flags; @@ -554,6 +563,14 @@ __syscall int z_zsock_getaddrinfo_internal(const char *host, #define AI_ADDRCONFIG 0x20 /** Assume service (port) is numeric */ #define AI_NUMERICSERV 0x400 +/** 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 /** * @brief Resolve a domain name to one or more network addresses @@ -828,7 +845,7 @@ struct ifreq { #define SOL_SOCKET 1 /* Socket options for SOL_SOCKET level */ -/** sockopt: Enable server address reuse (ignored, for compatibility) */ +/** sockopt: Enable server address reuse */ #define SO_REUSEADDR 2 /** sockopt: Type of the socket */ #define SO_TYPE 3 @@ -844,7 +861,13 @@ struct ifreq { #define SO_SNDTIMEO 21 /** sockopt: Bind a socket to an interface */ -#define SO_BINDTODEVICE 25 +#define SO_BINDTODEVICE 25 +/** 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: Timestamp TX packets */ #define SO_TIMESTAMPING 37 @@ -870,6 +893,27 @@ struct ifreq { /** sockopt: Enable SOCKS5 for Socket */ #define SO_SOCKS5 60 +/* Protocol level for PDN. */ +#define SOL_PDN 514 + +/* Socket options for SOL_PDN level */ +#define SO_PDN_AF 1 +#define SO_PDN_CONTEXT_ID 2 +#define SO_PDN_STATE 3 + +/* Protocol level for DFU. */ +#define SOL_DFU 515 + +/* Socket options for SOL_DFU level */ +#define SO_DFU_FW_VERSION 1 +#define SO_DFU_RESOURCES 2 +#define SO_DFU_TIMEO 3 +#define SO_DFU_APPLY 4 +#define SO_DFU_REVERT 5 +#define SO_DFU_BACKUP_DELETE 6 +#define SO_DFU_OFFSET 7 +#define SO_DFU_ERROR 20 + /** @cond INTERNAL_HIDDEN */ /** * @brief Registration information for a given BSD socket family. diff --git a/include/storage/flash_map.h b/include/storage/flash_map.h index aea59568e7e..8cf0bb8fe59 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,8 @@ 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)) +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/include/sys/cbprintf_cxx.h b/include/sys/cbprintf_cxx.h index 23365811159..e44bc6fc908 100644 --- a/include/sys/cbprintf_cxx.h +++ b/include/sys/cbprintf_cxx.h @@ -61,11 +61,15 @@ static inline int z_cbprintf_cxx_is_pchar(T arg) /* C++ version for calculating argument size. */ static inline size_t z_cbprintf_cxx_arg_size(float f) { + ARG_UNUSED(f); + return sizeof(double); } static inline size_t z_cbprintf_cxx_arg_size(void *p) { + ARG_UNUSED(p); + return sizeof(void *); } @@ -134,38 +138,51 @@ static inline void z_cbprintf_cxx_store_arg(uint8_t *dst, T arg) /* C++ version for long double detection. */ static inline int z_cbprintf_cxx_is_longdouble(long double arg) { + ARG_UNUSED(arg); return 1; } template < typename T > static inline int z_cbprintf_cxx_is_longdouble(T arg) { + ARG_UNUSED(arg); + return 0; } /* C++ version for caluculating argument alignment. */ static inline size_t z_cbprintf_cxx_alignment(float arg) { + ARG_UNUSED(arg); + return VA_STACK_ALIGN(double); } static inline size_t z_cbprintf_cxx_alignment(double arg) { + ARG_UNUSED(arg); + return VA_STACK_ALIGN(double); } static inline size_t z_cbprintf_cxx_alignment(long double arg) { + ARG_UNUSED(arg); + return VA_STACK_ALIGN(long double); } static inline size_t z_cbprintf_cxx_alignment(long long arg) { + ARG_UNUSED(arg); + return VA_STACK_ALIGN(long long); } static inline size_t z_cbprintf_cxx_alignment(unsigned long long arg) { + ARG_UNUSED(arg); + return VA_STACK_ALIGN(long long); } diff --git a/include/sys/cbprintf_internal.h b/include/sys/cbprintf_internal.h index 39206b5193a..d435a69c83c 100644 --- a/include/sys/cbprintf_internal.h +++ b/include/sys/cbprintf_internal.h @@ -360,7 +360,10 @@ do { \ /* Store length in the header, set number of dumped strings to 0 */ \ if (_pbuf) { \ union z_cbprintf_hdr hdr = { \ - .desc = {.len = (uint8_t)(_pkg_len / sizeof(int)) } \ + .desc = { \ + .len = (uint8_t)(_pkg_len / sizeof(int)), \ + .str_cnt = 0, \ + } \ }; \ *_len_loc = hdr; \ } \ diff --git a/kernel/work.c b/kernel/work.c index 55abdd51677..65522c62114 100644 --- a/kernel/work.c +++ b/kernel/work.c @@ -573,79 +573,6 @@ bool k_work_cancel_sync(struct k_work *work, return pending; } -/* Work has been dequeued and is about to be invoked by the work - * thread. - * - * If the work is being canceled the cancellation will be completed - * here, and the caller told not to use the work item. - * - * Invoked by work queue thread. - * Takes and releases lock. - * Reschedules via finalize_cancel_locked - * - * @param work work that is changing state - * @param queue queue that is running work - * - * @retval true if work is to be run by the work thread - * @retval false if it has been canceled and should not be run - */ -static inline bool work_set_running(struct k_work *work, - struct k_work_q *queue) -{ - bool ret = false; - k_spinlock_key_t key = k_spin_lock(&lock); - - /* Allow the work to be queued again. */ - flag_clear(&work->flags, K_WORK_QUEUED_BIT); - - /* Normally we indicate that the work is being processed by - * setting RUNNING. However, something may have initiated - * cancellation between when the work thread pulled this off - * its queue and this claimed the work lock. If that happened - * we complete the cancellation now and tell the work thread - * not to do anything. - */ - ret = !flag_test(&work->flags, K_WORK_CANCELING_BIT); - if (ret) { - /* Not cancelling: mark running and go */ - flag_set(&work->flags, K_WORK_RUNNING_BIT); - } else { - /* Caught the item before being invoked; complete the - * cancellation now. - */ - finalize_cancel_locked(work); - } - - k_spin_unlock(&lock, key); - - return ret; -} - -/* Work handler has been called and is about to go idle. - * - * If the work is being canceled this will notify anything waiting - * for the cancellation. - * - * Invoked by work queue thread. - * Takes and releases lock. - * Reschedules via finalize_cancel_locked - * - * @param work work that is in running state - */ -static inline void work_clear_running(struct k_work *work) -{ - k_spinlock_key_t key = k_spin_lock(&lock); - - /* Clear running */ - flag_clear(&work->flags, K_WORK_RUNNING_BIT); - - if (flag_test(&work->flags, K_WORK_CANCELING_BIT)) { - finalize_cancel_locked(work); - } - - k_spin_unlock(&lock, key); -} - /* Loop executed by a work queue thread. * * @param workq_ptr pointer to the work queue structure @@ -657,11 +584,10 @@ static void work_queue_main(void *workq_ptr, void *p2, void *p3) while (true) { sys_snode_t *node; struct k_work *work = NULL; + k_work_handler_t handler = NULL; k_spinlock_key_t key = k_spin_lock(&lock); - /* Clear the record of processing any previous work, and check - * for new work. - */ + /* Check for and prepare any new work. */ node = sys_slist_get(&queue->pending); if (node != NULL) { /* Mark that there's some work active that's @@ -669,6 +595,9 @@ static void work_queue_main(void *workq_ptr, void *p2, void *p3) */ flag_set(&queue->flags, K_WORK_QUEUE_BUSY_BIT); work = CONTAINER_OF(node, struct k_work, node); + flag_set(&work->flags, K_WORK_RUNNING_BIT); + flag_clear(&work->flags, K_WORK_QUEUED_BIT); + handler = work->handler; } else if (flag_test_and_clear(&queue->flags, K_WORK_QUEUE_DRAIN_BIT)) { /* Not busy and draining: move threads waiting for @@ -704,20 +633,22 @@ static void work_queue_main(void *workq_ptr, void *p2, void *p3) if (work != NULL) { bool yield; - k_work_handler_t handler = work->handler; __ASSERT_NO_MSG(handler != NULL); + handler(work); - if (work_set_running(work, queue)) { - handler(work); - work_clear_running(work); - } - - /* No longer referencing the work, so we can clear the - * BUSY flag while we yield to prevent starving other - * threads. + /* Mark the work item as no longer running and deal + * with any cancellation issued while it was running. + * Clear the BUSY flag and optionally yield to prevent + * starving other threads. */ key = k_spin_lock(&lock); + + flag_clear(&work->flags, K_WORK_RUNNING_BIT); + if (flag_test(&work->flags, K_WORK_CANCELING_BIT)) { + finalize_cancel_locked(work); + } + flag_clear(&queue->flags, K_WORK_QUEUE_BUSY_BIT); yield = !flag_test(&queue->flags, K_WORK_QUEUE_NO_YIELD_BIT); k_spin_unlock(&lock, key); diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 2d76d1590f2..3210b92f430 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -58,7 +58,7 @@ function(trusted_firmware_build) set(options IPC BL2 REGRESSION_S REGRESSION_NS) set(oneValueArgs BINARY_DIR BOARD ISOLATION_LEVEL CMAKE_BUILD_TYPE BUILD_PROFILE MCUBOOT_IMAGE_NUMBER PSA_TEST_SUITE) - set(multiValueArgs ENABLED_PARTITIONS) + set(multiValueArgs ENABLED_PARTITIONS CMAKE_ARGS) cmake_parse_arguments(TFM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) foreach(partition ${TFM_VALID_PARTITIONS}) @@ -186,6 +186,7 @@ function(trusted_firmware_build) -DMBEDCRYPTO_PATH=${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/../../crypto/mbedtls/mbedtls -DMCUBOOT_PATH=${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/../tfm-mcuboot -DPSA_ARCH_TESTS_PATH=${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/psa-arch-tests + -DZEPHYR_BASE=${ZEPHYR_BASE} ${TFM_PARTITIONS_ARGS} ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m WORKING_DIRECTORY ${TFM_BINARY_DIR} diff --git a/modules/trusted-firmware-m/Kconfig b/modules/trusted-firmware-m/Kconfig index a743a095a85..8d44efa614f 100644 --- a/modules/trusted-firmware-m/Kconfig +++ b/modules/trusted-firmware-m/Kconfig @@ -24,6 +24,12 @@ config TFM_BOARD menuconfig BUILD_WITH_TFM bool "Build with TF-M as the Secure Execution Environment" + select CMSIS_RTOS_V2 + imply POLL + imply THREAD_NAME + imply THREAD_STACK_INFO + imply INIT_STACKS + imply THREAD_MONITOR depends on TRUSTED_EXECUTION_NONSECURE depends on TFM_BOARD != "" depends on ARM_TRUSTZONE_M @@ -50,6 +56,10 @@ menuconfig BUILD_WITH_TFM if BUILD_WITH_TFM +config NUM_PREEMPT_PRIORITIES + int + default 56 + config TFM_KEY_FILE_S string "Path to private key used to sign secure firmware images." depends on BUILD_WITH_TFM 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 00000000000..e6749ae6399 --- /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/nrf/ieee802154/802154_rpmsg/prj.conf b/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf index e0b3383d426..c94b19fbfae 100644 --- a/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf +++ b/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf @@ -9,3 +9,4 @@ CONFIG_OPENAMP_MASTER=n CONFIG_OPENAMP_SLAVE=y CONFIG_NRF_802154_SER_RADIO=y +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=2 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 00000000000..d1b780bdc0f --- /dev/null +++ b/samples/net/sockets/echo_server/overlay-tfm.conf @@ -0,0 +1,10 @@ +# 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=y +CONFIG_MBEDTLS_LIBRARY=y +CONFIG_MBEDTLS_INSTALL_PATH="DUMMY" +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 diff --git a/samples/subsys/pm/device_pm/sample.yaml b/samples/subsys/pm/device_pm/sample.yaml index d1751e5459f..114a54fcc7a 100644 --- a/samples/subsys/pm/device_pm/sample.yaml +++ b/samples/subsys/pm/device_pm/sample.yaml @@ -10,8 +10,8 @@ tests: regex: - "Device PM sample app start" - "parent resuming\\.\\." - - "child resuming\\.\\." - "Async wakeup request queued" + - "child resuming\\.\\." - "Dummy device resumed" - "child suspending\\.\\." - "parent suspending\\.\\." diff --git a/samples/subsys/pm/device_pm/src/dummy_driver.c b/samples/subsys/pm/device_pm/src/dummy_driver.c index dafa1935691..25319678516 100644 --- a/samples/subsys/pm/device_pm/src/dummy_driver.c +++ b/samples/subsys/pm/device_pm/src/dummy_driver.c @@ -83,7 +83,7 @@ static int dummy_close(const struct device *dev) /* Parent can be suspended */ if (parent) { - pm_device_put(parent); + pm_device_put_sync(parent); } return ret; diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index ff82fbb1d9f..492a4dfa86b 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,11 @@ 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(content) def write_kconfig_soc(self): diff --git a/soc/arm/common/cortex_m/arm_mpu_regions.c b/soc/arm/common/cortex_m/arm_mpu_regions.c index 6ba05377ba5..f1bca61ef14 100644 --- a/soc/arm/common/cortex_m/arm_mpu_regions.c +++ b/soc/arm/common/cortex_m/arm_mpu_regions.c @@ -8,6 +8,9 @@ #include #include "arm_mpu_mem_cfg.h" +#if USE_PARTITION_MANAGER +#include +#endif static const struct arm_mpu_region mpu_regions[] = { /* Region 0 */ @@ -21,6 +24,14 @@ static const struct arm_mpu_region mpu_regions[] = { #endif /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -28,6 +39,9 @@ static const struct arm_mpu_region mpu_regions[] = { #else REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif + +#endif /* USE_PARTITION_MANAGER */ + }; const struct arm_mpu_config mpu_config = { diff --git a/soc/arm/nordic_nrf/nrf91/Kconfig.series b/soc/arm/nordic_nrf/nrf91/Kconfig.series index 7b9c115bb63..c68c080a163 100644 --- a/soc/arm/nordic_nrf/nrf91/Kconfig.series +++ b/soc/arm/nordic_nrf/nrf91/Kconfig.series @@ -16,6 +16,5 @@ config SOC_SERIES_NRF91X select XIP select HAS_NRFX select HAS_SEGGER_RTT - select HAS_SWO help Enable support for NRF91 MCU series diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h index fb7247575ae..53376e63b78 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h @@ -379,10 +379,22 @@ static inline void hal_sw_switch_timer_clear_ppi_config(void) /* Wire a SW SWITCH TIMER EVENTS_COMPARE[] event * to a PPI GROUP TASK DISABLE task (PPI group with index ). - * 2 adjacent PPIs (8 & 9) and 2 adjacent PPI groups are used for this wiring; + * 2 adjacent PPIs (9 & 10) and 2 adjacent PPI groups are used for this wiring; * must be 0 or 1. must be a valid TIMER CC register offset. */ +#if defined(CONFIG_SOC_NRF52805) +/* Because nRF52805 has limited number of programmable PPI channels, + * tIFS Trx SW switching on this SoC can be used only when pre-programmed + * PPI channels are also in use, i.e. when TIMER0 is the event timer. + */ +#if (EVENT_TIMER_ID == 0) +#define HAL_SW_SWITCH_GROUP_TASK_DISABLE_PPI_BASE 2 +#else +#error "tIFS Trx SW switch can be used on this SoC only with TIMER0 as the event timer" +#endif +#else /* -> !defined(CONFIG_SOC_NRF52805) */ #define HAL_SW_SWITCH_GROUP_TASK_DISABLE_PPI_BASE 9 +#endif #define HAL_SW_SWITCH_GROUP_TASK_DISABLE_PPI(index) \ (HAL_SW_SWITCH_GROUP_TASK_DISABLE_PPI_BASE + (index)) #define HAL_SW_SWITCH_GROUP_TASK_DISABLE_PPI_REGISTER_EVT(chan) \ @@ -398,12 +410,8 @@ static inline void hal_sw_switch_timer_clear_ppi_config(void) * 2 adjacent PPI groups are used for this wiring. 'index' must be 0 or 1. */ #if defined(CONFIG_SOC_NRF52805) -/* Because nRF52805 has limited number of programmable PPI channels, - * tIFS Trx SW switching on this SoC can be used only when pre-programmed - * PPI channels are also in use, i.e. when TIMER0 is the event timer. - */ #if (EVENT_TIMER_ID == 0) -#define HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI 2 +#define HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI 9 #else #error "tIFS Trx SW switch can be used on this SoC only with TIMER0 as the event timer" #endif @@ -418,12 +426,12 @@ static inline void hal_sw_switch_timer_clear_ppi_config(void) /*Enable Radio at specific time-stamp: * wire the SW SWITCH TIMER EVENTS_COMPARE[] event * to RADIO TASKS_TXEN/RXEN task. - * 2 adjacent PPIs (11 & 12) are used for this wiring; must be 0 or 1. + * 2 adjacent PPIs (12 & 13) are used for this wiring; must be 0 or 1. * must be a valid TIMER CC register offset. */ #if defined(CONFIG_SOC_NRF52805) #if (EVENT_TIMER_ID == 0) -#define HAL_SW_SWITCH_RADIO_ENABLE_PPI_BASE 3 +#define HAL_SW_SWITCH_RADIO_ENABLE_PPI_BASE 4 #else #error "tIFS Trx SW switch can be used on this SoC only with TIMER0 as the event timer" #endif diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index fb1d94fc14a..7693e379a95 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -229,6 +229,7 @@ enum { #if defined(CONFIG_BT_GATT_CACHING) DB_HASH_VALID, /* Database hash needs to be calculated */ + DB_HASH_LOAD, /* Database hash loaded from settings. */ #endif /* Total number of flags - must be at the end of the enum */ SC_NUM_FLAGS, @@ -248,6 +249,9 @@ static struct gatt_sc { #if defined(CONFIG_BT_GATT_CACHING) static struct db_hash { uint8_t hash[16]; +#if defined(CONFIG_BT_SETTINGS) + uint8_t stored_hash[16]; +#endif struct k_work_delayable work; struct k_work_sync sync; } db_hash; @@ -719,8 +723,44 @@ static void db_hash_gen(bool store) atomic_set_bit(gatt_sc.flags, DB_HASH_VALID); } +#if defined(CONFIG_BT_SETTINGS) +static void sc_indicate(uint16_t start, uint16_t end); +#endif + static void db_hash_process(struct k_work *work) { +#if defined(CONFIG_BT_SETTINGS) + if (atomic_test_and_clear_bit(gatt_sc.flags, DB_HASH_LOAD)) { + if (!atomic_test_bit(gatt_sc.flags, DB_HASH_VALID)) { + db_hash_gen(false); + } + + /* Check if hash matches then skip SC update */ + if (!memcmp(db_hash.stored_hash, db_hash.hash, + sizeof(db_hash.stored_hash))) { + BT_DBG("Database Hash matches"); + k_work_cancel_delayable(&gatt_sc.work); + atomic_clear_bit(gatt_sc.flags, SC_RANGE_CHANGED); + return; + } + + BT_HEXDUMP_DBG(db_hash.hash, sizeof(db_hash.hash), + "New Hash: "); + + /* GATT database has been modified since last boot, likely due + * to a firmware update or a dynamic service that was not + * re-registered on boot. + * Indicate Service Changed to all bonded devices for the full + * database range to invalidate client-side cache and force + * discovery on reconnect. + */ + sc_indicate(0x0001, 0xffff); + + /* Hash did not match, overwrite with current hash */ + db_hash_store(); + return; + } +#endif /* defined(CONFIG_BT_SETTINGS) */ db_hash_gen(true); } @@ -5118,58 +5158,30 @@ static int cf_set(const char *name, size_t len_rd, settings_read_cb read_cb, SETTINGS_STATIC_HANDLER_DEFINE(bt_cf, "bt/cf", NULL, cf_set, NULL, NULL); -static uint8_t stored_hash[16]; - static int db_hash_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { ssize_t len; - len = read_cb(cb_arg, stored_hash, sizeof(stored_hash)); + len = read_cb(cb_arg, db_hash.stored_hash, sizeof(db_hash.stored_hash)); if (len < 0) { BT_ERR("Failed to decode value (err %zd)", len); return len; } - BT_HEXDUMP_DBG(stored_hash, sizeof(stored_hash), "Stored Hash: "); + BT_HEXDUMP_DBG(db_hash.stored_hash, sizeof(db_hash.stored_hash), + "Stored Hash: "); return 0; } static int db_hash_commit(void) { - - k_sched_lock(); - - /* Stop work and generate the hash */ - (void)k_work_cancel_delayable_sync(&db_hash.work, &db_hash.sync); - if (!atomic_test_bit(gatt_sc.flags, DB_HASH_VALID)) { - db_hash_gen(false); - } - - k_sched_unlock(); - - /* Check if hash matches then skip SC update */ - if (!memcmp(stored_hash, db_hash.hash, sizeof(stored_hash))) { - BT_DBG("Database Hash matches"); - k_work_cancel_delayable(&gatt_sc.work); - atomic_clear_bit(gatt_sc.flags, SC_RANGE_CHANGED); - return 0; - } - - BT_HEXDUMP_DBG(db_hash.hash, sizeof(db_hash.hash), "New Hash: "); - - /** - * GATT database has been modified since last boot, likely due to - * a firmware update or a dynamic service that was not re-registered on - * boot. Indicate Service Changed to all bonded devices for the full - * database range to invalidate client-side cache and force discovery on - * reconnect. + atomic_set_bit(gatt_sc.flags, DB_HASH_LOAD); + /* Reschedule work to calculate and compare against the Hash value + * loaded from flash. */ - sc_indicate(0x0001, 0xffff); - - /* Hash did not match overwrite with current hash */ - db_hash_store(); + k_work_reschedule(&db_hash.work, K_NO_WAIT); return 0; } diff --git a/subsys/bluetooth/mesh/access.c b/subsys/bluetooth/mesh/access.c index 65c1b6fb670..a9e1dd745cf 100644 --- a/subsys/bluetooth/mesh/access.c +++ b/subsys/bluetooth/mesh/access.c @@ -215,7 +215,7 @@ static int pub_period_start(struct bt_mesh_model_pub *pub) BT_DBG("Update failed, skipping publish (err: %d)", err); pub->count = 0; pub->period_start = k_uptime_get_32(); - publish_sent(err, pub); + publish_sent(err, pub->mod); return err; } diff --git a/subsys/ipc/rpmsg_service/rpmsg_service.c b/subsys/ipc/rpmsg_service/rpmsg_service.c index a488c79ec70..3616a6fda77 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_service.c +++ b/subsys/ipc/rpmsg_service/rpmsg_service.c @@ -61,7 +61,7 @@ static void ns_bind_cb(struct rpmsg_device *rdev, if (err != 0) { LOG_ERR("Creating remote endpoint %s" - " failed wirh error %d", name, err); + " failed wirh error %d", log_strdup(name), err); } else { endpoints[i].bound = true; } @@ -70,7 +70,7 @@ static void ns_bind_cb(struct rpmsg_device *rdev, } } - LOG_ERR("Remote endpoint %s not registered locally", name); + LOG_ERR("Remote endpoint %s not registered locally", log_strdup(name)); } #endif @@ -146,7 +146,7 @@ int rpmsg_service_register_endpoint(const char *name, rpmsg_ept_cb cb) } } - LOG_ERR("No free slots to register endpoint %s", name); + LOG_ERR("No free slots to register endpoint %s", log_strdup(name)); return -ENOMEM; } diff --git a/subsys/logging/Kconfig.backends b/subsys/logging/Kconfig.backends index 57286f54112..1b1fcedb143 100644 --- a/subsys/logging/Kconfig.backends +++ b/subsys/logging/Kconfig.backends @@ -89,6 +89,7 @@ config LOG_BACKEND_RTT bool "Enable Segger J-Link RTT backend" depends on USE_SEGGER_RTT default y if !SHELL_BACKEND_RTT + select SEGGER_RTT_CUSTOM_LOCKING help When enabled, backend will use RTT for logging. This backend works on a per message basis. Only a whole message (terminated with a carriage return: '\r') diff --git a/subsys/logging/log_backend_rtt.c b/subsys/logging/log_backend_rtt.c index 3b27b85ae28..c4d883d7561 100644 --- a/subsys/logging/log_backend_rtt.c +++ b/subsys/logging/log_backend_rtt.c @@ -154,9 +154,11 @@ static int line_out_drop_mode(void) } } + int ret; + RTT_LOCK(); - int ret = SEGGER_RTT_WriteSkipNoLock(CONFIG_LOG_BACKEND_RTT_BUFFER, - line_buf, line_pos - line_buf); + ret = SEGGER_RTT_WriteSkipNoLock(CONFIG_LOG_BACKEND_RTT_BUFFER, + line_buf, line_pos - line_buf); RTT_UNLOCK(); if (ret == 0) { @@ -209,12 +211,12 @@ static int data_out_block_mode(uint8_t *data, size_t length, void *ctx) do { if (!is_sync_mode()) { RTT_LOCK(); - } - - ret = SEGGER_RTT_WriteSkipNoLock(CONFIG_LOG_BACKEND_RTT_BUFFER, - data, length); - if (!is_sync_mode()) { + ret = SEGGER_RTT_WriteSkipNoLock(CONFIG_LOG_BACKEND_RTT_BUFFER, + data, length); RTT_UNLOCK(); + } else { + ret = SEGGER_RTT_WriteSkipNoLock(CONFIG_LOG_BACKEND_RTT_BUFFER, + data, length); } if (ret) { diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index bb672a50f71..e5aacfaada1 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -140,7 +140,7 @@ config NET_SHELL_DYN_CMD_COMPLETION config NET_TC_TX_COUNT int "How many Tx traffic classes to have for each network device" - default 1 if USERSPACE + default 1 if USERSPACE || USB_DEVICE_NETWORK default 0 range 1 NET_TC_NUM_PRIORITIES if NET_TC_NUM_PRIORITIES<=8 && USERSPACE range 0 NET_TC_NUM_PRIORITIES if NET_TC_NUM_PRIORITIES<=8 diff --git a/subsys/net/ip/tcp2.c b/subsys/net/ip/tcp2.c index a97d70efaac..1d5527ccdb5 100644 --- a/subsys/net/ip/tcp2.c +++ b/subsys/net/ip/tcp2.c @@ -1624,6 +1624,7 @@ static void tcp_in(struct tcp *conn, struct net_pkt *pkt) struct tcphdr *th = pkt ? th_get(pkt) : NULL; uint8_t next = 0, fl = 0; bool do_close = false; + bool connection_ok = false; size_t tcp_options_len = th ? (th_off(th) - 5) * 4 : 0; struct net_conn *conn_handler = NULL; struct net_pkt *recv_pkt; @@ -1761,11 +1762,19 @@ static void tcp_in(struct tcp *conn, struct net_pkt *pkt) } conn_ack(conn, + len); } - k_sem_give(&conn->connect_sem); + next = TCP_ESTABLISHED; net_context_set_state(conn->context, NET_CONTEXT_CONNECTED); tcp_out(conn, ACK); + + /* The connection semaphore is released *after* + * we have changed the connection state. This way + * the application can send data and it is queued + * properly even if this thread is running in lower + * priority. + */ + connection_ok = true; } break; case TCP_ESTABLISHED: @@ -1931,6 +1940,11 @@ static void tcp_in(struct tcp *conn, struct net_pkt *pkt) th = NULL; conn_state(conn, next); next = 0; + + if (connection_ok) { + k_sem_give(&conn->connect_sem); + } + goto next_state; } diff --git a/subsys/net/l2/Kconfig b/subsys/net/l2/Kconfig index 92723a5c304..a861f210f0e 100644 --- a/subsys/net/l2/Kconfig +++ b/subsys/net/l2/Kconfig @@ -78,6 +78,11 @@ source "subsys/net/l2/openthread/Kconfig" source "subsys/net/l2/canbus/Kconfig" +config NET_L2_ZIGBEE + bool "Zigbee L2" + depends on NETWORKING + select NET_PKT_TIMESTAMP + config NET_L2_WIFI_MGMT bool "Enable Wi-Fi Management support" select NET_MGMT diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index fa608a38036..a6850a68fe3 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -78,6 +78,16 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } + if (tls_config->session_cache == TLS_SESSION_CACHE_ENABLED) { + ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, + TLS_SESSION_CACHE, + &tls_config->session_cache, + sizeof(tls_config->session_cache)); + if (ret < 0) { + goto error; + } + } + size_t peer_addr_size = sizeof(struct sockaddr_in6); if (broker->sa_family == AF_INET) { diff --git a/subsys/net/lib/sockets/sockets_tls.c b/subsys/net/lib/sockets/sockets_tls.c index a2504030c14..4722fc77706 100644 --- a/subsys/net/lib/sockets/sockets_tls.c +++ b/subsys/net/lib/sockets/sockets_tls.c @@ -12,7 +12,6 @@ LOG_MODULE_REGISTER(net_sock_tls, CONFIG_NET_SOCKETS_LOG_LEVEL); #include -#include #include #include #include @@ -26,7 +25,6 @@ LOG_MODULE_REGISTER(net_sock_tls, CONFIG_NET_SOCKETS_LOG_LEVEL); #include CONFIG_MBEDTLS_CFG_FILE #endif /* CONFIG_MBEDTLS_CFG_FILE */ -#include #include #include #include @@ -163,12 +161,6 @@ __net_socket struct tls_context { #endif /* CONFIG_MBEDTLS */ }; -#if defined(CONFIG_ENTROPY_HAS_DRIVER) -static const struct device *entropy_dev; -#endif - -static mbedtls_ctr_drbg_context tls_ctr_drbg; - /* A global pool of TLS contexts. */ static struct tls_context tls_contexts[CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS]; @@ -204,37 +196,18 @@ static void tls_debug(void *ctx, int level, const char *file, } #endif /* defined(MBEDTLS_DEBUG_C) && (CONFIG_NET_SOCKETS_LOG_LEVEL >= LOG_LEVEL_DBG) */ -#if defined(CONFIG_ENTROPY_HAS_DRIVER) -static int tls_entropy_func(void *ctx, unsigned char *buf, size_t len) +static int tls_ctr_drbg_random(void *ctx, unsigned char *buf, size_t len) { ARG_UNUSED(ctx); - return entropy_get_entropy(entropy_dev, buf, len); -} +#if defined(CONFIG_ENTROPY_HAS_DRIVER) + return sys_csrand_get(buf, len); #else -static int tls_entropy_func(void *ctx, unsigned char *buf, size_t len) -{ - ARG_UNUSED(ctx); - - size_t i = len / 4; - uint32_t val; - - while (i--) { - val = sys_rand32_get(); - UNALIGNED_PUT(val, (uint32_t *)buf); - buf += 4; - } - - i = len & 0x3; - val = sys_rand32_get(); - while (i--) { - *buf++ = val; - val >>= 8; - } + sys_rand_get(buf, len); return 0; +#endif } -#endif /* defined(CONFIG_ENTROPY_HAS_DRIVER) */ #if defined(CONFIG_NET_SOCKETS_ENABLE_DTLS) /* mbedTLS-defined function for setting timer. */ @@ -287,34 +260,15 @@ static int tls_init(const struct device *unused) { ARG_UNUSED(unused); - int ret; - static const unsigned char drbg_seed[] = "zephyr"; - -#if defined(CONFIG_ENTROPY_HAS_DRIVER) - entropy_dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL); - if (!entropy_dev) { - NET_ERR("Failed to obtain entropy device"); - return -ENODEV; - } -#else +#if !defined(CONFIG_ENTROPY_HAS_DRIVER) NET_WARN("No entropy device on the system, " "TLS communication may be insecure!"); -#endif /* defined(CONFIG_ENTROPY_HAS_DRIVER) */ +#endif (void)memset(tls_contexts, 0, sizeof(tls_contexts)); k_mutex_init(&context_lock); - mbedtls_ctr_drbg_init(&tls_ctr_drbg); - - ret = mbedtls_ctr_drbg_seed(&tls_ctr_drbg, tls_entropy_func, NULL, - drbg_seed, sizeof(drbg_seed)); - if (ret != 0) { - mbedtls_ctr_drbg_free(&tls_ctr_drbg); - NET_ERR("TLS entropy source initialization failed"); - return -EFAULT; - } - #if defined(MBEDTLS_DEBUG_C) && (CONFIG_NET_SOCKETS_LOG_LEVEL >= LOG_LEVEL_DBG) mbedtls_debug_set_threshold(CONFIG_MBEDTLS_DEBUG_LEVEL); #endif @@ -947,8 +901,8 @@ static int tls_mbedtls_init(struct tls_context *context, bool is_server) /* Configure cookie for DTLS server */ if (role == MBEDTLS_SSL_IS_SERVER) { ret = mbedtls_ssl_cookie_setup(&context->cookie, - mbedtls_ctr_drbg_random, - &tls_ctr_drbg); + tls_ctr_drbg_random, + NULL); if (ret != 0) { return -ENOMEM; } @@ -984,8 +938,8 @@ static int tls_mbedtls_init(struct tls_context *context, bool is_server) } mbedtls_ssl_conf_rng(&context->config, - mbedtls_ctr_drbg_random, - &tls_ctr_drbg); + tls_ctr_drbg_random, + NULL); ret = tls_mbedtls_set_credentials(context); if (ret != 0) { diff --git a/subsys/pm/device.c b/subsys/pm/device.c index 324d5bcc862..34e66dbfd2e 100644 --- a/subsys/pm/device.c +++ b/subsys/pm/device.c @@ -70,7 +70,7 @@ static bool should_suspend(const struct device *dev, uint32_t state) } rc = pm_device_state_get(dev, ¤t_state); - if ((rc != -ENOTSUP) && (rc != 0)) { + if ((rc != -ENOSYS) && (rc != 0)) { LOG_DBG("Was not possible to get device %s state: %d", dev->name, rc); return true; @@ -105,7 +105,7 @@ static int _pm_devices(uint32_t state) * in the right state. */ rc = pm_device_state_set(dev, state, NULL, NULL); - if ((rc != -ENOTSUP) && (rc != 0)) { + if ((rc != -ENOSYS) && (rc != 0)) { LOG_DBG("%s did not enter %s state: %d", dev->name, pm_device_state_str(state), rc); diff --git a/subsys/tracing/Kconfig b/subsys/tracing/Kconfig index 06aacd4f424..88843c55c4e 100644 --- a/subsys/tracing/Kconfig +++ b/subsys/tracing/Kconfig @@ -45,6 +45,7 @@ config SEGGER_SYSTEMVIEW select RTT_CONSOLE select USE_SEGGER_RTT select THREAD_MONITOR + select SEGGER_RTT_CUSTOM_LOCKING config TRACING_CTF bool "Tracing via Common Trace Format support" diff --git a/tests/drivers/adc/adc_emul/testcase.yaml b/tests/drivers/adc/adc_emul/testcase.yaml index e1831776ba3..fbb0f376633 100644 --- a/tests/drivers/adc/adc_emul/testcase.yaml +++ b/tests/drivers/adc/adc_emul/testcase.yaml @@ -3,3 +3,4 @@ common: tests: drivers.adc.emul: depends_on: adc + platform_allow: native_posix diff --git a/tests/drivers/uart/uart_pm/CMakeLists.txt b/tests/drivers/uart/uart_pm/CMakeLists.txt new file mode 100644 index 00000000000..fbb79f0dcf3 --- /dev/null +++ b/tests/drivers/uart/uart_pm/CMakeLists.txt @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.13.1) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(uart_basic_api) + +target_sources(app PRIVATE + src/main.c + ) diff --git a/tests/drivers/uart/uart_pm/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/uart/uart_pm/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 00000000000..f9408f65f86 --- /dev/null +++ b/tests/drivers/uart/uart_pm/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/ { + chosen { + zephyr,console = &uart1; + }; +}; + +&uart1 { + current-speed = <115200>; + status = "okay"; + tx-pin = <6>; + rx-pin = <8>; + rts-pin = <0>; + cts-pin = <0>; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + tx-pin = <33>; + rx-pin = <34>; + rts-pin = <5>; + cts-pin = <7>; +}; diff --git a/tests/drivers/uart/uart_pm/nrf_no_rx_pin.overlay b/tests/drivers/uart/uart_pm/nrf_no_rx_pin.overlay new file mode 100644 index 00000000000..a414d98f623 --- /dev/null +++ b/tests/drivers/uart/uart_pm/nrf_no_rx_pin.overlay @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&uart0 { + /delete-property/rx-pin; +}; diff --git a/tests/drivers/uart/uart_pm/prj.conf b/tests/drivers/uart/uart_pm/prj.conf new file mode 100644 index 00000000000..81baa4cf552 --- /dev/null +++ b/tests/drivers/uart/uart_pm/prj.conf @@ -0,0 +1,5 @@ +CONFIG_ZTEST=y +CONFIG_SERIAL=y +CONFIG_NATIVE_UART_0_ON_STDINOUT=y +CONFIG_PM=y +CONFIG_PM_DEVICE=y diff --git a/tests/drivers/uart/uart_pm/src/main.c b/tests/drivers/uart/uart_pm/src/main.c new file mode 100644 index 00000000000..e2468cdde92 --- /dev/null +++ b/tests/drivers/uart/uart_pm/src/main.c @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +#if defined(CONFIG_BOARD_NRF52840DK_NRF52840) +#define LABEL uart0 +#endif + +#define UART_DEVICE_NAME DT_LABEL(DT_NODELABEL(LABEL)) +#define HAS_RX DT_NODE_HAS_PROP(DT_NODELABEL(LABEL), rx_pin) + +static const struct device *exp_dev; +static uint32_t exp_state; +static void *exp_arg; +static volatile int callback_cnt; + +static void polling_verify(const struct device *dev, bool is_async, bool active) +{ + char c; + char outs[] = "abc"; + int err; + + if (!HAS_RX || is_async) { + /* If no RX pin just run few poll outs to check that it does + * not hang. + */ + for (int i = 0; i < ARRAY_SIZE(outs); i++) { + uart_poll_out(dev, outs[i]); + } + + return; + } + + err = uart_poll_in(dev, &c); + zassert_equal(err, -1, NULL); + + for (int i = 0; i < ARRAY_SIZE(outs); i++) { + uart_poll_out(dev, outs[i]); + k_busy_wait(1000); + + if (active) { + err = uart_poll_in(dev, &c); + zassert_equal(err, 0, "Unexpected err: %d", err); + zassert_equal(c, outs[i], NULL); + } + + err = uart_poll_in(dev, &c); + zassert_equal(err, -1, NULL); + } +} + +static void async_callback(const struct device *dev, struct uart_event *evt, void *ctx) +{ + bool *done = ctx; + + switch (evt->type) { + case UART_TX_DONE: + *done = true; + break; + default: + break; + } +} + +static bool async_verify(const struct device *dev, bool active) +{ + char txbuf[] = "test"; + uint8_t rxbuf[32]; + volatile bool tx_done = false; + int err; + + err = uart_callback_set(dev, async_callback, (void *)&tx_done); + if (err == -ENOTSUP) { + return false; + } + + if (!active) { + return true; + } + + zassert_equal(err, 0, "Unexpected err: %d", err); + + if (HAS_RX) { + err = uart_rx_enable(dev, rxbuf, sizeof(rxbuf), 1); + zassert_equal(err, 0, "Unexpected err: %d", err); + } + + err = uart_tx(dev, txbuf, sizeof(txbuf), 10); + zassert_equal(err, 0, "Unexpected err: %d", err); + + k_busy_wait(10000); + + if (HAS_RX) { + err = uart_rx_disable(dev); + zassert_equal(err, 0, "Unexpected err: %d", err); + + k_busy_wait(10000); + + err = memcmp(txbuf, rxbuf, sizeof(txbuf)); + zassert_equal(err, 0, "Unexpected err: %d", err); + } + + zassert_true(tx_done, NULL); + + return true; +} + +static void communication_verify(const struct device *dev, bool active) +{ + bool is_async = async_verify(dev, active); + + polling_verify(dev, is_async, active); +} + +#define state_verify(dev, exp_state) do {\ + uint32_t power_state; \ + int err = pm_device_state_get(dev, &power_state); \ + zassert_equal(err, 0, "Unexpected err: %d", err); \ + zassert_equal(power_state, exp_state, NULL); \ +} while (0) + +static void pm_callback(const struct device *dev, + int status, uint32_t *state, void *arg) +{ + zassert_equal(dev, exp_dev, NULL); + zassert_equal(status, 0, NULL); + zassert_equal(*state, exp_state, NULL); + zassert_equal(arg, exp_arg, NULL); + callback_cnt++; +} + +static void state_set(const struct device *dev, uint32_t state, int exp_err, bool cb) +{ + int err; + uint32_t prev_state; + + err = pm_device_state_get(dev, &prev_state); + zassert_equal(err, 0, "Unexpected err: %d", err); + + if (cb) { + callback_cnt = 0; + exp_dev = dev; + exp_arg = &state; + exp_state = state; + + err = pm_device_state_set(dev, state, pm_callback, exp_arg); + zassert_equal(err, exp_err, "Unexpected err: %d", err); + zassert_equal(callback_cnt, 1, NULL); + } else { + err = pm_device_state_set(dev, state, NULL, NULL); + zassert_equal(err, exp_err, "Unexpected err: %d", err); + } + + uint32_t exp_state = err == 0 ? state : prev_state; + + state_verify(dev, exp_state); +} + +static void test_uart_pm_in_idle(void) +{ + const struct device *dev; + + dev = device_get_binding(UART_DEVICE_NAME); + zassert_true(dev != NULL, NULL); + + state_verify(dev, PM_DEVICE_STATE_ACTIVE); + communication_verify(dev, true); + + state_set(dev, PM_DEVICE_STATE_LOW_POWER, 0, false); + communication_verify(dev, false); + + state_set(dev, PM_DEVICE_STATE_ACTIVE, 0, false); + communication_verify(dev, true); + + state_set(dev, PM_DEVICE_STATE_LOW_POWER, 0, true); + communication_verify(dev, false); + + state_set(dev, PM_DEVICE_STATE_ACTIVE, 0, true); + communication_verify(dev, true); +} + +static void test_uart_pm_poll_tx(void) +{ + const struct device *dev; + + dev = device_get_binding(UART_DEVICE_NAME); + zassert_true(dev != NULL, NULL); + + communication_verify(dev, true); + + uart_poll_out(dev, 'a'); + state_set(dev, PM_DEVICE_STATE_LOW_POWER, 0, false); + + communication_verify(dev, false); + + state_set(dev, PM_DEVICE_STATE_ACTIVE, 0, false); + + communication_verify(dev, true); + + /* Now same thing but with callback */ + uart_poll_out(dev, 'a'); + state_set(dev, PM_DEVICE_STATE_LOW_POWER, 0, true); + + communication_verify(dev, false); + + state_set(dev, PM_DEVICE_STATE_ACTIVE, 0, true); + + communication_verify(dev, true); +} + +static void timeout(struct k_timer *timer) +{ + const struct device *uart = k_timer_user_data_get(timer); + + state_set(uart, PM_DEVICE_STATE_LOW_POWER, 0, false); +} + +static K_TIMER_DEFINE(pm_timer, timeout, NULL); + +/* Test going into low power state after interrupting poll out. Use various + * delays to test interruption at multiple places. + */ +static void test_uart_pm_poll_tx_interrupted(void) +{ + const struct device *dev; + char str[] = "test"; + + dev = device_get_binding(UART_DEVICE_NAME); + zassert_true(dev != NULL, NULL); + + k_timer_user_data_set(&pm_timer, (void *)dev); + + for (int i = 1; i < 100; i++) { + k_timer_start(&pm_timer, K_USEC(i * 10), K_NO_WAIT); + + for (int j = 0; j < sizeof(str); j++) { + uart_poll_out(dev, str[j]); + } + + k_timer_status_sync(&pm_timer); + + state_set(dev, PM_DEVICE_STATE_ACTIVE, 0, false); + + communication_verify(dev, true); + } +} + +void test_main(void) +{ + if (!HAS_RX) { + PRINT("No RX pin\n"); + } + + ztest_test_suite(uart_pm, + ztest_unit_test(test_uart_pm_in_idle), + ztest_unit_test(test_uart_pm_poll_tx), + ztest_unit_test(test_uart_pm_poll_tx_interrupted) + ); + ztest_run_test_suite(uart_pm); +} diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml new file mode 100644 index 00000000000..743f740cd09 --- /dev/null +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -0,0 +1,71 @@ +common: + harness: ztest + harness_config: + fixture: gpio_loopback +tests: + drivers.uart: + tags: drivers + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_UART_INTERRUPT_DRIVEN=n + - CONFIG_UART_ASYNC_API=n + - CONFIG_UART_0_ENHANCED_POLL_OUT=n + + drivers.uart_no_rxpin: + tags: drivers + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_UART_INTERRUPT_DRIVEN=n + - CONFIG_UART_ASYNC_API=n + - CONFIG_UART_0_ENHANCED_POLL_OUT=n + extra_args: DTC_OVERLAY_FILE="boards/nrf52840dk_nrf52840.overlay;nrf_no_rx_pin.overlay" + + drivers.uart_enhanced_poll: + tags: drivers + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_UART_INTERRUPT_DRIVEN=n + - CONFIG_UART_ASYNC_API=n + - CONFIG_UART_0_ENHANCED_POLL_OUT=y + + drivers.uart_int_driven: + tags: drivers + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_UART_INTERRUPT_DRIVEN=y + - CONFIG_UART_0_INTERRUPT_DRIVEN=y + - CONFIG_UART_ASYNC_API=n + - CONFIG_UART_0_ENHANCED_POLL_OUT=n + + drivers.uart_int_driven_enhanced_poll: + tags: drivers + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_UART_INTERRUPT_DRIVEN=y + - CONFIG_UART_0_INTERRUPT_DRIVEN=y + - CONFIG_UART_ASYNC_API=n + - CONFIG_UART_0_ENHANCED_POLL_OUT=y + + drivers.uart_async: + tags: drivers + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_UART_INTERRUPT_DRIVEN=n + - CONFIG_UART_ASYNC_API=y + - CONFIG_UART_0_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 + - CONFIG_NRFX_TIMER2=y + - CONFIG_UART_0_ENHANCED_POLL_OUT=n + + drivers.uart_async_enhanced_poll: + tags: drivers + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_UART_INTERRUPT_DRIVEN=n + - CONFIG_UART_ASYNC_API=y + - CONFIG_UART_0_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 + - CONFIG_NRFX_TIMER2=y + - CONFIG_UART_0_ENHANCED_POLL_OUT=y diff --git a/tests/kernel/interrupt/src/interrupt_offload.c b/tests/kernel/interrupt/src/interrupt_offload.c index d00a6167c5f..fe4d06ff403 100644 --- a/tests/kernel/interrupt/src/interrupt_offload.c +++ b/tests/kernel/interrupt/src/interrupt_offload.c @@ -17,7 +17,11 @@ static K_THREAD_STACK_DEFINE(wq_stack, STACK_SIZE); static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE); static struct k_thread tdata; +static struct k_sem sync_sem; static struct k_sem end_sem; +static bool wait_for_end; +static atomic_t submit_success; +static atomic_t offload_job_cnt; /* * This global variable control if the priority of offload job @@ -54,6 +58,7 @@ static void entry_offload_job(struct k_work *work) "the offload did not run immediately."); } + atomic_inc(&offload_job_cnt); k_sem_give(&end_sem); } @@ -61,16 +66,18 @@ static void entry_offload_job(struct k_work *work) void isr_handler(const void *param) { struct k_work *work = ((struct interrupt_param *)param)->work; - int ret; zassert_not_null(work, "kwork should not be NULL"); orig_t_keep_run = 0; - ret = k_work_submit_to_queue(&wq_queue, work); - zassert_true((ret == 0) || (ret == 1), - "kwork not sumbmitted or queued"); + /* If the work is busy, we don't sumbit it. */ + if (!k_work_busy_get(work)) { + zassert_equal(k_work_submit_to_queue(&wq_queue, work), + 1, "kwork not sumbmitted or queued"); + atomic_inc(&submit_success); + } } #if defined(CONFIG_DYNAMIC_INTERRUPTS) @@ -125,55 +132,66 @@ static void trigger_offload_interrupt(const bool real_irq, void *work) static void t_running(void *p1, void *p2, void *p3) { - while (1) { + k_sem_give(&sync_sem); + + while (wait_for_end == false) { orig_t_keep_run = 1; - k_usleep(1); + k_usleep(150); } } -static void run_test_offload(int case_type, int real_irq) +static void init_env(int real_irq) { static bool wq_already_start; - int thread_prio = 1; - - TC_PRINT("case %d\n", case_type); /* semaphore used to sync the end */ + k_sem_init(&sync_sem, 0, 1); k_sem_init(&end_sem, 0, NUM_WORK); - if (offload_job_prio_higher) { - /* priority of offload job higher than thread */ - thread_prio = 2; - } else { - /* priority of offload job lower than thread */ - thread_prio = 0; - } + /* initialize global variables */ + submit_success = 0; + offload_job_cnt = 0; + orig_t_keep_run = 0; + wait_for_end = false; + /* initialize the dynamic interrupt while using it */ if (real_irq && !vector_num) { init_dyn_interrupt(); } - k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, - (k_thread_entry_t)t_running, - NULL, NULL, NULL, - K_PRIO_PREEMPT(thread_prio), - K_INHERIT_PERMS, K_NO_WAIT); + /* initialize all the k_work */ + for (int i = 0; i < NUM_WORK; i++) { + k_work_init(&offload_work[i], entry_offload_job); + } /* start a work queue thread if not existing */ if (!wq_already_start) { k_work_queue_start(&wq_queue, wq_stack, STACK_SIZE, - 1, NULL); + K_PRIO_PREEMPT(1), NULL); wq_already_start = true; } +} - /* initialize all the k_work */ - for (int i = 0; i < NUM_WORK; i++) { - k_work_init(&offload_work[i], entry_offload_job); +static void run_test_offload(int case_type, int real_irq) +{ + int thread_prio = K_PRIO_PREEMPT(0); + + /* initialize the global variables */ + init_env(real_irq); + + /* set priority of offload job higher than thread */ + if (offload_job_prio_higher) { + thread_prio = K_PRIO_PREEMPT(2); } + k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, + (k_thread_entry_t)t_running, + NULL, NULL, NULL, thread_prio, + K_INHERIT_PERMS, K_NO_WAIT); + /* wait for thread start */ - k_usleep(10); + k_sem_take(&sync_sem, K_FOREVER); for (int i = 0; i < NUM_WORK; i++) { @@ -190,16 +208,18 @@ static void run_test_offload(int case_type, int real_irq) ztest_test_fail(); } } - /* wait for all offload job complete */ - k_sem_take(&end_sem, K_FOREVER); + for (int i = 0; i < atomic_get(&submit_success); i++) { + k_sem_take(&end_sem, K_FOREVER); + } - k_usleep(1); + zassert_equal(submit_success, offload_job_cnt, + "submitted job unmatch offload"); - zassert_equal(orig_t_keep_run, 1, - "offload job done, the original thread run"); + /* notify the running thread to end */ + wait_for_end = true; - k_thread_abort(tid); + k_thread_join(tid, K_FOREVER); } /** diff --git a/tests/subsys/logging/log_backend_fs/src/log_fs_test.c b/tests/subsys/logging/log_backend_fs/src/log_fs_test.c index 4b4ae1dc8f6..f9b20af7f02 100644 --- a/tests/subsys/logging/log_backend_fs/src/log_fs_test.c +++ b/tests/subsys/logging/log_backend_fs/src/log_fs_test.c @@ -219,9 +219,8 @@ static void test_log_fs_files_max(void) } if (strstr(ent.name, log_prefix) != NULL) { ++file_ctr; + test_mask |= 1 << atoi(&ent.name[strlen(log_prefix)]); } - - test_mask |= 1 << atoi(&ent.name[strlen(log_prefix)]); } (void)fs_closedir(&dir); zassert_equal(file_ctr, CONFIG_LOG_BACKEND_FS_FILES_LIMIT, diff --git a/west.yml b/west.yml index eb87f6041a5..110d4f75fd9 100644 --- a/west.yml +++ b/west.yml @@ -112,7 +112,7 @@ manifest: revision: cdb9570901e87ab247aed0a96ccd8f94beee5834 path: modules/lib/openthread - name: segger - revision: 2aa031c081426dcd0626185af45c40bd05811b68 + revision: 7cbc8446db9e09ed0ca4e60e48f38e2c330223fe path: modules/debug/segger - name: sof revision: 52dc9c5ad8d0d2a5df0bb51ea30e54f8d7890639 @@ -134,7 +134,7 @@ manifest: revision: a47e326ca772ddd14cc3b9d4ca30a9ab44ecca16 - name: TraceRecorderSource path: modules/debug/TraceRecorder - revision: 41daf89c15ff841ed63fa882a916ec97089141ce + revision: d9889883abb4657d71e15ff055517a9b032f8212 - name: hal_xtensa revision: 2f04b615cd5ad3a1b8abef33f9bdd10cc1990ed6 path: modules/hal/xtensa