diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index f88d848a9..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,44 +0,0 @@ -# YAML schema for GitHub Actions: -# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions -# -# Helpful YAML parser to clarify YAML syntax: -# https://yaml-online-parser.appspot.com/ -# -# This workflow uses actions that are not certified by GitHub. They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support documentation. -# -# This file contains the workflows that are run prior to merging a pull request. - -name: Documentation - -on: - push: - branches: - - 'develop' - pull_request: - branches: - - 'develop' - - # Allow manually triggering of the workflow. - workflow_dispatch: {} - -env: - DOC_BUILDER_IMAGE: 'ghcr.io/xmos/doc_builder:v3.0.0' - -jobs: - build_documentation: - name: Build and package documentation - runs-on: ubuntu-latest - steps: - - name: Checkout SDK - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Pull documentation builder docker image - run: | - docker pull ${DOC_BUILDER_IMAGE} - - - name: Build documentation - run: | - docker run --rm -t -u "$(id -u):$(id -g)" -v ${{ github.workspace }}:/build -e PDF=1 -e REPO:/build -e EXCLUDE_PATTERNS=/build/doc/exclude_patterns.inc -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e DOXYGEN_INPUT=ignore ${DOC_BUILDER_IMAGE} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2cef585d6..443b075e0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,15 @@ RTOS Framework change log ========================= +3.0.5 +----- + + * FIXED: Added dummy definitions of vTaskCoreAffinitySet() and vTaskCoreAffinitySet() functions to + avoid warnings when configNUM_CORES is set to 1. + * UPDATED: Tested against fwk_io v3.3.0 updated from v3.0.1 + * UPDATED: Tested against fwk_core v1.0.2 updated from v1.0.0 + * ADDED: Runtime check for I2S RPC functions called for I2S Slave + 3.0.4 ----- diff --git a/Jenkinsfile b/Jenkinsfile index 2a96c2f88..30703aa00 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,9 @@ -@Library('xmos_jenkins_shared_library@v0.20.0') _ +@Library('xmos_jenkins_shared_library@v0.27.0') _ getApproval() pipeline { - agent { - label 'xcore.ai-explorer-us' - } + agent none options { disableConcurrentBuilds() skipDefaultCheckout() @@ -32,117 +30,151 @@ pipeline { LOCAL_WIFI_PASS = credentials('hampton-office-network-wifi-password') } stages { - stage('Checkout') { - steps { - checkout scm - sh 'git submodule update --init --recursive --depth 1 --jobs \$(nproc)' - } - } - stage('Build tests and host apps') { - steps { - script { - uid = sh(returnStdout: true, script: 'id -u').trim() - gid = sh(returnStdout: true, script: 'id -g').trim() - } - // pull docker - sh "docker pull ghcr.io/xmos/xcore_voice_tester:develop" - withTools(params.TOOLS_VERSION) { - sh "bash tools/ci/build_rtos_tests.sh" - sh "bash tools/ci/build_host_apps.sh" - } - // List built files for log - sh "ls -la dist/" - sh "ls -la dist_host/" - } - } - stage('Create virtual environment') { - steps { - // Create venv - sh "pyenv install -s $PYTHON_VERSION" - sh "~/.pyenv/versions/$PYTHON_VERSION/bin/python -m venv $VENV_DIRNAME" - // Install dependencies - withVenv() { - sh "pip install git+https://github0.xmos.com/xmos-int/xtagctl.git" - sh "pip install -r test/requirements.txt" - } - } - } - stage('Cleanup xtagctl') { - steps { - // Cleanup any xtagctl cruft from previous failed runs - withTools(params.TOOLS_VERSION) { - withVenv { - sh "xtagctl reset_all $RTOS_TEST_RIG_TARGET" + stage('Build and Docs') { + parallel { + stage('Build Docs') { + agent { label "docker" } + environment { XMOSDOC_VERSION = "v4.0" } + steps { + checkout scm + sh 'git submodule update --init --recursive --depth 1' + sh "docker pull ghcr.io/xmos/xmosdoc:$XMOSDOC_VERSION" + sh """docker run -u "\$(id -u):\$(id -g)" \ + --rm \ + -v ${WORKSPACE}:/build \ + ghcr.io/xmos/xmosdoc:$XMOSDOC_VERSION -v""" + archiveArtifacts artifacts: "doc/_build/**", allowEmptyArchive: true } - } - sh "rm -f ~/.xtag/status.lock ~/.xtag/acquired" - } - } - stage('Run RTOS Drivers WiFi test') { - steps { - withTools(params.TOOLS_VERSION) { - withVenv { - script { - withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> - sh "test/rtos_drivers/wifi/check_wifi.sh " + adapterIDs[0] - } - sh "pytest test/rtos_drivers/wifi" + post { + cleanup { + xcoreCleanSandbox() } } } - } - } - stage('Run RTOS Drivers HIL test') { - steps { - withTools(params.TOOLS_VERSION) { - withVenv { - script { - withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> - sh "test/rtos_drivers/hil/check_drivers_hil.sh " + adapterIDs[0] + + stage('Build and Test') { + when { + expression { !env.GH_LABEL_DOC_ONLY.toBoolean() } + } + agent { + label 'xcore.ai-explorer-us' + } + stages { + stage('Checkout') { + steps { + checkout scm + sh 'git submodule update --init --recursive --depth 1 --jobs \$(nproc)' } - sh "pytest test/rtos_drivers/hil" } - } - } - } - } - stage('Run RTOS Drivers HIL_Add test') { - steps { - withTools(params.TOOLS_VERSION) { - withVenv { - script { - withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> - sh "test/rtos_drivers/hil_add/check_drivers_hil_add.sh " + adapterIDs[0] + stage('Build tests and host apps') { + steps { + script { + uid = sh(returnStdout: true, script: 'id -u').trim() + gid = sh(returnStdout: true, script: 'id -g').trim() + } + // pull docker + sh "docker pull ghcr.io/xmos/xcore_voice_tester:develop" + withTools(params.TOOLS_VERSION) { + sh "bash tools/ci/build_rtos_tests.sh" + sh "bash tools/ci/build_host_apps.sh" + } + // List built files for log + sh "ls -la dist/" + sh "ls -la dist_host/" } - sh "pytest test/rtos_drivers/hil_add" } - } - } - } - } - stage('Run RTOS Drivers USB test') { - steps { - withTools(params.TOOLS_VERSION) { - withVenv { - script { - uid = sh(returnStdout: true, script: 'id -u').trim() - gid = sh(returnStdout: true, script: 'id -g').trim() - withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> - sh "docker run --rm -u $uid:$gid --privileged -v /dev:/dev -w /fwk_rtos -v $WORKSPACE:/fwk_rtos ghcr.io/xmos/xcore_voice_tester:develop bash -l test/rtos_drivers/usb/check_usb.sh " + adapterIDs[0] + stage('Create virtual environment') { + steps { + // Create venv + sh "pyenv install -s $PYTHON_VERSION" + sh "~/.pyenv/versions/$PYTHON_VERSION/bin/python -m venv $VENV_DIRNAME" + // Install dependencies + withVenv() { + sh "pip install git+https://github0.xmos.com/xmos-int/xtagctl.git" + sh "pip install -r test/requirements.txt" + } + } + } + stage('Cleanup xtagctl') { + steps { + // Cleanup any xtagctl cruft from previous failed runs + withTools(params.TOOLS_VERSION) { + withVenv { + sh "xtagctl reset_all $RTOS_TEST_RIG_TARGET" + } + } + sh "rm -f ~/.xtag/status.lock ~/.xtag/acquired" + } + } + stage('Run RTOS Drivers WiFi test') { + steps { + withTools(params.TOOLS_VERSION) { + withVenv { + script { + withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> + sh "test/rtos_drivers/wifi/check_wifi.sh " + adapterIDs[0] + } + sh "pytest test/rtos_drivers/wifi" + } + } + } } - sh "pytest test/rtos_drivers/usb" + } + stage('Run RTOS Drivers HIL test') { + steps { + withTools(params.TOOLS_VERSION) { + withVenv { + script { + withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> + sh "test/rtos_drivers/hil/check_drivers_hil.sh " + adapterIDs[0] + } + sh "pytest test/rtos_drivers/hil" + } + } + } + } + } + stage('Run RTOS Drivers HIL_Add test') { + steps { + withTools(params.TOOLS_VERSION) { + withVenv { + script { + withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> + sh "test/rtos_drivers/hil_add/check_drivers_hil_add.sh " + adapterIDs[0] + } + sh "pytest test/rtos_drivers/hil_add" + } + } + } + } + } + stage('Run RTOS Drivers USB test') { + steps { + withTools(params.TOOLS_VERSION) { + withVenv { + script { + uid = sh(returnStdout: true, script: 'id -u').trim() + gid = sh(returnStdout: true, script: 'id -g').trim() + withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> + sh "docker run --rm -u $uid:$gid --privileged -v /dev:/dev -w /fwk_rtos -v $WORKSPACE:/fwk_rtos ghcr.io/xmos/xcore_voice_tester:develop bash -l test/rtos_drivers/usb/check_usb.sh " + adapterIDs[0] + } + sh "pytest test/rtos_drivers/usb" + } + } + } + } + } + } + post { + cleanup { + // cleanWs removes all output and artifacts of the Jenkins pipeline + // Comment out this post section to leave the workspace which can be useful for running items on the Jenkins agent. + // However, beware that this pipeline will not run if the workspace is not manually cleaned. + xcoreCleanSandbox() } } } } } } - post { - cleanup { - // cleanWs removes all output and artifacts of the Jenkins pipeline - // Comment out this post section to leave the workspace which can be useful for running items on the Jenkins agent. - // However, beware that this pipeline will not run if the workspace is not manually cleaned. - cleanWs() - } - } } diff --git a/README.md b/README.md index 192258023..2183a09ff 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Supported RTOS stacks and software services include: - TinyUSB - Generic processing pipeline - Inferencing -- Device control +- Device control - FatFS - HTTP - TLS @@ -55,15 +55,17 @@ Some dependent components are included as git submodules. These can be obtained ## Testing -Several tests for the RTOS framework modules exist in the [test folder](https://github.com/xmos/fwk_rtos/tree/develop/test). +Several tests for the RTOS framework modules exist in the [test folder](https://github.com/xmos/fwk_rtos/tree/develop/test). ## Documentation -Information on building the documentation can be found in the docs [README](https://github.com/xmos/fwk_rtos/blob/develop/doc/README.rst). +This folder contains source files for the documentation and is intended for XMOS users. Pre-built documentation is published on https://www.xmos.com. + +The sources do not render well in GitHub or an RST viewer. ## License This Software is subject to the terms of the [XMOS Public Licence: Version 1](https://github.com/xmos/fwk_rtos/blob/develop/LICENSE.rst) -Third party copyrighted code is specified in the fwk_rtos [Copyrights and Licenses](https://github.com/xmos/fwk_rtos/blob/develop/doc/copyright.rst). +Third party copyrighted code is specified in the fwk_rtos [Copyrights and Licenses](https://github.com/xmos/fwk_rtos/blob/develop/doc/copyright.rst). diff --git a/doc/README.rst b/doc/README.rst index 5a431d398..8c9fe66a7 100644 --- a/doc/README.rst +++ b/doc/README.rst @@ -2,6 +2,9 @@ Documentation Source #################### +This folder contains source files for the documentation. The sources do not render well in GitHub or an RST viewer. +In addition, some information is not visible at all and some links will not be functional. + ********************** Building Documentation ********************** @@ -10,13 +13,7 @@ Building Documentation Prerequisites ============= -Install `Docker `_. - -Pull the docker container: - -.. code-block:: console - - $ docker pull ghcr.io/xmos/doc_builder:latest +Use the `xmosdoc tool `_ either via docker or install it into a pip environment. ======== Building @@ -26,4 +23,41 @@ To build the documentation, run the following command in the root of the reposit .. code-block:: console - $ docker run --rm -t -u "$(id -u):$(id -g)" -v $(pwd):/build -e PDF=1 -e REPO:/build -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e EXCLUDE_PATTERNS=/build/doc/exclude_patterns.inc -e DOXYGEN_INPUT=ignore ghcr.io/xmos/doc_builder:latest + # via pip package + xmosdoc clean html latex + # via docker + $ docker run --rm -t -u "$(id -u):$(id -g)" -v $(pwd):/build ghcr.io/xmos/xmosdoc clean html latex + +HTML document output is saved in the ``doc/_build/html`` folder. Open ``index.html`` to preview the saved documentation. + +Please refer to the ``xmosdoc`` documentation for a complete guide on how to use the tool. + +********************** +Adding a New Component +********************** + +Follow the following steps to add a new component. + +- Add an entry for the new component's top-level document to the appropriate TOC in the documents tree. +- If the new component uses `Doxygen`, append the appropriate path(s) to the INPUT variable in `Doxyfile.inc`. +- If the new component includes `.rst` files that should **not** be part of the documentation build, append the appropriate pattern(s) to `exclude_patterns.inc`. + +*** +FAQ +*** + +Q: Is it possible to build just a subset of the documentation? + +A: Yes, however it is not recommended at this time. + +Q: Is it possible to used the ``livehtml`` feature of Sphinx? + +A: Yes, run xmosdoc with the ``--auto`` option. + +Q: Where can I learn more about the XMOS ``xmosdoc`` tools? + +A: See the https://github.com/xmos/xmosdoc repository. See the ``xmosdoc`` repository README for details on additional build options. + +Q: How do I suggest enhancements to the XMOS ``xmosdoc`` tool? + +A: Create a new issue here: https://github.com/xmos/xmosdoc/issues diff --git a/doc/build_system_guide/introduction.rst b/doc/build_system_guide/introduction.rst index eeeeaa921..29c9c7433 100644 --- a/doc/build_system_guide/introduction.rst +++ b/doc/build_system_guide/introduction.rst @@ -1,4 +1,3 @@ -.. include:: ../substitutions.rst .. _build_system_guide: diff --git a/doc/build_system_guide/targets.rst b/doc/build_system_guide/targets.rst index acbba1c9d..0b42db0bd 100644 --- a/doc/build_system_guide/targets.rst +++ b/doc/build_system_guide/targets.rst @@ -1,4 +1,3 @@ -.. include:: ../substitutions.rst .. _build_system_targets: diff --git a/doc/exclude_patterns.inc b/doc/exclude_patterns.inc index 3c17de6ce..27cc18955 100644 --- a/doc/exclude_patterns.inc +++ b/doc/exclude_patterns.inc @@ -1,10 +1,13 @@ # The following patterns are to be excluded from the documentation build -documents/README.rst tools projects test xmos_cmake_toolchain +modules/drivers modules/FreeRTOS modules/sw_services build build_* +CHANGELOG.rst +LICENSE.rst +**README* \ No newline at end of file diff --git a/doc/programming_guide/common_issues.rst b/doc/programming_guide/common_issues.rst index 1b8ed1df8..2d2a1b6bb 100644 --- a/doc/programming_guide/common_issues.rst +++ b/doc/programming_guide/common_issues.rst @@ -1,4 +1,3 @@ -.. include:: ../substitutions.rst ############# Common Issues diff --git a/doc/programming_guide/faq.rst b/doc/programming_guide/faq.rst index cc54426ee..13875f13b 100644 --- a/doc/programming_guide/faq.rst +++ b/doc/programming_guide/faq.rst @@ -1,4 +1,3 @@ -.. include:: ../substitutions.rst #### FAQs diff --git a/doc/programming_guide/platform.rst b/doc/programming_guide/platform.rst index a28ba5bba..9a42d8128 100644 --- a/doc/programming_guide/platform.rst +++ b/doc/programming_guide/platform.rst @@ -27,4 +27,4 @@ The `Programming Guide `_. As well as providing a powerful toolchain for application development, the toolkit assists with application deployment and upgrade. +The xcore processors are accompanied by the `XTC Tools `__. As well as providing a powerful toolchain for application development, the toolkit assists with application deployment and upgrade. diff --git a/doc/programming_guide/reference/api.rst b/doc/programming_guide/reference/api.rst index f14fd6789..8b60ac6ae 100644 --- a/doc/programming_guide/reference/api.rst +++ b/doc/programming_guide/reference/api.rst @@ -1,4 +1,3 @@ -.. include:: ../../substitutions.rst ############# API Reference diff --git a/doc/programming_guide/reference/rtos_drivers/i2c/i2c.rst b/doc/programming_guide/reference/rtos_drivers/i2c/i2c.rst index f04a3766a..2e576a838 100644 --- a/doc/programming_guide/reference/rtos_drivers/i2c/i2c.rst +++ b/doc/programming_guide/reference/rtos_drivers/i2c/i2c.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ################# |I2C| RTOS Driver diff --git a/doc/programming_guide/reference/rtos_drivers/i2c/i2c_master.rst b/doc/programming_guide/reference/rtos_drivers/i2c/i2c_master.rst index d0de76a40..f1b2dede3 100644 --- a/doc/programming_guide/reference/rtos_drivers/i2c/i2c_master.rst +++ b/doc/programming_guide/reference/rtos_drivers/i2c/i2c_master.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ######################## |I2C| Master RTOS Driver diff --git a/doc/programming_guide/reference/rtos_drivers/i2c/i2c_slave.rst b/doc/programming_guide/reference/rtos_drivers/i2c/i2c_slave.rst index 15a135002..22988b636 100644 --- a/doc/programming_guide/reference/rtos_drivers/i2c/i2c_slave.rst +++ b/doc/programming_guide/reference/rtos_drivers/i2c/i2c_slave.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ####################### |I2C| Slave RTOS Driver diff --git a/doc/programming_guide/reference/rtos_drivers/i2s/i2s.rst b/doc/programming_guide/reference/rtos_drivers/i2s/i2s.rst index b804b0a1c..bc43ed619 100644 --- a/doc/programming_guide/reference/rtos_drivers/i2s/i2s.rst +++ b/doc/programming_guide/reference/rtos_drivers/i2s/i2s.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ################# |I2S| RTOS Driver diff --git a/doc/programming_guide/reference/rtos_drivers/i2s/i2s_master.rst b/doc/programming_guide/reference/rtos_drivers/i2s/i2s_master.rst index 2d3e354be..9039db15f 100644 --- a/doc/programming_guide/reference/rtos_drivers/i2s/i2s_master.rst +++ b/doc/programming_guide/reference/rtos_drivers/i2s/i2s_master.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ******************************* |I2S| Master Initialization API diff --git a/doc/programming_guide/reference/rtos_drivers/i2s/i2s_slave.rst b/doc/programming_guide/reference/rtos_drivers/i2s/i2s_slave.rst index de0ce3dc6..a3523595d 100644 --- a/doc/programming_guide/reference/rtos_drivers/i2s/i2s_slave.rst +++ b/doc/programming_guide/reference/rtos_drivers/i2s/i2s_slave.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ****************************** |I2S| Slave Initialization API diff --git a/doc/programming_guide/reference/rtos_drivers/trace.rst b/doc/programming_guide/reference/rtos_drivers/trace.rst index e46036a5c..5384b08a6 100644 --- a/doc/programming_guide/reference/rtos_drivers/trace.rst +++ b/doc/programming_guide/reference/rtos_drivers/trace.rst @@ -105,7 +105,7 @@ by the Tracealyzer graphical tool either as a post processing step or live. `Recording Settings`. For general usage of Tracealyzer please refer to the Percepio's documentation here: -`Manual `_ +`Manual `_ ********** ASCII Mode diff --git a/doc/programming_guide/reference/rtos_drivers/uart/uart.rst b/doc/programming_guide/reference/rtos_drivers/uart/uart.rst index 0460d260b..22e5c0b59 100644 --- a/doc/programming_guide/reference/rtos_drivers/uart/uart.rst +++ b/doc/programming_guide/reference/rtos_drivers/uart/uart.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ################ UART RTOS Driver diff --git a/doc/programming_guide/reference/rtos_drivers/uart/uart_rx.rst b/doc/programming_guide/reference/rtos_drivers/uart/uart_rx.rst index bb2e447da..5370ba88e 100644 --- a/doc/programming_guide/reference/rtos_drivers/uart/uart_rx.rst +++ b/doc/programming_guide/reference/rtos_drivers/uart/uart_rx.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ################### UART Rx RTOS Driver diff --git a/doc/programming_guide/reference/rtos_drivers/uart/uart_tx.rst b/doc/programming_guide/reference/rtos_drivers/uart/uart_tx.rst index 686c6bf87..e5dc8f4f7 100644 --- a/doc/programming_guide/reference/rtos_drivers/uart/uart_tx.rst +++ b/doc/programming_guide/reference/rtos_drivers/uart/uart_tx.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ################### UART Tx RTOS Driver diff --git a/doc/programming_guide/reference/rtos_services/device_control/device_control_host_api.rst b/doc/programming_guide/reference/rtos_services/device_control/device_control_host_api.rst index 382f8f237..35afff91d 100644 --- a/doc/programming_guide/reference/rtos_services/device_control/device_control_host_api.rst +++ b/doc/programming_guide/reference/rtos_services/device_control/device_control_host_api.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ####################### Device Control Host API diff --git a/doc/programming_guide/reference/rtos_services/device_control/device_control_protocol.rst b/doc/programming_guide/reference/rtos_services/device_control/device_control_protocol.rst index 7e31c2f31..8ced2943a 100644 --- a/doc/programming_guide/reference/rtos_services/device_control/device_control_protocol.rst +++ b/doc/programming_guide/reference/rtos_services/device_control/device_control_protocol.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ########################## Command Transport Protocol diff --git a/doc/programming_guide/reference/rtos_services/device_control/device_control_shared.rst b/doc/programming_guide/reference/rtos_services/device_control/device_control_shared.rst index 8a070f63a..e4e237d0d 100644 --- a/doc/programming_guide/reference/rtos_services/device_control/device_control_shared.rst +++ b/doc/programming_guide/reference/rtos_services/device_control/device_control_shared.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ######################### Device Control Shared API diff --git a/doc/programming_guide/reference/rtos_services/device_control/device_control_xcore.rst b/doc/programming_guide/reference/rtos_services/device_control/device_control_xcore.rst index f21306d6f..8014e5608 100644 --- a/doc/programming_guide/reference/rtos_services/device_control/device_control_xcore.rst +++ b/doc/programming_guide/reference/rtos_services/device_control/device_control_xcore.rst @@ -1,4 +1,3 @@ -.. include:: ../../../../substitutions.rst ######################## Device Control XCORE API diff --git a/doc/programming_guide/tutorials/application_design.rst b/doc/programming_guide/tutorials/application_design.rst index 145cefc62..d0ca87049 100644 --- a/doc/programming_guide/tutorials/application_design.rst +++ b/doc/programming_guide/tutorials/application_design.rst @@ -1,4 +1,3 @@ -.. include:: ../../substitutions.rst ####################### RTOS Application Design diff --git a/doc/programming_guide/tutorials/application_dfu_usage.rst b/doc/programming_guide/tutorials/application_dfu_usage.rst index 06a13cc60..2919acade 100644 --- a/doc/programming_guide/tutorials/application_dfu_usage.rst +++ b/doc/programming_guide/tutorials/application_dfu_usage.rst @@ -1,4 +1,3 @@ -.. include:: ../../substitutions.rst #################### RTOS Application DFU diff --git a/doc/programming_guide/tutorials/application_programming.rst b/doc/programming_guide/tutorials/application_programming.rst index 05df07944..b4f71defd 100644 --- a/doc/programming_guide/tutorials/application_programming.rst +++ b/doc/programming_guide/tutorials/application_programming.rst @@ -1,4 +1,3 @@ -.. include:: ../../substitutions.rst ################################ FreeRTOS Application Programming diff --git a/doc/programming_guide/tutorials/bsp_config.rst b/doc/programming_guide/tutorials/bsp_config.rst index 7e0834364..92467094a 100644 --- a/doc/programming_guide/tutorials/bsp_config.rst +++ b/doc/programming_guide/tutorials/bsp_config.rst @@ -1,4 +1,3 @@ -.. include:: ../../substitutions.rst ############################ Board Support Configurations diff --git a/doc/programming_guide/tutorials/tutorials.rst b/doc/programming_guide/tutorials/tutorials.rst index d95bd6ce9..b57216660 100644 --- a/doc/programming_guide/tutorials/tutorials.rst +++ b/doc/programming_guide/tutorials/tutorials.rst @@ -6,5 +6,6 @@ Tutorials :maxdepth: 2 application_programming + application_design bsp_config application_dfu_usage diff --git a/doc/shared/legal.rst b/doc/shared/legal.rst index 5e374ae55..b0b45b002 100644 --- a/doc/shared/legal.rst +++ b/doc/shared/legal.rst @@ -1,6 +1,16 @@ .. _fwk_rtos_copyright: -.. include:: ../_templates/disclaimer.rst +.. only:: html + + Copyright & Disclaimer + ====================== + + |XMOS copyright| + + |XMOS disclaimer| + + |XMOS trademarks| + Licenses ======== diff --git a/doc/src_html/.gitkeep b/doc/src_html/.gitkeep deleted file mode 100644 index bfd5b701d..000000000 --- a/doc/src_html/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# This directory needs to exist for the doc builder \ No newline at end of file diff --git a/doc/substitutions.rst b/doc/substitutions.rst deleted file mode 100644 index a06ed94e8..000000000 --- a/doc/substitutions.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. |I2C| replace:: I\ :sup:`2`\ C -.. |I2S| replace:: I\ :sup:`2`\ S diff --git a/modules/drivers/i2c/src/rtos_i2c_master_rpc.c b/modules/drivers/i2c/src/rtos_i2c_master_rpc.c index 3e7844ee0..29107ba4a 100644 --- a/modules/drivers/i2c/src/rtos_i2c_master_rpc.c +++ b/modules/drivers/i2c/src/rtos_i2c_master_rpc.c @@ -38,9 +38,20 @@ static i2c_res_t i2c_master_remote_write( RPC_PARAM_LIST_END }; - rpc_client_call_generic( - host_address->intertile_ctx, host_address->port, fcode_write, rpc_param_desc, - &host_ctx_ptr, &device_addr, buf, &n, num_bytes_sent, &send_stop_bit, &ret); + if(num_bytes_sent != NULL) + { + rpc_client_call_generic( + host_address->intertile_ctx, host_address->port, fcode_write, rpc_param_desc, + &host_ctx_ptr, &device_addr, buf, &n, num_bytes_sent, &send_stop_bit, &ret); + } + else + { + size_t tmp; + rpc_client_call_generic( + host_address->intertile_ctx, host_address->port, fcode_write, rpc_param_desc, + &host_ctx_ptr, &device_addr, buf, &n, &tmp, &send_stop_bit, &ret); + + } return ret; } diff --git a/modules/drivers/i2s/api/rtos_i2s.h b/modules/drivers/i2s/api/rtos_i2s.h index 18d2d31d3..9c25247e2 100644 --- a/modules/drivers/i2s/api/rtos_i2s.h +++ b/modules/drivers/i2s/api/rtos_i2s.h @@ -10,7 +10,7 @@ * The public API for using the RTOS I2S driver. * @{ */ - +#include #include #include #include "i2s.h" @@ -148,6 +148,7 @@ struct rtos_i2s_struct{ volatile size_t required_available_count; } recv_buffer; uint8_t isr_cmd; + bool is_slave; }; #include "rtos_i2s_rpc.h" diff --git a/modules/drivers/i2s/src/rtos_i2s.c b/modules/drivers/i2s/src/rtos_i2s.c index 852e808e5..c09fccbc3 100644 --- a/modules/drivers/i2s/src/rtos_i2s.c +++ b/modules/drivers/i2s/src/rtos_i2s.c @@ -397,6 +397,7 @@ static void rtos_i2s_init( ctx->rpc_config = NULL; ctx->rx = i2s_local_rx; ctx->tx = i2s_local_tx; + ctx->is_slave = false; triggerable_setup_interrupt_callback(ctx->c_i2s_isr.end_b, ctx, RTOS_INTERRUPT_CALLBACK(rtos_i2s_isr)); @@ -490,4 +491,6 @@ void rtos_i2s_slave_init( bclk, (rtos_osal_entry_function_t) i2s_slave_thread, RTOS_THREAD_STACK_SIZE(i2s_slave_thread)); + + i2s_ctx->is_slave = true; } diff --git a/modules/drivers/i2s/src/rtos_i2s_rpc.c b/modules/drivers/i2s/src/rtos_i2s_rpc.c index d7176b7f0..48b115060 100644 --- a/modules/drivers/i2s/src/rtos_i2s_rpc.c +++ b/modules/drivers/i2s/src/rtos_i2s_rpc.c @@ -231,6 +231,8 @@ void rtos_i2s_rpc_host_init( rtos_intertile_t *client_intertile_ctx[], size_t remote_client_count) { + xassert(i2s_ctx->is_slave == false); + i2s_ctx->rpc_config = rpc_config; rpc_config->rpc_host_start = i2s_rpc_start; rpc_config->remote_client_count = remote_client_count; diff --git a/modules/osal/FreeRTOS/rtos_osal_thread_port.c b/modules/osal/FreeRTOS/rtos_osal_thread_port.c index ac171c2c7..d83f37975 100644 --- a/modules/osal/FreeRTOS/rtos_osal_thread_port.c +++ b/modules/osal/FreeRTOS/rtos_osal_thread_port.c @@ -1,4 +1,4 @@ -// Copyright 2021-2022 XMOS LIMITED. +// Copyright 2021-2023 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. /** @@ -7,6 +7,23 @@ #include "rtos_osal.h" +// The functions below are declared in the third-party file: +// ./modules/fwk_xvf/modules/rtos/modules/FreeRTOS/FreeRTOS-SMP-Kernel/include/task.h +#if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUM_CORES == 1 ) + + void vTaskCoreAffinitySet( const TaskHandle_t xTask, + UBaseType_t uxCoreAffinityMask ) + { + (void) (xTask); + (void) (uxCoreAffinityMask); + } + UBaseType_t vTaskCoreAffinityGet( const TaskHandle_t xTask ) + { + (void) xTask; + return 0; + } +#endif /* configUSE_CORE_AFFINITY and configNUM_CORES */ + int rtos_osal_critical_enter(void) { int state; diff --git a/modules/sw_services/usb/portable/dcd_xcore.c b/modules/sw_services/usb/portable/dcd_xcore.c index 88c6b5db2..ab46bbac4 100644 --- a/modules/sw_services/usb/portable/dcd_xcore.c +++ b/modules/sw_services/usb/portable/dcd_xcore.c @@ -1,4 +1,4 @@ -// Copyright 2021-2022 XMOS LIMITED. +// Copyright 2021-2023 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #define DEBUG_UNIT TUSB_DCD @@ -42,7 +42,7 @@ #define CFG_TUD_XCORE_IO_CORE_MASK (~(1 << 0)) #endif -TU_ATTR_WEAK bool tud_xcore_sof_cb(uint8_t rhport); +TU_ATTR_WEAK bool tud_xcore_sof_cb(uint8_t rhport, uint32_t cur_time); TU_ATTR_WEAK bool tud_xcore_data_cb(uint32_t cur_time, uint32_t ep_num, uint32_t ep_dir, size_t xfer_len); #include "rtos_usb.h" @@ -210,7 +210,7 @@ static void dcd_xcore_int_handler(rtos_usb_t *ctx, break; case rtos_usb_sof_packet: if (tud_xcore_sof_cb) { - if (tud_xcore_sof_cb(0)) { + if (tud_xcore_sof_cb(0, cur_time)) { dcd_event_bus_signal(0, DCD_EVENT_SOF, true); } } diff --git a/settings.json b/settings.json deleted file mode 100644 index 3d41ac22e..000000000 --- a/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "title": "XCORE RTOS Framework", - "project": "fwk_rtos", - "version": "3.0.4" -} diff --git a/settings.yml b/settings.yml new file mode 100644 index 000000000..97225df84 --- /dev/null +++ b/settings.yml @@ -0,0 +1,17 @@ +--- +project: fwk_rtos +title: XCORE RTOS Framework +version: 3.0.5 + +documentation: + exclude_patterns_path: doc/exclude_patterns.inc + doxygen_projects: + fwk_rtos: + doxyfile_path: doc/Doxyfile.inc + pdfs: + doc/programming_guide/index: + pdf_title: "{{title}} - Programming Guide" + pdf_filename: "{{project}}_programming_guide_v{{version}}" + doc/build_system_guide/index: + pdf_title: "{{title}} - Build System Guide" + pdf_filename: "{{project}}_build_system_guide_v{{version}}" diff --git a/test/rtos_drivers/hil/src/individual_tests/i2c/rpc/master_write_multiple_test.c b/test/rtos_drivers/hil/src/individual_tests/i2c/rpc/master_write_multiple_test.c index 5cc5b54e6..1a2aa2553 100644 --- a/test/rtos_drivers/hil/src/individual_tests/i2c/rpc/master_write_multiple_test.c +++ b/test/rtos_drivers/hil/src/individual_tests/i2c/rpc/master_write_multiple_test.c @@ -25,11 +25,11 @@ static const char* test_name = "rpc_master_write_multiple_test"; #if ON_TILE(I2C_MASTER_TILE) || ON_TILE(I2C_SLAVE_TILE) #define I2C_MASTER_WRITE_MULTIPLE_TEST_ITER 2 -#define I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE 4 +#define I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE 5 static uint8_t test_vector[I2C_MASTER_WRITE_MULTIPLE_TEST_ITER][I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE] = { - {0x00, 0xFF, 0xAA, 0x55}, - {0xDE, 0xAD, 0xBE, 0xEF}, + {0x00, 0x23, 0xFF, 0xAA, 0x55}, + {0xDE, 0xCB, 0xAD, 0xBE, 0xEF}, }; #endif @@ -50,6 +50,7 @@ static int main_test(i2c_test_ctx_t *ctx) size_t sent = 0; local_printf("MASTER write multiple iteration %d", i); + // Do a 1 byte transfer ret = rtos_i2c_master_write(ctx->i2c_master_ctx, I2C_SLAVE_ADDR, (unsigned char*)&test_vector[i], @@ -64,16 +65,32 @@ static int main_test(i2c_test_ctx_t *ctx) } local_printf("MASTER sent %d", sent); + // Do another 1 byte transfer but with num_bytes_sent ptr = NULL ret = rtos_i2c_master_write(ctx->i2c_master_ctx, I2C_SLAVE_ADDR, (unsigned char*)&test_vector[i][1], - I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-1, + 1, + NULL, + 0); + + if (ret != I2C_ACK) + { + local_printf("MASTER write failed to send 1"); + return -1; + } + local_printf("MASTER sent 1"); + + // Transfer the remaining I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE - 2 bytes + ret = rtos_i2c_master_write(ctx->i2c_master_ctx, + I2C_SLAVE_ADDR, + (unsigned char*)&test_vector[i][2], + I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-2, &sent, 0); - if ((ret != I2C_ACK) || (sent != I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-1)) + if ((ret != I2C_ACK) || (sent != I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-2)) { - local_printf("MASTER write failed to send %d", I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-1); + local_printf("MASTER write failed to send %d", I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-2); return -1; } local_printf("MASTER sent %d", sent); @@ -86,7 +103,7 @@ static int main_test(i2c_test_ctx_t *ctx) #if ON_TILE(I2C_SLAVE_TILE) { - while(test_slave_iters < (I2C_MASTER_WRITE_MULTIPLE_TEST_ITER << 1)) // each iter has 2 slave steps + while(test_slave_iters < (I2C_MASTER_WRITE_MULTIPLE_TEST_ITER * 3)) // each iter has 3 slave steps { vTaskDelay(pdMS_TO_TICKS(1)); } @@ -110,8 +127,25 @@ static void slave_rx(rtos_i2c_slave_t *ctx, void *app_data, uint8_t *data, size_ local_printf("SLAVE read iteration %d", test_slave_iters); i2c_test_ctx_t *test_ctx = (i2c_test_ctx_t*)ctx->app_data; - size_t expected_len = ((test_slave_iters%2) == 0) ? 1 : (I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-1); - uint8_t *ptr = ((test_slave_iters%2) == 0) ? &test_vector[test_slave_iters>>1][0] : &test_vector[test_slave_iters>>1][1]; + size_t expected_len; + uint8_t *ptr; + int index = test_slave_iters % 3; + if(index==0) + { + expected_len = 1; + ptr = &test_vector[test_slave_iters/3][0]; + } + else if(index == 1) + { + expected_len = 1; + ptr = &test_vector[test_slave_iters/3][1]; + } + else + { + expected_len = I2C_MASTER_WRITE_MULTIPLE_TEST_SIZE-2; + ptr = &test_vector[test_slave_iters/3][2]; + } + if (len != expected_len) { local_printf("SLAVE failed got len %d expected %d", len, expected_len); diff --git a/test/rtos_drivers/usb/serial_send_receive.py b/test/rtos_drivers/usb/serial_send_receive.py index e324b78ca..337ce61b2 100644 --- a/test/rtos_drivers/usb/serial_send_receive.py +++ b/test/rtos_drivers/usb/serial_send_receive.py @@ -30,7 +30,7 @@ def parse_arguments(): return args def main(if0, if1, of0, of1): - + all_ports = serial.tools.list_ports.comports() test_ports = [] required_ports = 2 diff --git a/test/rtos_drivers/usb/src/individual_tests/usb/local/usb_sof_test.c b/test/rtos_drivers/usb/src/individual_tests/usb/local/usb_sof_test.c index 04427abb1..2fa99e843 100644 --- a/test/rtos_drivers/usb/src/individual_tests/usb/local/usb_sof_test.c +++ b/test/rtos_drivers/usb/src/individual_tests/usb/local/usb_sof_test.c @@ -38,8 +38,9 @@ static void timeout_cb(TimerHandle_t xTimer) sof_timeout = true; } -bool tud_xcore_sof_cb(uint8_t rhport) +bool tud_xcore_sof_cb(uint8_t rhport, uint32_t cur_time) { + (void)cur_time; if (!received_sof_event) { received_sof_event = true; LOCAL_PRINTF("tud_xcore_sof_cb"); @@ -108,4 +109,4 @@ void register_sof_test(usb_test_ctx_t *test_ctx) test_ctx->main_test[this_test_num] = sof_test; test_ctx->test_cnt++; -} \ No newline at end of file +} diff --git a/tools/ci/fetch_ci_deps.cmake b/tools/ci/fetch_ci_deps.cmake index 9aa1ebd1b..4d5972a95 100644 --- a/tools/ci/fetch_ci_deps.cmake +++ b/tools/ci/fetch_ci_deps.cmake @@ -8,7 +8,7 @@ FetchContent_Declare( fwk_io GIT_REPOSITORY https://github.com/xmos/fwk_io.git - GIT_TAG f35192c19824d60740003be5448c67f5df927014 + GIT_TAG v3.3.0 GIT_SHALLOW FALSE GIT_SUBMODULES_RECURSE TRUE SOURCE_DIR ${CMAKE_BINARY_DIR}/dependencies/fwk_io @@ -25,7 +25,7 @@ FetchContent_Declare( fwk_core GIT_REPOSITORY https://github.com/xmos/fwk_core.git - GIT_TAG 9e4f6196386995e2d7786b376091404638055639 + GIT_TAG v1.0.2 GIT_SHALLOW FALSE GIT_SUBMODULES_RECURSE TRUE SOURCE_DIR ${CMAKE_BINARY_DIR}/dependencies/fwk_core @@ -42,7 +42,7 @@ FetchContent_Declare( lib_qspi_fast_read GIT_REPOSITORY git@github.com:xmos/lib_qspi_fast_read.git - GIT_TAG 85fe54188b5f3244c744f6d2aeebd757d8f25358 + GIT_TAG v1.0.1 GIT_SHALLOW FALSE GIT_SUBMODULES_RECURSE TRUE SOURCE_DIR ${CMAKE_BINARY_DIR}/dependencies/lib_qspi_fast_read diff --git a/tools/fatfs_mkimage/README.rst b/tools/fatfs_mkimage/README.rst index 78f753a1b..16e7d337a 100644 --- a/tools/fatfs_mkimage/README.rst +++ b/tools/fatfs_mkimage/README.rst @@ -36,7 +36,7 @@ install with ``winget`` by running the following commands in *PowerShell*: # Reload user Path $env:Path=[System.Environment]::GetEnvironmentVariable("Path","User") -.. tab:: Windows +.. tab:: doscon .. code-block:: x86 native tools command prompt