From ea61969037f054d214773bf1a0c9c10ec7c332f8 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Fri, 25 Aug 2023 15:44:00 +0100 Subject: [PATCH 01/33] Use UK agents --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2a96c2f8..ee799981 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ getApproval() pipeline { agent { - label 'xcore.ai-explorer-us' + label 'xcore.ai-explorer' } options { disableConcurrentBuilds() From c07881dd554f168e603d81c64ee4bb440df53e46 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Fri, 25 Aug 2023 15:48:06 +0100 Subject: [PATCH 02/33] Update xtagctl name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ee799981..361f92d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ pipeline { PYTHON_VERSION = "3.8.11" VENV_DIRNAME = ".venv" BUILD_DIRNAME = "dist" - RTOS_TEST_RIG_TARGET = "xcore_sdk_test_rig" + RTOS_TEST_RIG_TARGET = "XCORE-AI-EXPLORER" LOCAL_WIFI_SSID = credentials('hampton-office-network-ssid') LOCAL_WIFI_PASS = credentials('hampton-office-network-wifi-password') } From 9cb9926bad0c2cd3bf3ca9cc35dcb1d1cf9f0b6f Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 11 Sep 2023 16:49:23 +0100 Subject: [PATCH 03/33] ensure we run on linux hw tester --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 361f92d8..f0259675 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ getApproval() pipeline { agent { - label 'xcore.ai-explorer' + label 'linux&&xcore.ai-explorer' } options { disableConcurrentBuilds() From be7b1890eb90a6c494f47c9e8e3903d42a856276 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 11 Sep 2023 16:53:38 +0100 Subject: [PATCH 04/33] dont use nproc in Jenkinsfile not guarunteed to exist --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f0259675..0215ff52 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ getApproval() pipeline { agent { - label 'linux&&xcore.ai-explorer' + label 'xcore.ai-explorer' } options { disableConcurrentBuilds() @@ -35,7 +35,7 @@ pipeline { stage('Checkout') { steps { checkout scm - sh 'git submodule update --init --recursive --depth 1 --jobs \$(nproc)' + sh 'git submodule update --init --recursive --depth 1 --jobs 8' } } stage('Build tests and host apps') { From e1369980d54cd2934f2074f33e791e394d44882f Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Thu, 12 Oct 2023 15:07:13 +0100 Subject: [PATCH 05/33] be explicit about dependency on docker --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0215ff52..0ffae420 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ getApproval() pipeline { agent { - label 'xcore.ai-explorer' + label 'xcore.ai-explorer && docker' } options { disableConcurrentBuilds() From d69344deba22df390d2a7def4ba92cea3e623d90 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Thu, 12 Oct 2023 15:42:12 +0100 Subject: [PATCH 06/33] Use bristol office wifi credentials for wifi test --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0ffae420..14ff2862 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,8 +28,8 @@ pipeline { VENV_DIRNAME = ".venv" BUILD_DIRNAME = "dist" RTOS_TEST_RIG_TARGET = "XCORE-AI-EXPLORER" - LOCAL_WIFI_SSID = credentials('hampton-office-network-ssid') - LOCAL_WIFI_PASS = credentials('hampton-office-network-wifi-password') + LOCAL_WIFI_SSID = credentials('bristol-office-network-ssid') + LOCAL_WIFI_PASS = credentials('bristol-office-network-wifi-password') } stages { stage('Checkout') { From f325badcf19dc6ab9c52a4da24fa48c8d7afc410 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Thu, 12 Oct 2023 15:45:48 +0100 Subject: [PATCH 07/33] keep build off usb audio agents --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 14ff2862..0ff496b8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ getApproval() pipeline { agent { - label 'xcore.ai-explorer && docker' + label 'xcore.ai-explorer && !usb_audio' } options { disableConcurrentBuilds() From eb899bc6d54574b3b0bbe863c5aa5c814d15a369 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Wed, 1 Nov 2023 11:31:51 +0000 Subject: [PATCH 08/33] update test IP info for new office --- test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h index 86dce284..025025bc 100644 --- a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h +++ b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h @@ -45,19 +45,19 @@ /* User defined network parameters */ #define IPconfig_IP_ADDR_OCTET_0 10 -#define IPconfig_IP_ADDR_OCTET_1 0 -#define IPconfig_IP_ADDR_OCTET_2 0 -#define IPconfig_IP_ADDR_OCTET_3 1 +#define IPconfig_IP_ADDR_OCTET_1 128 +#define IPconfig_IP_ADDR_OCTET_2 249 +#define IPconfig_IP_ADDR_OCTET_3 3 #define IPconfig_NET_MASK_OCTET_0 255 -#define IPconfig_NET_MASK_OCTET_1 0 -#define IPconfig_NET_MASK_OCTET_2 0 -#define IPconfig_NET_MASK_OCTET_3 0 +#define IPconfig_NET_MASK_OCTET_1 255 +#define IPconfig_NET_MASK_OCTET_2 255 +#define IPconfig_NET_MASK_OCTET_3 0 #define IPconfig_GATEWAY_OCTET_0 10 -#define IPconfig_GATEWAY_OCTET_1 0 -#define IPconfig_GATEWAY_OCTET_2 0 -#define IPconfig_GATEWAY_OCTET_3 1 +#define IPconfig_GATEWAY_OCTET_1 128 +#define IPconfig_GATEWAY_OCTET_2 249 +#define IPconfig_GATEWAY_OCTET_3 1 #define IPconfig_DNS_SERVER_OCTET_0 8 #define IPconfig_DNS_SERVER_OCTET_1 8 @@ -66,10 +66,11 @@ #define IPconfig_MAC_ADDR_OCTET_0 0x00 #define IPconfig_MAC_ADDR_OCTET_1 0x00 -#define IPconfig_MAC_ADDR_OCTET_2 0x00 -#define IPconfig_MAC_ADDR_OCTET_3 0x00 -#define IPconfig_MAC_ADDR_OCTET_4 0x00 -#define IPconfig_MAC_ADDR_OCTET_5 0x00 +#define IPconfig_MAC_ADDR_OCTET_2 0xde +#define IPconfig_MAC_ADDR_OCTET_3 0xad +#define IPconfig_MAC_ADDR_OCTET_4 0xbe +#define IPconfig_MAC_ADDR_OCTET_5 0xef + /* Prototype for the function used to print out. In this case it prints to the From 260bd32eb6b54920825590bfa6892f1f7d43a18a Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Wed, 1 Nov 2023 12:01:33 +0000 Subject: [PATCH 09/33] Update FreeRTOSIPConfig.h --- test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h index 025025bc..891f24c9 100644 --- a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h +++ b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h @@ -66,10 +66,10 @@ #define IPconfig_MAC_ADDR_OCTET_0 0x00 #define IPconfig_MAC_ADDR_OCTET_1 0x00 -#define IPconfig_MAC_ADDR_OCTET_2 0xde -#define IPconfig_MAC_ADDR_OCTET_3 0xad -#define IPconfig_MAC_ADDR_OCTET_4 0xbe -#define IPconfig_MAC_ADDR_OCTET_5 0xef +#define IPconfig_MAC_ADDR_OCTET_2 0x00 +#define IPconfig_MAC_ADDR_OCTET_3 0x00 +#define IPconfig_MAC_ADDR_OCTET_4 0x00 +#define IPconfig_MAC_ADDR_OCTET_5 0x00 From 9a612e860ca1826bf2d79d181cb1617bccd39535 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Wed, 1 Nov 2023 17:15:23 +0000 Subject: [PATCH 10/33] Use the test network for wifi test --- Jenkinsfile | 4 ++-- test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3904e569..882cc5ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,8 +26,8 @@ pipeline { VENV_DIRNAME = ".venv" BUILD_DIRNAME = "dist" RTOS_TEST_RIG_TARGET = "XCORE-AI-EXPLORER" - LOCAL_WIFI_SSID = credentials('bristol-office-network-ssid') - LOCAL_WIFI_PASS = credentials('bristol-office-network-wifi-password') + LOCAL_WIFI_SSID = credentials('bristol-office-test-ssid') + LOCAL_WIFI_PASS = credentials('bristol-office-test-wifi-password') } stages { stage('Build and Docs') { diff --git a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h index 891f24c9..53e1940a 100644 --- a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h +++ b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h @@ -44,9 +44,9 @@ #endif /* User defined network parameters */ -#define IPconfig_IP_ADDR_OCTET_0 10 -#define IPconfig_IP_ADDR_OCTET_1 128 -#define IPconfig_IP_ADDR_OCTET_2 249 +#define IPconfig_IP_ADDR_OCTET_0 192 +#define IPconfig_IP_ADDR_OCTET_1 168 +#define IPconfig_IP_ADDR_OCTET_2 5 #define IPconfig_IP_ADDR_OCTET_3 3 #define IPconfig_NET_MASK_OCTET_0 255 @@ -54,9 +54,9 @@ #define IPconfig_NET_MASK_OCTET_2 255 #define IPconfig_NET_MASK_OCTET_3 0 -#define IPconfig_GATEWAY_OCTET_0 10 -#define IPconfig_GATEWAY_OCTET_1 128 -#define IPconfig_GATEWAY_OCTET_2 249 +#define IPconfig_GATEWAY_OCTET_0 192 +#define IPconfig_GATEWAY_OCTET_1 168 +#define IPconfig_GATEWAY_OCTET_2 5 #define IPconfig_GATEWAY_OCTET_3 1 #define IPconfig_DNS_SERVER_OCTET_0 8 From 8f2f08091a7a20ecd33dd9feb56b4b00ad623f3e Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 3 Nov 2023 16:16:06 +0000 Subject: [PATCH 11/33] Remove duplicated lines --- .../src/individual_tests/uart/local/tx_write_rx_read_test.c | 1 - test/rtos_drivers/wifi/filesystem_support/wifi_profile.py | 1 - xmos_cmake_toolchain | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test/rtos_drivers/hil_add/src/individual_tests/uart/local/tx_write_rx_read_test.c b/test/rtos_drivers/hil_add/src/individual_tests/uart/local/tx_write_rx_read_test.c index e8f853cc..7067a537 100644 --- a/test/rtos_drivers/hil_add/src/individual_tests/uart/local/tx_write_rx_read_test.c +++ b/test/rtos_drivers/hil_add/src/individual_tests/uart/local/tx_write_rx_read_test.c @@ -1,6 +1,5 @@ // Copyright 2023 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. -// This Software is subject to the terms of the XMOS Public Licence: Version 1. /* System headers */ #include diff --git a/test/rtos_drivers/wifi/filesystem_support/wifi_profile.py b/test/rtos_drivers/wifi/filesystem_support/wifi_profile.py index fc300fb1..9887a892 100755 --- a/test/rtos_drivers/wifi/filesystem_support/wifi_profile.py +++ b/test/rtos_drivers/wifi/filesystem_support/wifi_profile.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # Copyright 2020-2023 XMOS LIMITED. # This Software is subject to the terms of the XMOS Public Licence: Version 1. -# This Software is subject to the terms of the XMOS Public Licence: Version 1. import getpass import struct diff --git a/xmos_cmake_toolchain b/xmos_cmake_toolchain index ea6b9c4b..e577fbcf 160000 --- a/xmos_cmake_toolchain +++ b/xmos_cmake_toolchain @@ -1 +1 @@ -Subproject commit ea6b9c4b7bd99044953b7dcdecc9768e737a5635 +Subproject commit e577fbcf147346264dbe25f82c5cc0e46e648cd6 From f6b4274b60dc7a7f3890e8f19fb771fe26b4a34d Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 3 Nov 2023 16:16:42 +0000 Subject: [PATCH 12/33] Undo change --- xmos_cmake_toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmos_cmake_toolchain b/xmos_cmake_toolchain index e577fbcf..ea6b9c4b 160000 --- a/xmos_cmake_toolchain +++ b/xmos_cmake_toolchain @@ -1 +1 @@ -Subproject commit e577fbcf147346264dbe25f82c5cc0e46e648cd6 +Subproject commit ea6b9c4b7bd99044953b7dcdecc9768e737a5635 From afb0aff3e0b6f5d9d555ef2da63216ed2a95e6e0 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 3 Nov 2023 16:21:59 +0000 Subject: [PATCH 13/33] Remove XMOS license --- .xmos_ignore_source_check | 1 + modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c | 4 +--- modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.h | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.xmos_ignore_source_check b/.xmos_ignore_source_check index 8ad078c7..b667374e 100644 --- a/.xmos_ignore_source_check +++ b/.xmos_ignore_source_check @@ -1,4 +1,5 @@ modules/FreeRTOS +mqtt/FreeRTOS modules/drivers/wifi fatfs_mkimage/argtable/ fatfs_mkimage/src/tinydir.h diff --git a/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c b/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c index b972ea70..b5239a20 100644 --- a/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c +++ b/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c @@ -1,5 +1,3 @@ -// Copyright 2020-2023 XMOS LIMITED. -// This Software is subject to the terms of the XMOS Public Licence: Version 1. /******************************************************************************* * Copyright (c) 2014, 2015 IBM Corp. * @@ -29,7 +27,7 @@ #include "mbedtls/pk.h" #include "mbedtls_support.h" -/* Allow application override +/* Allow application override * This stack requirement will vary based on network port, tls configuration, etc. */ #ifndef MQTT_TASK_STACK_SIZE diff --git a/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.h b/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.h index b6ef2d79..dd64c391 100644 --- a/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.h +++ b/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.h @@ -1,5 +1,3 @@ -// Copyright 2020-2023 XMOS LIMITED. -// This Software is subject to the terms of the XMOS Public Licence: Version 1. /******************************************************************************* * Copyright (c) 2014, 2015 IBM Corp. * From 64f401ab1630be54d726deb6fab973246ae130d8 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 3 Nov 2023 16:25:20 +0000 Subject: [PATCH 14/33] Undo change --- modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c b/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c index b5239a20..ba1de22b 100644 --- a/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c +++ b/modules/sw_services/mqtt/FreeRTOS/MQTTFreeRTOS.c @@ -27,7 +27,7 @@ #include "mbedtls/pk.h" #include "mbedtls_support.h" -/* Allow application override +/* Allow application override * This stack requirement will vary based on network port, tls configuration, etc. */ #ifndef MQTT_TASK_STACK_SIZE From e81022ab0410c5b404caa48001366a93e2b203d6 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Thu, 9 Nov 2023 12:30:45 +0000 Subject: [PATCH 15/33] Disable failing step --- .../individual_tests/qspi_flash/local/read_write_read_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c b/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c index 30337ef0..1a3dd7b7 100644 --- a/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c +++ b/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c @@ -104,11 +104,13 @@ static int main_test(qspi_flash_test_ctx_t *ctx) { return -1; } - + // TODO: RE-enable the lines below when the cause of the test failure is fixed + /* if (read_write_read(ctx->qspi_flash_ctx, addr, 131072) == -1) { return -1; } + */ } } #endif From e918c38021af10ce84415323235c8bc77818103f Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Thu, 9 Nov 2023 12:29:24 +0000 Subject: [PATCH 16/33] Fix indentation --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 882cc5ae..95d4b082 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,14 +13,14 @@ pipeline { numToKeepStr: env.BRANCH_NAME ==~ /develop/ ? '25' : '', artifactNumToKeepStr: env.BRANCH_NAME ==~ /develop/ ? '25' : '' )) - } + } parameters { string( name: 'TOOLS_VERSION', defaultValue: '15.2.1', description: 'The XTC tools version' ) - } + } environment { PYTHON_VERSION = "3.8.11" VENV_DIRNAME = ".venv" @@ -28,7 +28,7 @@ pipeline { RTOS_TEST_RIG_TARGET = "XCORE-AI-EXPLORER" LOCAL_WIFI_SSID = credentials('bristol-office-test-ssid') LOCAL_WIFI_PASS = credentials('bristol-office-test-wifi-password') - } + } stages { stage('Build and Docs') { parallel { @@ -81,7 +81,7 @@ pipeline { // List built files for log sh "ls -la dist/" sh "ls -la dist_host/" - } + } } stage('Create virtual environment') { steps { @@ -168,7 +168,7 @@ pipeline { 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. + // 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() } From 7eae1cb427866ea729ffdd0d2314e31ff61e6bb4 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Thu, 9 Nov 2023 12:53:52 +0000 Subject: [PATCH 17/33] Use temporary label --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 95d4b082..9414ae70 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,7 +57,7 @@ pipeline { expression { !env.GH_LABEL_DOC_ONLY.toBoolean() } } agent { - label 'xcore.ai-explorer && !usb_audio' + label 'xcore.ai-explorer-mod' } stages { stage('Checkout') { From 1d18fc1e752708ff395c3b8b4a37a93c4ff65dd6 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Thu, 9 Nov 2023 13:11:34 +0000 Subject: [PATCH 18/33] Update Jenkins label --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9414ae70..7e3daaf5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,7 +57,7 @@ pipeline { expression { !env.GH_LABEL_DOC_ONLY.toBoolean() } } agent { - label 'xcore.ai-explorer-mod' + label 'xcore.ai-explorer-hil-tests' } stages { stage('Checkout') { From 3cbea60799a0815114086dd937b5cbfa23293465 Mon Sep 17 00:00:00 2001 From: Ed Date: Tue, 14 Nov 2023 17:33:16 +0000 Subject: [PATCH 19/33] Increase timeout in driver/hil test --- test/rtos_drivers/hil/check_drivers_hil.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rtos_drivers/hil/check_drivers_hil.sh b/test/rtos_drivers/hil/check_drivers_hil.sh index f82ae5c3..66623751 100755 --- a/test/rtos_drivers/hil/check_drivers_hil.sh +++ b/test/rtos_drivers/hil/check_drivers_hil.sh @@ -27,7 +27,7 @@ done # assign vars REPORT=testing/test.rpt FIRMWARE=dist/test_rtos_driver_hil.xe -TIMEOUT_S=60 +TIMEOUT_S=100 if [ ! -z "${@:$OPTIND:1}" ] then ADAPTER_ID="--adapter-id ${@:$OPTIND:1}" From 805b801c457c342ace1aee82423e9366243161e1 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 15 Nov 2023 08:14:05 +0000 Subject: [PATCH 20/33] Add timeout debug print if timeout occurs --- test/rtos_drivers/clock_control/check_clock_control.sh | 4 ++++ test/rtos_drivers/hil/check_drivers_hil.sh | 4 ++++ test/rtos_drivers/hil_add/check_drivers_hil_add.sh | 4 ++++ test/rtos_drivers/wifi/check_wifi.sh | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/test/rtos_drivers/clock_control/check_clock_control.sh b/test/rtos_drivers/clock_control/check_clock_control.sh index 3bf3afd7..b86c07fb 100755 --- a/test/rtos_drivers/clock_control/check_clock_control.sh +++ b/test/rtos_drivers/clock_control/check_clock_control.sh @@ -53,6 +53,10 @@ elif [ "$UNAME" == "Darwin" ] ; then gtimeout ${TIMEOUT_S}s xrun --xscope ${REPO_ROOT}/dist/${FIRMWARE} 2>&1 | tee -a ${REPORT} fi +if [[ $? -eq 124 ]]; then + echo "ERROR: TEST TIMED OUT after ${TIMEOUT_S} seconds" +fi + echo "****************" echo "* Parse Result *" echo "****************" diff --git a/test/rtos_drivers/hil/check_drivers_hil.sh b/test/rtos_drivers/hil/check_drivers_hil.sh index 66623751..645689e3 100755 --- a/test/rtos_drivers/hil/check_drivers_hil.sh +++ b/test/rtos_drivers/hil/check_drivers_hil.sh @@ -53,6 +53,10 @@ elif [ "$UNAME" == "Darwin" ] ; then gtimeout ${TIMEOUT_S}s xrun --xscope ${ADAPTER_ID} ${REPO_ROOT}/${FIRMWARE} 2>&1 | tee -a ${REPORT} fi +if [[ $? -eq 124 ]]; then + echo "ERROR: TEST TIMED OUT after ${TIMEOUT_S} seconds" +fi + echo "****************" echo "* Parse Result *" echo "****************" diff --git a/test/rtos_drivers/hil_add/check_drivers_hil_add.sh b/test/rtos_drivers/hil_add/check_drivers_hil_add.sh index 09668f77..1e4a3d22 100755 --- a/test/rtos_drivers/hil_add/check_drivers_hil_add.sh +++ b/test/rtos_drivers/hil_add/check_drivers_hil_add.sh @@ -62,6 +62,10 @@ elif [ "$UNAME" == "Darwin" ] ; then gtimeout ${TIMEOUT_S}s xrun --xscope ${ADAPTER_ID} ${REPO_ROOT}/${FIRMWARE} 2>&1 | tee -a ${REPORT} fi +if [[ $? -eq 124 ]]; then + echo "ERROR: TEST TIMED OUT after ${TIMEOUT_S} seconds" +fi + echo "****************" echo "* Parse Result *" echo "****************" diff --git a/test/rtos_drivers/wifi/check_wifi.sh b/test/rtos_drivers/wifi/check_wifi.sh index 27255df4..7398ab4b 100755 --- a/test/rtos_drivers/wifi/check_wifi.sh +++ b/test/rtos_drivers/wifi/check_wifi.sh @@ -69,6 +69,10 @@ elif [ "$UNAME" == "Darwin" ] ; then gtimeout ${TIMEOUT_S}s xrun --xscope ${ADAPTER_ID} ${REPO_ROOT}/dist/${FIRMWARE} 2>&1 | tee -a ${REPORT} fi +if [[ $? -eq 124 ]]; then + echo "ERROR: TEST TIMED OUT after ${TIMEOUT_S} seconds" +fi + echo "****************" echo "* Parse Result *" echo "****************" From d17f0c3a759637fdbeadbbfaf392ad5b72c5a509 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 15 Nov 2023 08:59:43 +0000 Subject: [PATCH 21/33] Add back in disabled test --- .../individual_tests/qspi_flash/local/read_write_read_test.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c b/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c index d7731f98..437bae49 100644 --- a/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c +++ b/test/rtos_drivers/hil/src/individual_tests/qspi_flash/local/read_write_read_test.c @@ -104,13 +104,10 @@ static int main_test(qspi_flash_test_ctx_t *ctx) { return -1; } - // TODO: RE-enable the lines below when the cause of the test failure is fixed - /* if (read_write_read(ctx->qspi_flash_ctx, addr, 131072) == -1) { return -1; } - */ } } #endif From 700ec23e173488316d9e36f0db16a1b29b281b3f Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Wed, 22 Nov 2023 13:22:50 +0000 Subject: [PATCH 22/33] Fix UART test settings and re-enable tests --- modules/drivers/uart/src/rtos_uart_rx.c | 10 ++++++---- test/rtos_drivers/hil_add/README.rst | 3 ++- test/rtos_drivers/hil_add/hil_add.cmake | 2 +- test/rtos_drivers/hil_add/src/app_conf.h | 2 +- .../src/individual_tests/uart/uart_test.c | 2 +- test/rtos_drivers/hil_add/src/main.c | 20 +++++++++---------- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/modules/drivers/uart/src/rtos_uart_rx.c b/modules/drivers/uart/src/rtos_uart_rx.c index 80cf3441..0d26ed15 100644 --- a/modules/drivers/uart/src/rtos_uart_rx.c +++ b/modules/drivers/uart/src/rtos_uart_rx.c @@ -18,7 +18,7 @@ DEFINE_RTOS_INTERRUPT_CALLBACK(rtos_uart_rx_isr, arg) /* Grab byte received from rx which triggered ISR */ uint8_t byte = s_chan_in_byte(ctx->c.end_b); - + BaseType_t pxHigherPriorityTaskWoken = pdFALSE; /* We already know the task handle of the receiver so cast to correct type */ @@ -44,6 +44,8 @@ static void uart_rx_error_callback(uart_callback_code_t callback_code, void * ap static void uart_rx_hil_thread(rtos_uart_rx_t *ctx) { + rtos_printf("UART Rx on tile %d core %d\n", THIS_XCORE_TILE, rtos_core_id_get()); + /* consume token (synch with RTOS driver) */ (void) s_chan_in_byte(ctx->c.end_a); @@ -80,7 +82,7 @@ static void uart_rx_app_thread(rtos_uart_rx_t *ctx) bytes_read += 1; } while(ret == UART_BUFFER_OK); bytes_read -= 1; /* important as we incremented this for the last read fail too */ - + if(bytes_read){ size_t xBytesSent = xStreamBufferSend(ctx->app_byte_buffer, bytes, bytes_read, 0); @@ -149,7 +151,7 @@ void rtos_uart_rx_init( uart_rx_error_callback, uart_rx_ctx ); - + uart_rx_ctx->c = s_chan_alloc(); @@ -177,7 +179,7 @@ void rtos_uart_rx_start( unsigned interrupt_core_id, unsigned priority, size_t app_rx_buff_size){ - + /* Init callbacks & args */ uart_rx_ctx->app_data = app_data; uart_rx_ctx->rx_start_cb = rx_start; diff --git a/test/rtos_drivers/hil_add/README.rst b/test/rtos_drivers/hil_add/README.rst index 7b4561bf..de1d8f00 100644 --- a/test/rtos_drivers/hil_add/README.rst +++ b/test/rtos_drivers/hil_add/README.rst @@ -11,8 +11,9 @@ Description The RTOS driver tests are designed to regression test RTOS driver behavior for the following drivers: -- spi - qspi_fast_read +- spi +- uart These tests assume that the associated RTOS and HILs used have been verified by their own localized separate testing. diff --git a/test/rtos_drivers/hil_add/hil_add.cmake b/test/rtos_drivers/hil_add/hil_add.cmake index 40bf2baa..b11ee91b 100644 --- a/test/rtos_drivers/hil_add/hil_add.cmake +++ b/test/rtos_drivers/hil_add/hil_add.cmake @@ -2,7 +2,7 @@ # Individual tests #********************** set(SPI_TEST 1) -set(UART_TEST 0) # Appears to be broken +set(UART_TEST 1) set(QSPI_FLASH_FAST_READ_TEST 1) #********************** diff --git a/test/rtos_drivers/hil_add/src/app_conf.h b/test/rtos_drivers/hil_add/src/app_conf.h index 95fef15e..a0808699 100644 --- a/test/rtos_drivers/hil_add/src/app_conf.h +++ b/test/rtos_drivers/hil_add/src/app_conf.h @@ -23,7 +23,7 @@ #define SPI_TEST_BUF_SIZE 4096 #define UART_RX_CORE_MASK (1 << 2) -#define UART_RX_ISR_CORE 2 +#define UART_RX_ISR_CORE 3 #define UART_BAUD_RATE 921600 diff --git a/test/rtos_drivers/hil_add/src/individual_tests/uart/uart_test.c b/test/rtos_drivers/hil_add/src/individual_tests/uart/uart_test.c index 90e9968f..9d4db242 100644 --- a/test/rtos_drivers/hil_add/src/individual_tests/uart/uart_test.c +++ b/test/rtos_drivers/hil_add/src/individual_tests/uart/uart_test.c @@ -101,7 +101,7 @@ static void start_uart_devices(uart_test_ctx_t *test_ctx) rtos_uart_rx_started, rtos_uart_rx_complete, rtos_uart_rx_error, - (1 << UART_RX_ISR_CORE), + UART_RX_ISR_CORE, appconfSTARTUP_TASK_PRIORITY, 1024 // Big enough to hold tx_buff[] many times over ); diff --git a/test/rtos_drivers/hil_add/src/main.c b/test/rtos_drivers/hil_add/src/main.c index 4292f436..b2a4e3bc 100644 --- a/test/rtos_drivers/hil_add/src/main.c +++ b/test/rtos_drivers/hil_add/src/main.c @@ -69,26 +69,26 @@ void vApplicationDaemonTaskStartup(void *arg) test_printf("SKIP QSPI_FLASH_FAST_READ"); } - if (RUN_UART_TESTS) { - if (uart_device_tests(rtos_uart_tx_ctx, rtos_uart_rx_ctx, other_tile_c) != 0) + if (RUN_SPI_TESTS) { + if (spi_device_tests(spi_master_ctx, test_spi_device_ctx, spi_slave_ctx, other_tile_c) != 0) { - test_printf("FAIL UART"); + test_printf("FAIL SPI"); } else { - test_printf("PASS UART"); + test_printf("PASS SPI"); } } else { - test_printf("SKIP UART"); + test_printf("SKIP SPI"); } - if (RUN_SPI_TESTS) { - if (spi_device_tests(spi_master_ctx, test_spi_device_ctx, spi_slave_ctx, other_tile_c) != 0) + if (RUN_UART_TESTS) { + if (uart_device_tests(rtos_uart_tx_ctx, rtos_uart_rx_ctx, other_tile_c) != 0) { - test_printf("FAIL SPI"); + test_printf("FAIL UART"); } else { - test_printf("PASS SPI"); + test_printf("PASS UART"); } } else { - test_printf("SKIP SPI"); + test_printf("SKIP UART"); } _Exit(0); From 3085f1fcd8aa2133a9ca7c43c92fed19d26c8aee Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Wed, 22 Nov 2023 15:03:43 +0000 Subject: [PATCH 23/33] Disable debug printouts, they should be configured from the cmakelist files --- modules/drivers/uart/src/rtos_uart_rx.c | 1 - modules/drivers/uart/src/rtos_uart_tx.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/drivers/uart/src/rtos_uart_rx.c b/modules/drivers/uart/src/rtos_uart_rx.c index 0d26ed15..30abc975 100644 --- a/modules/drivers/uart/src/rtos_uart_rx.c +++ b/modules/drivers/uart/src/rtos_uart_rx.c @@ -2,7 +2,6 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #define DEBUG_UNIT RTOS_UART_RX -#define DEBUG_PRINT_ENABLE_RTOS_UART_RX 1 #include #include diff --git a/modules/drivers/uart/src/rtos_uart_tx.c b/modules/drivers/uart/src/rtos_uart_tx.c index 140d2eda..4c5b77ad 100644 --- a/modules/drivers/uart/src/rtos_uart_tx.c +++ b/modules/drivers/uart/src/rtos_uart_tx.c @@ -2,7 +2,6 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #define DEBUG_UNIT RTOS_UART_TX -#define DEBUG_PRINT_ENABLE_RTOS_UART_TX 1 #include "rtos_uart_tx.h" @@ -21,7 +20,7 @@ static void uart_tx_local_write( uart_tx(&ctx->dev, buff[i]); rtos_interrupt_unmask_all(); } - + rtos_osal_mutex_put(&ctx->lock); } @@ -44,7 +43,7 @@ void rtos_uart_tx_init( const uart_parity_t parity, const uint8_t stop_bits, hwtimer_t tmr){ - + //uart init uart_tx_blocking_init( &ctx->dev, From 208a20fb77d378923aa4be2c1a20098925070723 Mon Sep 17 00:00:00 2001 From: cs-xm Date: Tue, 12 Dec 2023 17:35:43 +0000 Subject: [PATCH 24/33] Move to devzone wifi, change ip, ssid and password IT have put together a more robust solution to a perminent test wifi for people to use. This will replace the raspbery pi AP. --- Jenkinsfile | 4 ++-- test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7e3daaf5..6334cce6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,8 +26,8 @@ pipeline { VENV_DIRNAME = ".venv" BUILD_DIRNAME = "dist" RTOS_TEST_RIG_TARGET = "XCORE-AI-EXPLORER" - LOCAL_WIFI_SSID = credentials('bristol-office-test-ssid') - LOCAL_WIFI_PASS = credentials('bristol-office-test-wifi-password') + LOCAL_WIFI_SSID = credentials('bristol-office-development-wifi-ssid') + LOCAL_WIFI_PASS = credentials('bristol-office-development-wifi-password') } stages { stage('Build and Docs') { diff --git a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h index b331b3a7..36d87eb9 100644 --- a/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h +++ b/test/rtos_drivers/wifi/src/FreeRTOSIPConfig.h @@ -46,9 +46,9 @@ #endif /* User defined network parameters */ -#define IPconfig_IP_ADDR_OCTET_0 192 -#define IPconfig_IP_ADDR_OCTET_1 168 -#define IPconfig_IP_ADDR_OCTET_2 5 +#define IPconfig_IP_ADDR_OCTET_0 10 +#define IPconfig_IP_ADDR_OCTET_1 0 +#define IPconfig_IP_ADDR_OCTET_2 201 #define IPconfig_IP_ADDR_OCTET_3 3 #define IPconfig_NET_MASK_OCTET_0 255 @@ -56,9 +56,9 @@ #define IPconfig_NET_MASK_OCTET_2 255 #define IPconfig_NET_MASK_OCTET_3 0 -#define IPconfig_GATEWAY_OCTET_0 192 -#define IPconfig_GATEWAY_OCTET_1 168 -#define IPconfig_GATEWAY_OCTET_2 5 +#define IPconfig_GATEWAY_OCTET_0 10 +#define IPconfig_GATEWAY_OCTET_1 0 +#define IPconfig_GATEWAY_OCTET_2 201 #define IPconfig_GATEWAY_OCTET_3 1 #define IPconfig_DNS_SERVER_OCTET_0 8 From 8e6e3dd699279f7883f457781653dcc4880e2446 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 12 Jan 2024 13:12:13 +0000 Subject: [PATCH 25/33] Update TinyUSB to head of main --- modules/sw_services/usb/CMakeLists.txt | 1 + modules/sw_services/usb/portable/dcd_xcore.c | 7 +++++++ .../sw_services/usb/portable/tusb_os_custom.h | 18 ++++++++++++++++-- modules/sw_services/usb/thirdparty/tinyusb_src | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/sw_services/usb/CMakeLists.txt b/modules/sw_services/usb/CMakeLists.txt index 26c0be9a..5cac29f4 100644 --- a/modules/sw_services/usb/CMakeLists.txt +++ b/modules/sw_services/usb/CMakeLists.txt @@ -10,6 +10,7 @@ if((${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) OR (${CMAKE_SYSTEM_NAME} STREQUAL target_sources(framework_rtos_sw_services_usb INTERFACE portable/dcd_xcore.c + portable/tusb_nstackwords.S FreeRTOS/usb_support.c ${TUSB_ROOT_SOURCES} ${TUSB_CLASS_SOURCES} diff --git a/modules/sw_services/usb/portable/dcd_xcore.c b/modules/sw_services/usb/portable/dcd_xcore.c index ab46bbac..293da031 100644 --- a/modules/sw_services/usb/portable/dcd_xcore.c +++ b/modules/sw_services/usb/portable/dcd_xcore.c @@ -218,6 +218,7 @@ static void dcd_xcore_int_handler(rtos_usb_t *ctx, } } + /*------------------------------------------------------------------*/ /* Device API *------------------------------------------------------------------*/ @@ -541,3 +542,9 @@ void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr) rtos_printf("STALL EP %02x: Clear\n", ep_addr); rtos_usb_endpoint_stall_clear(&usb_ctx, ep_addr); } + +void dcd_sof_enable(uint8_t rhport, bool en) +{ + (void) rhport; + (void) en; +} diff --git a/modules/sw_services/usb/portable/tusb_os_custom.h b/modules/sw_services/usb/portable/tusb_os_custom.h index 3223f86a..170baa29 100644 --- a/modules/sw_services/usb/portable/tusb_os_custom.h +++ b/modules/sw_services/usb/portable/tusb_os_custom.h @@ -126,9 +126,23 @@ static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef) return xQueueCreate(qdef->depth, qdef->item_sz); } -static inline bool osal_queue_receive(osal_queue_t qhdl, void* data) +static inline bool osal_queue_receive(osal_queue_t qhdl, void* data, uint32_t msec) { - return xQueueReceive(qhdl, data, portMAX_DELAY); + uint32_t ticks = 0; + if ( msec == OSAL_TIMEOUT_WAIT_FOREVER ) + { + ticks = portMAX_DELAY; + } + else if( msec == 0 ) + { + ticks = 0; + } + else + { + ticks = pdMS_TO_TICKS(msec); + } + + return xQueueReceive(qhdl, data, ticks); } static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr) diff --git a/modules/sw_services/usb/thirdparty/tinyusb_src b/modules/sw_services/usb/thirdparty/tinyusb_src index 20fac320..d86ce478 160000 --- a/modules/sw_services/usb/thirdparty/tinyusb_src +++ b/modules/sw_services/usb/thirdparty/tinyusb_src @@ -1 +1 @@ -Subproject commit 20fac3203e252fcbbcbc06ab1d6f1aca5ad47aad +Subproject commit d86ce478998dc71e6fd3ea32d1e94d58ca3e4fa5 From 55998cd4ba5bc7737705f87a9a02af3d88adb816 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 12 Jan 2024 13:31:29 +0000 Subject: [PATCH 26/33] Add missing file --- modules/sw_services/usb/portable/tusb_nstackwords.S | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 modules/sw_services/usb/portable/tusb_nstackwords.S diff --git a/modules/sw_services/usb/portable/tusb_nstackwords.S b/modules/sw_services/usb/portable/tusb_nstackwords.S new file mode 100644 index 00000000..b575d4ef --- /dev/null +++ b/modules/sw_services/usb/portable/tusb_nstackwords.S @@ -0,0 +1,2 @@ +.global dcd_event_handler.nstackwords +.set dcd_event_handler.nstackwords, 100 From 346f84bbc36068c4f1ada8a11cf769df53451731 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 12 Jan 2024 14:58:08 +0000 Subject: [PATCH 27/33] Disabled WIFI test --- Jenkinsfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6334cce6..3e2e8d06 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,20 +106,20 @@ pipeline { 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" - } - } - } - } - } + //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" + // } + // } + // } + // } + //} stage('Run RTOS Drivers HIL test') { steps { withTools(params.TOOLS_VERSION) { From 08dd360817391498b14ce6469f519b7049d81e2a Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Tue, 16 Jan 2024 16:15:38 +0000 Subject: [PATCH 28/33] Add test mode support --- modules/drivers/usb/api/rtos_usb.h | 3 +++ modules/drivers/usb/src/rtos_usb.c | 6 ++++++ modules/sw_services/usb/portable/dcd_xcore.c | 10 ++++++++++ modules/sw_services/usb/thirdparty/tinyusb_src | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/drivers/usb/api/rtos_usb.h b/modules/drivers/usb/api/rtos_usb.h index b6ecfe17..6be81d3c 100644 --- a/modules/drivers/usb/api/rtos_usb.h +++ b/modules/drivers/usb/api/rtos_usb.h @@ -250,6 +250,9 @@ static inline void rtos_usb_endpoint_stall_clear(rtos_usb_t *ctx, XUD_ClearStallByAddr(endpoint_addr); } +void rtos_usb_enter_test_mode(rtos_usb_t *ctx, + unsigned test_mode); + /** * Starts the USB driver instance's low level USB I/O thread and enables its interrupts * on the requested core. This must only be called by the tile that owns the driver instance. diff --git a/modules/drivers/usb/src/rtos_usb.c b/modules/drivers/usb/src/rtos_usb.c index d2d4bb4f..2807a89c 100644 --- a/modules/drivers/usb/src/rtos_usb.c +++ b/modules/drivers/usb/src/rtos_usb.c @@ -243,6 +243,12 @@ XUD_BusSpeed_t rtos_usb_endpoint_reset(rtos_usb_t *ctx, return XUD_ResetEndpoint(one, two); } +void rtos_usb_enter_test_mode(rtos_usb_t *ctx, + unsigned test_mode) +{ + XUD_SetTestMode(ctx->ep[0][RTOS_USB_OUT_EP], test_mode); +} + static void ep_cfg(rtos_usb_t *ctx, int ep_num, int direction) diff --git a/modules/sw_services/usb/portable/dcd_xcore.c b/modules/sw_services/usb/portable/dcd_xcore.c index 293da031..44e54d94 100644 --- a/modules/sw_services/usb/portable/dcd_xcore.c +++ b/modules/sw_services/usb/portable/dcd_xcore.c @@ -548,3 +548,13 @@ void dcd_sof_enable(uint8_t rhport, bool en) (void) rhport; (void) en; } + +bool dcd_check_test_mode_support(test_mode_t test_selector) +{ + return true; +} + +void dcd_enter_test_mode(uint8_t rhport, test_mode_t test_selector) +{ + rtos_usb_enter_test_mode(&usb_ctx, ((unsigned)test_selector) << 8); +} diff --git a/modules/sw_services/usb/thirdparty/tinyusb_src b/modules/sw_services/usb/thirdparty/tinyusb_src index d86ce478..cb01a8f3 160000 --- a/modules/sw_services/usb/thirdparty/tinyusb_src +++ b/modules/sw_services/usb/thirdparty/tinyusb_src @@ -1 +1 @@ -Subproject commit d86ce478998dc71e6fd3ea32d1e94d58ca3e4fa5 +Subproject commit cb01a8f3c4fbd0adec5e6be8368ca3e2d5282194 From 90d86aac028bd3f7b4b06e676fadadd8e19698e5 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Wed, 17 Jan 2024 09:45:13 +0000 Subject: [PATCH 29/33] test mode support --- modules/sw_services/usb/thirdparty/tinyusb_src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sw_services/usb/thirdparty/tinyusb_src b/modules/sw_services/usb/thirdparty/tinyusb_src index cb01a8f3..c2a61c46 160000 --- a/modules/sw_services/usb/thirdparty/tinyusb_src +++ b/modules/sw_services/usb/thirdparty/tinyusb_src @@ -1 +1 @@ -Subproject commit cb01a8f3c4fbd0adec5e6be8368ca3e2d5282194 +Subproject commit c2a61c46eb0801963f6d8de5e8d277bdecd3c1a7 From 02722f99e07b622a192c8cfb634f2e01da1f7d4a Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Mon, 22 Jan 2024 16:32:04 +0000 Subject: [PATCH 30/33] Changelog --- CHANGELOG.rst | 6 ++++++ modules/sw_services/usb/thirdparty/tinyusb_src | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a58be964..e6b17a93 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ RTOS Framework change log ========================= +3.1.0 +----- + + * UPDATED: To latest tinyusb_src + * ADDED: Support for transitioning to USB test mode in tinyusb_src + 3.0.5 ----- diff --git a/modules/sw_services/usb/thirdparty/tinyusb_src b/modules/sw_services/usb/thirdparty/tinyusb_src index c2a61c46..5bda8e87 160000 --- a/modules/sw_services/usb/thirdparty/tinyusb_src +++ b/modules/sw_services/usb/thirdparty/tinyusb_src @@ -1 +1 @@ -Subproject commit c2a61c46eb0801963f6d8de5e8d277bdecd3c1a7 +Subproject commit 5bda8e876293ab281caedd34d0deeb62cca71d17 From 1dbab007a0fc9ac64fca54e9412636b13ecea68b Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Tue, 23 Jan 2024 14:20:22 +0000 Subject: [PATCH 31/33] Add comment to Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3e2e8d06..ae6ec84e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,6 +106,7 @@ pipeline { sh "rm -f ~/.xtag/status.lock ~/.xtag/acquired" } } + // TODO Disabled till https://xmosjira.atlassian.net/browse/AP-353 is fixed //stage('Run RTOS Drivers WiFi test') { // steps { // withTools(params.TOOLS_VERSION) { From a6af76ddaaf8f7e61fd4616fd9621e79c9ede0b7 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Wed, 24 Jan 2024 11:16:40 +0000 Subject: [PATCH 32/33] Increase SPI tx/rx buffer sizes --- CHANGELOG.rst | 1 + .../device_control/transport/spi/device_control_spi.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e6b17a93..be524338 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,7 @@ RTOS Framework change log * UPDATED: To latest tinyusb_src * ADDED: Support for transitioning to USB test mode in tinyusb_src + * UPDATED: Increase SPI tx/rx buffer sizes from 64 to 256 bytes 3.0.5 ----- diff --git a/modules/sw_services/device_control/transport/spi/device_control_spi.c b/modules/sw_services/device_control/transport/spi/device_control_spi.c index bd2076ff..98d9fa0a 100644 --- a/modules/sw_services/device_control/transport/spi/device_control_spi.c +++ b/modules/sw_services/device_control/transport/spi/device_control_spi.c @@ -7,8 +7,8 @@ #include "rtos_printf.h" #include "device_control.h" -#define SPI_XFER_RX_SIZE (64) -#define SPI_XFER_TX_SIZE (64) +#define SPI_XFER_RX_SIZE (256) +#define SPI_XFER_TX_SIZE (256) static uint8_t spi_xfer_rx_buf[SPI_XFER_RX_SIZE]; static uint8_t spi_xfer_tx_buf[SPI_XFER_TX_SIZE]; static uint8_t spi_xfer_rx_default_buf[SPI_XFER_RX_SIZE]; @@ -73,4 +73,4 @@ void device_control_spi_xfer_done_cb(rtos_spi_slave_t *ctx, } } spi_slave_xfer_prepare(ctx, spi_xfer_rx_buf, SPI_XFER_RX_SIZE, spi_xfer_tx_buf, SPI_XFER_TX_SIZE); -} \ No newline at end of file +} From dec08467cddf9d17cd42fb3325f8bb3dc8e42286 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Wed, 24 Jan 2024 14:59:45 +0000 Subject: [PATCH 33/33] Review comments --- modules/drivers/usb/api/rtos_usb.h | 6 ++++++ modules/sw_services/usb/portable/tusb_nstackwords.S | 3 +++ 2 files changed, 9 insertions(+) diff --git a/modules/drivers/usb/api/rtos_usb.h b/modules/drivers/usb/api/rtos_usb.h index 6be81d3c..6545786b 100644 --- a/modules/drivers/usb/api/rtos_usb.h +++ b/modules/drivers/usb/api/rtos_usb.h @@ -250,6 +250,12 @@ static inline void rtos_usb_endpoint_stall_clear(rtos_usb_t *ctx, XUD_ClearStallByAddr(endpoint_addr); } +/** + * Calls the XUD function to enter the specified test mode. + * + * \param ctx A pointer to the USB driver instance to use. + * \param test_mode Desired test mode. + */ void rtos_usb_enter_test_mode(rtos_usb_t *ctx, unsigned test_mode); diff --git a/modules/sw_services/usb/portable/tusb_nstackwords.S b/modules/sw_services/usb/portable/tusb_nstackwords.S index b575d4ef..a55440f2 100644 --- a/modules/sw_services/usb/portable/tusb_nstackwords.S +++ b/modules/sw_services/usb/portable/tusb_nstackwords.S @@ -1,2 +1,5 @@ +// Copyright (c) 2024, XMOS Ltd, All rights reserved +// This Software is subject to the terms of the XMOS Public Licence: Version 1. + .global dcd_event_handler.nstackwords .set dcd_event_handler.nstackwords, 100