diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f96a4797..a5b83a91 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,11 +15,14 @@ lib_xua Change Log * RESOLVED: wChannelConfig in UAC1 descriptor set according to output channel count * RESOLVED: Indexing of ADAT channel strings (#18059) + * RESOLVED: Rebooting device fails when PLL config "not reset" bit is set * Changes to dependencies: - lib_spdif: Added dependency 3.0.0 + - lib_xassert: Added dependency 3.0.1 + 0.1.2 ----- diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..f2e9dbad --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,61 @@ +@Library('xmos_jenkins_shared_library@master') _ +pipeline { + agent { + label 'x86&&macOS&&Apps' + } + environment { + VIEW = 'xua' + REPO = 'lib_xua' + } + options { + skipDefaultCheckout() + } + stages { + stage('Get view') { + steps { + prepareAppsSandbox("${VIEW}", "${REPO}") + } + } + stage('Library checks') { + steps { + xcoreLibraryChecks("${REPO}") + } + } + stage('Tests') { + steps { + runXmostest("${REPO}", 'tests') + } + } + stage('Host builds') { + steps { + dir("${REPO}") { + dir("${REPO}") { + dir('host') { + dir('xmosdfu') { + sh 'make -f Makefile.OSX64' + } + } + } + } + } + } + stage('xCORE builds') { + steps { + dir("${REPO}") { + xcoreAllAppNotesBuild('examples') + dir("${REPO}") { + runXdoc('doc') + } + } + } + } + } + post { + success { + updateViewfiles() + } + cleanup { + cleanWs() + } + } +} diff --git a/LICENSE.txt b/LICENSE.txt index d26bf69d..19f8e7cc 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2011-2018, XMOS, All rights reserved. +Copyright (c) 2011-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/lib_xua/LICENSE.txt b/lib_xua/LICENSE.txt index 9f9fc466..3932a9ae 100644 --- a/lib_xua/LICENSE.txt +++ b/lib_xua/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2017-2018, XMOS, All rights reserved. +Copyright (c) 2017-2019, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/lib_xua/api/xua_audiohub.h b/lib_xua/api/xua_audiohub.h index db7e8d94..9694cc10 100644 --- a/lib_xua/api/xua_audiohub.h +++ b/lib_xua/api/xua_audiohub.h @@ -5,6 +5,7 @@ #if __XC__ #include "xccompat.h" +#include "xs1.h" #if XUA_USB_EN #include "dfu_interface.h" diff --git a/lib_xua/module_build_info b/lib_xua/module_build_info index 3460a1ed..2a36dedf 100644 --- a/lib_xua/module_build_info +++ b/lib_xua/module_build_info @@ -9,18 +9,21 @@ # # You can also set MODULE_XCC_C_FLAGS, MODULE_XCC_XC_FLAGS etc.. -MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -DREF_CLK_FREQ=100 -fasm-linenum -fcomment-asm -fsubword-select +MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -DREF_CLK_FREQ=100 -fasm-linenum -fcomment-asm OPTIONAL_HEADERS += xua_conf.h VERSION = 0.2.0 -DEPENDENT_MODULES = lib_logging(>=2.1.0) lib_xud(>=0.1.0) lib_spdif(>=3.0.0) +DEPENDENT_MODULES = lib_logging(>=2.1.0) lib_xassert(>=2.0.0) lib_xud(>=0.1.0) lib_spdif(>=3.0.0) + +INCLUDE_DIRS = api src/* #ignore host dir SOURCE_DIRS = src/* -#core +# The following file specific flags are not automatically kept in sync with the wscript file +# Core EXCLUDE_FILES += descriptors_2.rst XCC_FLAGS_xua_endpoint0.c = -Os -mno-dual-issue $(XCC_FLAGS) XCC_FLAGS_xua_ep0_uacreqs.xc = -Os -mno-dual-issue $(XCC_FLAGS) @@ -28,9 +31,7 @@ XCC_FLAGS_dbcalc.xc = -Os -mno-dual-issue $(XCC_FLAGS) XCC_FLAGS_audioports.c = -Os -mno-dual-issue $(XCC_FLAGS) XCC_FLAGS_audioports.xc = -Os -mno-dual-issue $(XCC_FLAGS) -#dfu +# DFU XCC_FLAGS_dfu.xc = -Os -mno-dual-issue $(XCC_FLAGS) XCC_FLAGS_flash_interface.c = -Os -mno-dual-issue $(XCC_FLAGS) XCC_FLAGS_flashlib_user.c = -Os -mno-dual-issue $(XCC_FLAGS) - - diff --git a/lib_xua/src/core/endpoint0/chanstringgen.py b/lib_xua/src/core/endpoint0/chanstringgen.py index c5343a03..49249f8a 100644 --- a/lib_xua/src/core/endpoint0/chanstringgen.py +++ b/lib_xua/src/core/endpoint0/chanstringgen.py @@ -1,3 +1,4 @@ +# Copyright (c) 2015-2018, XMOS Ltd, All rights reserved def genstrings(outputChanCount, chanString, portString, structureString, adc_dac): diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index a0a8703f..68de9533 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -2819,7 +2819,7 @@ unsigned char cfgDesc_Audio1[] = #endif #ifdef USB_CONTROL_DESCS - /* Standard DFU class Interface descriptor */ + /* Control interface descriptor */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */ (OUTPUT_INTERFACES_A1 + INPUT_INTERFACES_A1 + 1), /* 2 bInterfaceNumber */ diff --git a/lib_xua/src/core/support/reboot.xc b/lib_xua/src/core/support/reboot.xc index 280b0b44..fbc11f6c 100644 --- a/lib_xua/src/core/support/reboot.xc +++ b/lib_xua/src/core/support/reboot.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved #include #include #include @@ -12,7 +12,7 @@ #if (XUD_SERIES_SUPPORT == 4) #include "xs2_su_registers.h" #define XS2_SU_PERIPH_USB_ID 0x1 -#define PLL_MASK 0x7FFFFFFF +#define PLL_MASK 0x3FFFFFFF #else #define PLL_MASK 0xFFFFFFFF #endif diff --git a/lib_xua/wscript b/lib_xua/wscript index d7d30c1b..76f039b3 100644 --- a/lib_xua/wscript +++ b/lib_xua/wscript @@ -1,35 +1,109 @@ -def use_module(bld): - bld.env.XCC_FLAGS = bld.env.XCC_FLAGS + [ - '-O3', '-DREF_CLK_FREQ=100', '-fasm-linenum', '-fcomment-asm', - '-fsubword-select', '-DXUD_FULL_PIDTABLE=1' - ] - - source = bld.path.ant_glob( - [ - 'src/**/*.xc', 'src/**/*.c', 'src/**/*.S' - ], - excl=[ - '**/descriptors_2.rst' - ]) - - depends_on = [ - 'lib_logging(>=2.0.0)', 'lib_xassert(>=2.0.0)', 'lib_xud(>=1.0.0)' - ] - +import os.path + +def create_list_from_make_flag(bld, list_of_flags): + for i, flag in enumerate(list_of_flags): + if flag.startswith('$('): + for f in bld.env[flag.strip('$()')]: + list_of_flags.insert(i, f) + i += 1 + list_of_flags.remove(flag) + return list_of_flags + + +def create_list_of_strings(whitespace_seperated_list): + list_of_strings = whitespace_seperated_list.split(' ') + for item in list_of_strings: + item = "'{}'".format(item) + return list_of_strings + + +def read_module_build_info(bld): + with open(os.path.join(bld.path.abspath(), 'module_build_info')) as file: + module_build_info = {} + for line in file.readlines(): + line = line.strip() + if line and not line.startswith('#'): + key, value = line.split('=', 1) + module_build_info[key.strip(' +')] = value.strip() + + try: + module_build_info['OPTIONAL_HEADERS'] = ( + create_list_of_strings(module_build_info['OPTIONAL_HEADERS'])) + except KeyError: + pass + + try: + module_build_info['DEPENDENT_MODULES'] = ( + create_list_of_strings(module_build_info['DEPENDENT_MODULES'])) + except KeyError: + pass + + try: + module_build_info['MODULE_XCC_FLAGS'] = ( + create_list_from_make_flag(bld, + create_list_of_strings(module_build_info['MODULE_XCC_FLAGS']))) + except KeyError: + pass + + try: + module_build_info['MODULE_XCC_XC_FLAGS'] = ( + create_list_from_make_flag(bld, + create_list_of_strings(module_build_info['MODULE_XCC_XC_FLAGS']))) + except KeyError: + pass + + try: + module_build_info['MODULE_XCC_C_FLAGS'] = ( + create_list_from_make_flag(bld, + create_list_of_strings(module_build_info['MODULE_XCC_C_FLAGS']))) + except KeyError: + pass + + try: + module_build_info['MODULE_XCC_CPP_FLAGS'] = ( + create_list_from_make_flag(bld, + create_list_of_strings(module_build_info['MODULE_XCC_CPP_FLAGS']))) + except KeyError: + pass + + try: + module_build_info['MODULE_XCC_ASM_FLAGS'] = ( + create_list_from_make_flag(bld, + create_list_of_strings(module_build_info['MODULE_XCC_ASM_FLAGS']))) + except KeyError: + pass + + try: + module_build_info['INCLUDE_DIRS'] = ( + create_list_of_strings(module_build_info['INCLUDE_DIRS'])) + except KeyError: + pass + + return module_build_info + + +def use_module(bld): + module_build_info = read_module_build_info(bld) + source = bld.path.ant_glob(['src/**/*.xc', 'src/**/*.c', 'src/**/*.S'], + excl=['**/descriptors_2.rst']) + bld.env.MODULE_XCC_FLAGS = module_build_info['MODULE_XCC_FLAGS'] + + # The following file specific flags are not automatically kept in sync with the module_build_info file + # Core bld.env['XCC_FLAGS_endpoint0.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] + bld.env['XCC_FLAGS_xua_ep0_uacreqs.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] bld.env['XCC_FLAGS_dbcalc.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_audiorequests.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.env['XCC_FLAGS_flashlib_user.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] bld.env['XCC_FLAGS_audioports.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] bld.env['XCC_FLAGS_audioports.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] + # DFU bld.env['XCC_FLAGS_dfu.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] bld.env['XCC_FLAGS_flash_interface.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] + bld.env['XCC_FLAGS_flashlib_user.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue'] - bld.module( source=source, - depends_on=depends_on, - includes=['api'], - optional_headers='xua_conf.h', - version='1.0.0') + depends_on=module_build_info['DEPENDENT_MODULES'], + includes=module_build_info['INCLUDE_DIRS'], + optional_headers=module_build_info['OPTIONAL_HEADERS'], + version=module_build_info['VERSION']) \ No newline at end of file diff --git a/tests/runtests.py b/tests/runtests.py index 36198102..7d419e66 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -1,4 +1,5 @@ #!/usr/bin/env python2.7 +# Copyright (c) 2018, XMOS Ltd, All rights reserved import xmostest import os.path diff --git a/tests/test_i2s_loopback.py b/tests/test_i2s_loopback.py index 06821bef..f56bdcf6 100644 --- a/tests/test_i2s_loopback.py +++ b/tests/test_i2s_loopback.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# Copyright (c) 2018, XMOS Ltd, All rights reserved import xmostest def runtest_one_config(env, format, i2s_role, num_chans_in, num_chans_out, sample_rate):