This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC1352P:TI-RTOS 中止/置位无调试信息、仅在闪存后出现硬故障

Guru**** 2455490 points
Other Parts Discussed in Thread: CC1352P, SYSCONFIG, MSP-FET

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/other-wireless-group/other-wireless/f/other-wireless-technologies-forum/1046567/cc1352p-ti-rtos-abort-assert-no-debug-info-hard-fault-only-after-flashing

器件型号:CC1352P
Thread 中讨论的其他器件: SysConfigSYSBIOSCCStudioMSP-FETMSP432P401R

我们目前正在 CC1352P 上运行 TI-RTOS 和 TI-Drivers 库、版本如下:

  • Code Composer Studio 版本:10.4.0.00006
  • TI Clang v1.3.0.LTS
  • SimpleLink CC13x2 26x2 SDK 5.20.0.52
  • SysConfig 1.8.2

我们有三个主要问题:

  1. 我们似乎找不到在断言失败时为我们提供调试信息的配置/设置。 调试堆栈为空、所有任务的调用堆栈为空: TI-RTOS .cfg 中是否有一些特定的设置 来保留调试堆栈和任务的调用堆栈?




    类似地、在出现硬故障时、我们会看到以下情况(图中未显示:任务的调用栈也为空):


    以下是 TI-RTOS 项目中的.cfg 文件:
    /*
     * This module contains family specific Boot APIs and configuration settings.
     * See the SYS/BIOS API guide for more information.
     */
    
    
    
    /* ================ Clock configuration ================ */
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    /*
     * When using Power and calibrateRCOSC is set to true, this should be set to 10.
     * The timer used by the Clock module supports TickMode_DYNAMIC. This enables us
     * to set the tick period to 10 us without generating the overhead of additional
     * interrupts.
     *
     * Note: The calibrateRCOSC parameter is set within the Power configuration
     *     structure in the "Board.c" file.
     */
    Clock.tickPeriod = 1000;
    
    
    
    /* ================ Defaults (module) configuration ================ */
    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    /*
     * A flag to allow module names to be loaded on the target. Module name
     * strings are placed in the .const section for debugging purposes.
     *
     * Pick one:
     *  - true (default)
     *      Setting this parameter to true will include name strings in the .const
     *      section so that Errors and Asserts are easier to debug.
     *  - false
     *      Setting this parameter to false will reduce footprint in the .const
     *      section. As a result, Error and Assert messages will contain an
     *      "unknown module" prefix instead of the actual module name.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //Defaults.common$.namedModule = true;
    Defaults.common$.namedModule = false;
    
    
    
    /* ================ Error configuration ================ */
    //var Error = xdc.useModule('xdc.runtime.Error');
    /*
     * This function is called to handle all raised errors, but unlike
     * Error.raiseHook, this function is responsible for completely handling the
     * error with an appropriately initialized Error_Block.
     *
     * Pick one:
     *  - Error.policyDefault (default)
     *      Calls Error.raiseHook with an initialized Error_Block structure and logs
     *      the error using the module's logger.
     *  - Error.policySpin
     *      Simple alternative that traps on a while(1) loop for minimized target
     *      footprint.
     *      Using Error.policySpin, the Error.raiseHook will NOT called.
     *  - Error.policyMin
     *      Lightweight policy function that does minimum processing and returns.
     */
    //Error.policyFxn = Error.policyDefault;
    //Error.policyFxn = Error.policySpin;
    //Error.policyFxn = Error.policyMin;
    
    /*
     * If Error.policyFxn is set to Error.policyDefault, this function is called
     * whenever an error is raised by the Error module.
     *
     * Pick one:
     *  - Error.print (default)
     *      Errors are formatted and output via System_printf() for easier
     *      debugging.
     *  - null
     *      Errors are not formatted or logged. This option reduces code footprint.
     *  - non-null function
     *      Errors invoke custom user function. See the Error module documentation
     *      for more details.
     */
    //Error.raiseHook = Error.print;
    //Error.raiseHook = null;
    //Error.raiseHook = "&myErrorFxn";
    
    /*
     * If Error.policyFxn is set to Error.policyDefault, this option applies to the
     * maximum number of times the Error.raiseHook function can be recursively
     * invoked. This option limits the possibility of an infinite recursion that
     * could lead to a stack overflow.
     * The default value is 16.
     */
    //Error.maxDepth = 2;
    
    
    
    /* ================ Hwi configuration ================ */
    var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
    /*
     * Checks for Hwi (system) stack overruns while in the Idle loop.
     *
     * Pick one:
     *  - true (default)
     *      Checks the top word for system stack overflows during the idle loop and
     *      raises an Error if one is detected.
     *  - false
     *      Disabling the runtime check improves runtime performance and yields a
     *      reduced flash footprint.
     */
    //halHwi.checkStackFlag = true;
    halHwi.checkStackFlag = false;
    
    /*
     * The following options alter the system's behavior when a hardware exception
     * is detected.
     *
     * Pick one:
     *  - Hwi.enableException = true
     *      This option causes the default m3Hwi.excHandlerFunc function to fully
     *      decode an exception and dump the registers to the system console.
     *      This option raises errors in the Error module and displays the
     *      exception in ROV.
     *  - Hwi.enableException = false
     *      This option reduces code footprint by not decoding or printing the
     *      exception to the system console.
     *      It however still raises errors in the Error module and displays the
     *      exception in ROV.
     *  - Hwi.excHandlerFunc = null
     *      This is the most aggressive option for code footprint savings; but it
     *      can difficult to debug exceptions. It reduces flash footprint by
     *      plugging in a default while(1) trap when exception occur. This option
     *      does not raise an error with the Error module.
     */
    //m3Hwi.enableException = true;
    m3Hwi.enableException = false;
    //m3Hwi.excHandlerFunc = null;
    
    /*
     * Enable hardware exception generation when dividing by zero.
     *
     * Pick one:
     *  - 0 (default)
     *      Disables hardware exceptions when dividing by zero
     *  - 1
     *      Enables hardware exceptions when dividing by zero
     */
    m3Hwi.nvicCCR.DIV_0_TRP = 0;
    //m3Hwi.nvicCCR.DIV_0_TRP = 1;
    
    
    
    /* ================ Idle configuration ================ */
    var Idle = xdc.useModule('ti.sysbios.knl.Idle');
    /*
     * The Idle module is used to specify a list of functions to be called when no
     * other tasks are running in the system.
     *
     * Functions added here will be run continuously within the idle task.
     *
     * Function signature:
     *     Void func(Void);
     */
    //Idle.addFunc("&myIdleFunc");
    
    Idle.addFunc('&Power_idleFunc');  /* add the Power module's idle function */
    
    
    
    /* ================ Kernel (SYS/BIOS) configuration ================ */
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    /*
     * Enable asserts in the BIOS library.
     *
     * Pick one:
     *  - true (default)
     *      Enables asserts for debugging purposes.
     *  - false
     *      Disables asserts for a reduced code footprint and better performance.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //BIOS.assertsEnabled = true;
    BIOS.assertsEnabled = false;
    
    /*
     * A flag to determine if xdc.runtime sources are to be included in a custom
     * built BIOS library.
     *
     * Pick one:
     *  - false (default)
     *      The pre-built xdc.runtime library is provided by the respective target
     *      used to build the application.
     *  - true
     *      xdc.runtime library sources are to be included in the custom BIOS
     *      library. This option yields the most efficient library in both code
     *      footprint and runtime performance.
     */
    //BIOS.includeXdcRuntime = false;
    BIOS.includeXdcRuntime = true;
    
    /*
     * The SYS/BIOS runtime is provided in the form of a library that is linked
     * with the application. Several forms of this library are provided with the
     * SYS/BIOS product.
     *
     * Pick one:
     *   - BIOS.LibType_Custom
     *      Custom built library that is highly optimized for code footprint and
     *      runtime performance.
     *   - BIOS.LibType_Debug
     *      Custom built library that is non-optimized that can be used to
     *      single-step through APIs with a debugger.
     *
     */
    BIOS.libType = BIOS.LibType_Custom;
    //BIOS.libType = BIOS.LibType_Debug;
    
    /*
     * Runtime instance creation enable flag.
     *
     * Pick one:
     *   - true (default)
     *      Allows Mod_create() and Mod_delete() to be called at runtime which
     *      requires a default heap for dynamic memory allocation.
     *   - false
     *      Reduces code footprint by disallowing Mod_create() and Mod_delete() to
     *      be called at runtime. Object instances are constructed via
     *      Mod_construct() and destructed via Mod_destruct().
     *
     *  When using BIOS in ROM:
     *      This option must be set to true.
     */
    BIOS.runtimeCreatesEnabled = true;
    //BIOS.runtimeCreatesEnabled = false;
    
    /*
     * Enable logs in the BIOS library.
     *
     * Pick one:
     *  - true (default)
     *      Enables logs for debugging purposes.
     *  - false
     *      Disables logging for reduced code footprint and improved runtime
     *      performance.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //BIOS.logsEnabled = true;
    BIOS.logsEnabled = false;
    
    
    
    /* ================ Memory configuration ================ */
    var Memory = xdc.useModule('xdc.runtime.Memory');
    /*
     * The Memory module itself simply provides a common interface for any
     * variety of system and application specific memory management policies
     * implemented by the IHeap modules(Ex. HeapMem, HeapBuf).
     */
    
    /*
     * Use HeapMem primary heap instance to use linker-defined memory region
     * Add HeapTrack on top to find over-writes, invalid frees, and
     * aid in finding the correct sizing of the heap and memory leaks.
     */
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    HeapMem.primaryHeapBaseAddr = "&__primary_heap_start__";
    HeapMem.primaryHeapEndAddr = "&__primary_heap_end__";
    
    var heapMemParams = new HeapMem.Params();
    heapMemParams.usePrimaryHeap = true;
    
    //var HeapTrack = xdc.useModule('ti.sysbios.heaps.HeapTrack');
    //var heapTrackParams = new HeapTrack.Params;
    //heapTrackParams.heap = HeapMem.create(heapMemParams);
    //Program.global.heap0 = HeapTrack.create(heapTrackParams);
    Program.global.heap0 = HeapMem.create(heapMemParams);
    
    Memory.defaultHeapInstance = Program.global.heap0;
    
    
    
    /* ================ Program configuration ================ */
    /*
     *  Program.stack must be set to 0 to allow the setting
     *  of the system stack size to be determined in the example's
     *  linker command file.
     */
    Program.stack = 0;
    
    
    /*
     * Uncomment to enable Semihosting for GNU targets to print to the CCS console.
     * Please read the following TIRTOS Wiki page for more information on Semihosting:
     * processors.wiki.ti.com/.../TI-RTOS_Examples_SemiHosting
     */
    
    if (Program.build.target.$name.match(/gnu/)) {
        //var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
    }
    /* ================ ROM configuration ================ */
    /*
     * To use BIOS in flash, comment out the code block below.
     */
    //var ROM = xdc.useModule('ti.sysbios.rom.ROM');
    //ROM.romName = ROM.CC13X2V2;
    
    /* ================ Semaphore configuration ================ */
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    /*
     * Enables global support for Task priority pend queuing.
     *
     * Pick one:
     *  - true (default)
     *      This allows pending tasks to be serviced based on their task priority.
     *  - false
     *      Pending tasks are services based on first in, first out basis.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //Semaphore.supportsPriority = true;
    Semaphore.supportsPriority = false;
    
    /*
     * Allows for the implicit posting of events through the semaphore,
     * disable for additional code saving.
     *
     * Pick one:
     *  - true
     *      This allows the Semaphore module to post semaphores and events
     *      simultaneously.
     *  - false (default)
     *      Events must be explicitly posted to unblock tasks.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //Semaphore.supportsEvents = true;
    Semaphore.supportsEvents = false;
    
    
    
    /* ================ Swi configuration ================ */
    var Swi = xdc.useModule('ti.sysbios.knl.Swi');
    /*
     * A software interrupt is an object that encapsulates a function to be
     * executed and a priority. Software interrupts are prioritized, preempt tasks
     * and are preempted by hardware interrupt service routines.
     *
     * This module is included to allow Swi's in a users' application.
     */
    /*
     * Reduce the number of swi priorities from the default of 16.
     * Decreasing the number of swi priorities yields memory savings.
     */
    Swi.numPriorities = 6;
    
    
    
    /* ================ System configuration ================ */
    var System = xdc.useModule('xdc.runtime.System');
    /*
     * The Abort handler is called when the system exits abnormally.
     *
     * Pick one:
     *  - System.abortStd (default)
     *      Call the ANSI C Standard 'abort()' to terminate the application.
     *  - System.abortSpin
     *      A lightweight abort function that loops indefinitely in a while(1) trap
     *      function.
     *  - A custom abort handler
     *      A user-defined function. See the System module documentation for
     *      details.
     */
    //System.abortFxn = System.abortStd;
    System.abortFxn = System.abortSpin;
    //System.abortFxn = "&myAbortSystem";
    
    /*
     * The Exit handler is called when the system exits normally.
     *
     * Pick one:
     *  - System.exitStd (default)
     *      Call the ANSI C Standard 'exit()' to terminate the application.
     *  - System.exitSpin
     *      A lightweight exit function that loops indefinitely in a while(1) trap
     *      function.
     *  - A custom exit function
     *      A user-defined function. See the System module documentation for
     *      details.
     */
    //System.exitFxn = System.exitStd;
    System.exitFxn = System.exitSpin;
    //System.exitFxn = "&myExitSystem";
    
    /*
     * Minimize exit handler array in the System module. The System module includes
     * an array of functions that are registered with System_atexit() which is
     * called by System_exit(). The default value is 8.
     */
    System.maxAtexitHandlers = 2;
    
    /*
     * Enable System_printf() to display floats.  Use the longer '%f%$L%$S%$F'
     * if your code has SYS/BIOS instrumentation enabled (Asserts/Error/Log),
     * as is typical with the 'debug' profile.
     */
    //System.extendedFormats = '%f%$L%$S%$F';
    System.extendedFormats = '%f%$S';
    
    /*
     * The System.SupportProxy defines a low-level implementation of System
     * functions such as System_printf(), System_flush(), etc.
     *
     * Pick one pair:
     *  - SysMin
     *      This module maintains an internal configurable circular buffer that
     *      stores the output until System_flush() is called.
     *      The size of the circular buffer is set via SysMin.bufSize.
     *  - SysCallback
     *      SysCallback allows for user-defined implementations for System APIs.
     *      The SysCallback support proxy has a smaller code footprint and can be
     *      used to supply custom System_printf services.
     *      The default SysCallback functions point to stub functions. See the
     *      SysCallback module's documentation.
     */
    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    SysMin.bufSize = 1024;
    System.SupportProxy = SysMin;
    //var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
    //System.SupportProxy = SysCallback;
    //SysCallback.abortFxn = "&myUserAbort";
    //SysCallback.exitFxn  = "&myUserExit";
    //SysCallback.flushFxn = "&myUserFlush";
    //SysCallback.putchFxn = "&myUserPutch";
    //SysCallback.readyFxn = "&myUserReady";
    
    
    
    /* ================ Task configuration ================ */
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    /*
     * Check task stacks for overflow conditions.
     *
     * Pick one:
     *  - true (default)
     *      Enables runtime checks for task stack overflow conditions during
     *      context switching ("from" and "to")
     *  - false
     *      Disables runtime checks for task stack overflow conditions.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //Task.checkStackFlag = true;
    Task.checkStackFlag = false;
    
    /*
     * Set the default task stack size when creating tasks.
     *
     * The default is dependent on the device being used. Reducing the default stack
     * size yields greater memory savings.
     */
    Task.defaultStackSize = 512;
    
    /*
     * Enables the idle task.
     *
     * Pick one:
     *  - true (default)
     *      Creates a task with priority of 0 which calls idle hook functions. This
     *      option must be set to true to gain power savings provided by the Power
     *      module.
     *  - false
     *      No idle task is created. This option consumes less memory as no
     *      additional default task stack is needed.
     *      To gain power savings by the Power module without having the idle task,
     *      add Idle.run as the Task.allBlockedFunc.
     */
    Task.enableIdleTask = true;
    //Task.enableIdleTask = false;
    //Task.allBlockedFunc = Idle.run;
    
    /*
     * If Task.enableIdleTask is set to true, this option sets the idle task's
     * stack size.
     *
     * Reducing the idle stack size yields greater memory savings.
     */
    Task.idleTaskStackSize = 512;
    
    /*
     * Reduce the number of task priorities.
     * The default is 16.
     * Decreasing the number of task priorities yield memory savings.
     */
    Task.numPriorities = 16;
    
    
    
    /* ================ Text configuration ================ */
    var Text = xdc.useModule('xdc.runtime.Text');
    /*
     * These strings are placed in the .const section. Setting this parameter to
     * false will save space in the .const section. Error, Assert and Log messages
     * will print raw ids and args instead of a formatted message.
     *
     * Pick one:
     *  - true (default)
     *      This option loads test string into the .const for easier debugging.
     *  - false
     *      This option reduces the .const footprint.
     */
    //Text.isLoaded = true;
    Text.isLoaded = false;
    
    
    
    /* ================ Types configuration ================ */
    var Types = xdc.useModule('xdc.runtime.Types');
    /*
     * This module defines basic constants and types used throughout the
     * xdc.runtime package.
     */
    
    
    
    /* ================ Application Specific Instances ================ */
    
    /* ================ Diagnostics configuration ================ */
    //var Diags = xdc.useModule('xdc.runtime.Diags');
    /*
     * You use the Diags module to set and clear bits in a module's diagnostics
     * mask for the purpose of controlling diagnostics within that module. A
     * module diagnostics mask controls both Assert and Log statements
     * within that module, disabling these statements yields
     * code savings.
     */
    
    /* ================ Logging configuration ================ */
    //var Log = xdc.useModule('xdc.runtime.Log');
    /*
     * Modules and the application code generate Log_Event events by calling
     * the Log module's functions.
     * Disabling all Log statements here will allow the optimizer to completely
     * remove all Log code from the application.
     *
     * Note: In order to generate Log events in your application both the Diags
     *       and the Log mask must be set. See the SYS/BIOS API guide for
     *       more information.
     */
    
    /*
     * LoggingSetup configures TI-RTOS modules to capture user-specified information
     * such as CPU Load, Task Load and Task Execution so that it can be
     * displayed by System Analyzer.
     */
    //var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    //LoggingSetup.loadLoggerSize = 256;
    //LoggingSetup.mainLoggerSize = 512;
    //LoggingSetup.sysbiosLoggerSize = 1024;
    
    /* ================ Main configuration ================ */
    var Main = xdc.useModule('xdc.runtime.Main');
    /*  Configuration of this Main module is used for all code not in a module */
    
    
    
    /* ================ POSIX configuration ================ */
    var Settings = xdc.useModule('ti.posix.tirtos.Settings');
    
    if (Program.build.target.$name.match(/iar/)) {
        /* 
         * For the IAR target, the 'ti.posix.tirtos.Settings' uses the
         * MultithreadSupport module. By default, the MultithreadSupport module
         * use the '--threaded_lib' library which provides a separate 'errno'
         * per thread and makes other rts libraries reentrant. This library has
         * a larger footprint which can be a problem for some apps, so we
         * override the default and disable it here.
         */
        var MultithreadSupport = 
            xdc.useModule('ti.sysbios.rts.iar.MultithreadSupport');
        MultithreadSupport.enableMultithreadSupport = false;
    }
    
    
    /* ================ Event configuration ================ */
    var Event = xdc.useModule('ti.sysbios.knl.Event');
    
    
    
    /* ================ Mailbox configuration ================ */
    var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');
    



  2. 我们偶尔会遇到闪存和启动调试会话的问题。 通常(并非总是如此)、它将使用用于 SPI 的 TI 驱动程序内的 PC 地址触发硬故障。 在这种情况下、它会经历中止序列、固件会挂起。 但是、如果我们停止调试会话并简单地对器件进行下电上电、我们的固件就可以正常运行而不会挂起。 新的闪存/调试会话是否会导致某些差异?





    我们的.syscfg 文件:
    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "CC1352P1F3RGZ" --package "RGZ" --part "Default" --product "simplelink_cc13x2_26x2_sdk@5.20.00.52"
     * @versions {"data":"2021060817","timestamp":"2021060817","tool":"1.8.2+1992","templates":null}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const CCFG      = scripting.addModule("/ti/devices/CCFG");
    const Board     = scripting.addModule("/ti/drivers/Board");
    const GPIO      = scripting.addModule("/ti/drivers/GPIO");
    const GPIO1     = GPIO.addInstance();
    const GPIO2     = GPIO.addInstance();
    const GPIO3     = GPIO.addInstance();
    const GPIO4     = GPIO.addInstance();
    const GPIO5     = GPIO.addInstance();
    const I2C       = scripting.addModule("/ti/drivers/I2C", {}, false);
    const I2C1      = I2C.addInstance();
    const Power     = scripting.addModule("/ti/drivers/Power");
    const RTOS      = scripting.addModule("/ti/drivers/RTOS");
    const SPI       = scripting.addModule("/ti/drivers/SPI", {}, false);
    const SPI1      = SPI.addInstance();
    const Watchdog  = scripting.addModule("/ti/drivers/Watchdog", {}, false);
    const Watchdog1 = Watchdog.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    CCFG.enableDCDC         = false;
    CCFG.ccfgTemplate.$name = "ti_devices_CCFGTemplate0";
    
    Board.generateInitializationFunctions = false;
    
    GPIO1.$name             = "GPIO_RS485_TXEN";
    GPIO1.gpioPin.$assign   = "10";
    GPIO1.pinInstance.$name = "CONFIG_PIN_0";
    
    GPIO2.$name             = "GPIO_NFC_GPO";
    GPIO2.pull              = "Pull Up";
    GPIO2.interruptTrigger  = "Falling Edge";
    GPIO2.callbackFunction  = "ST25DVXXK_NFC_GPO_Callback";
    GPIO2.gpioPin.$assign   = "11";
    GPIO2.pinInstance.$name = "CONFIG_PIN_1";
    
    GPIO3.$name              = "GPIO_OLED_DISPLAY_RS";
    GPIO3.mode               = "Output";
    GPIO3.initialOutputState = "High";
    GPIO3.gpioPin.$assign    = "14";
    GPIO3.pinInstance.$name  = "CONFIG_PIN_5";
    
    GPIO4.$name             = "GPIO_OLED_DISPLAY_DC";
    GPIO4.mode              = "Output";
    GPIO4.gpioPin.$assign   = "15";
    GPIO4.pinInstance.$name = "CONFIG_PIN_6";
    
    GPIO5.$name             = "GPIO_OLED_DISPLAY_CS";
    GPIO5.mode              = "Output";
    GPIO5.gpioPin.$assign   = "32";
    GPIO5.pinInstance.$name = "CONFIG_PIN_7";
    
    I2C1.$name                = "I2C_MULTI";
    I2C1.maxBitRate           = 100000;
    I2C1.i2c.sdaPin.$assign   = "30";
    I2C1.i2c.sclPin.$assign   = "29";
    I2C1.sdaPinInstance.$name = "CONFIG_PIN_8";
    I2C1.clkPinInstance.$name = "CONFIG_PIN_9";
    
    Power.enablePolicy      = false;
    Power.calibrateRCOSC_HF = false;
    Power.calibrateRCOSC_LF = false;
    Power.calibrateFunction = "PowerCC26XX_noCalibrate";
    
    SPI1.minDmaTransferSize    = 0;
    SPI1.$name                 = "SPI_OLED_DISPLAY";
    SPI1.spi.sclkPin.$assign   = "28";
    SPI1.spi.misoPin.$assign   = "43";
    SPI1.spi.mosiPin.$assign   = "27";
    SPI1.sclkPinInstance.$name = "CONFIG_PIN_2";
    SPI1.misoPinInstance.$name = "CONFIG_PIN_3";
    SPI1.mosiPinInstance.$name = "CONFIG_PIN_4";
    
    Watchdog1.$name = "WATCHDOG";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    I2C1.i2c.$suggestSolution              = "I2C0";
    SPI1.spi.$suggestSolution              = "SSI0";
    SPI1.spi.dmaRxChannel.$suggestSolution = "DMA_CH3";
    SPI1.spi.dmaTxChannel.$suggestSolution = "DMA_CH4";
    Watchdog1.watchdog.$suggestSolution    = "WDT0";
    


    我们用于调试的.launch 文件:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging">
    <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.CC1352P1F3.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M4_0" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <PropertyValues>
    
      <property id="ConnectOnStartup">
        <curValue>1</curValue>
      </property>
    
      <property id="EnableInstalledBreakpoint">
        <curValue>1</curValue>
      </property>
    
      <property id="IgnoreSoftLaunchFailures">
        <curValue>0</curValue>
      </property>
    
    </PropertyValues>
    "/>
    <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.CC1352P1F3.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M4_0" value="${build_artifact:aq2}"/>
    <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.CC1352P1F3.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M4_0" value="aq2"/>
    <stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:aq2}"/>
    <stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.CC1352P1F3.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M4_0" value="C:\derrick_workspace\git\aq2_cc13x2\Debug\aq2.out"/>
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
    <listEntry value="/aq2"/>
    </listAttribute>
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
    <listEntry value="4"/>
    </listAttribute>
    <stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/>
    <stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <sourceLookupDirector>
    <sourceContainers duplicates="false">
    <container memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <default/>
    " typeId="org.eclipse.debug.core.containerType.default"/>
    <container memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <cpuSpecificContainer cpuName="Texas Instruments XDS110 USB Debug Probe/Cortex_M4_0">
    <childContainerEntry childMemento="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <project name="aq2" referencedProjects="true"/>
    " childType="org.eclipse.debug.core.containerType.project"/>
    <childContainerEntry childMemento="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <default/>
    " childType="org.eclipse.debug.core.containerType.default"/>
    <childContainerEntry childMemento="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <productsSource/>
    " childType="com.ti.ccstudio.debug.containerType.products.source"/>
    <childContainerEntry childMemento="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <deviceLibrarySource/>
    " childType="com.ti.ccstudio.debug.containerType.device.library.source"/>
    <childContainerEntry childMemento="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <librarySource/>
    " childType="com.ti.ccstudio.debug.containerType.library.source"/>
    </cpuSpecificContainer>
    " typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/>
    </sourceContainers>
    </sourceLookupDirector>
    "/>
    </launchConfiguration>


  3. 调试器尝试连接/闪存时会出现偶发问题、无法判断 事件的顺序导致了该问题或暂时修复了该问题。 我们已经尝试将 JTAG TCLK 频率从5.5MHz 一直降低到2.5MHz、没有任何差异。



    以下是我们的.ccxml 目标配置文件:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <configurations XML_version="1.2" id="configurations_0">
        <configuration XML_version="1.2" id="configuration_0">
            <instance XML_version="1.2" desc="Texas Instruments XDS110 USB Debug Probe" href="connections/TIXDS110_Connection.xml" id="Texas Instruments XDS110 USB Debug Probe" xml="TIXDS110_Connection.xml" xmlpath="connections"/>
            <connection XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe">
                <instance XML_version="1.2" href="drivers/tixds510icepick_c.xml" id="drivers" xml="tixds510icepick_c.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers/tixds510cs_dap.xml" id="drivers" xml="tixds510cs_dap.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers/tixds510cortexM.xml" id="drivers" xml="tixds510cortexM.xml" xmlpath="drivers"/>
                <property Type="choicelist" Value="0" id="Power Selection">
                    <choice Name="Probe supplied power" value="1">
                        <property Type="stringfield" Value="3.3" id="Voltage Level"/>
                    </choice>
                </property>
                <property Type="choicelist" Value="0" id="JTAG Signal Isolation"/>
                <property Type="choicelist" Value="4" id="SWD Mode Settings">
                    <choice Name="cJTAG (1149.7) 2-pin advanced modes" value="enable">
                        <property Type="choicelist" Value="1" id="XDS110 Aux Port"/>
                    </choice>
                </property>
                <platform XML_version="1.2" id="platform_0">
                    <instance XML_version="1.2" desc="CC1352P1F3" href="devices/cc1352p1f3.xml" id="CC1352P1F3" xml="cc1352p1f3.xml" xmlpath="devices"/>
                </platform>
            </connection>
        </configuration>
    </configurations>
    


  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Derrick、

    很抱歉我的答复很晚。  

    要获得调试的最佳内核配置、请使用路径"simplelink_cc13x2_26x2_sdk\kernel\tirtos\builds\cc13x2_cc26x2\debug"中的 debug.cfg 文件。


    关于调试会话的开始、您能否尝试从 Code Composer Studio 调试工具栏中复位的下拉菜单中选择"Board Reset"、而不是重启电源并运行固件、并检查其是否有用。  
    此外、以下链接中有关 CPU 异常的部分也是处理此类错误的好资源。

    https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/ble5stack/ble_user_guide/html/ble-stack-5.x-guide/debugging-index.html#deciphering-cpu-exceptions

     
    关于 JTAG 错误、似乎是硬件问题、您能否提供有关硬件设置的详细信息? 是 Launchpad 还是定制板?

    此致、
    Siddanth

     

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我从您建议的位置将.cfg 替换为 debug.cfg。 我进行了最少 3次更改、以便与 OUT 项目设置兼容。

    Clock.tickPeriod = 1000;
    
    Defaults.common$.namedModule = true;
    //Defaults.common$.namedModule = false;
    
    Task.numPriorities = 16;

    现在、当我遇到与原始帖子相同的硬故障时、我将看到其他调试信息打印到控制台。 这是用于诊断目的的改进、但硬故障仍然是一个问题。 我按照 "解密 CPU 异常"链接中的指令、 在发生故障时获得更准确的信息、但总体原因仍然不明、因为它被埋在 TI-Drivers 中、而不是我们的代码中。 任务的调用栈仍然为空、因为它们在我的原始帖子中、并且立即调用栈也不显示任何内容(未定义任何符号)。 我们使用 SPI 来驱动显示屏、因此 在 SPICC26X2DMA_hwiFxn ()内发生故障并不奇怪、如下所示、但我们不直接与 DMA 交互、而是通过 TI-Drivers 和 SysConfig 进行接口来管理。

    生成此故障的唯一一致性是、无论是否通过 CCS 中的调试会话、还是通过 SmartRF Flash Programmer、该故障似乎仅在固件刷写后发生。 在上述任一情况后重启电源似乎可以避免故障、并且我们的固件正常运行。  从这里、我们可以通过仅加载符号而不刷写固件来在 CCS 中运行调试会话。

    此外、我们还在自己的定制板上运行、并使用 TI XDS110调试探针。  这里是我们的目标板的连接。

    这是来自 XDS110的接口。

    至于复位、这些是我看到的唯一选项。

    当我选择恢复时、在发生上述硬故障后选择 CPU 复位或电路板复位仍然会导致相同的硬故障。 但是、如果我选择"系统重置"、则无论是否发生硬故障(即闪存固件、循环通电、加载符号)、控制台中都会出现以下错误。

    Cortex_M4_0: GEL Output: Memory Map Initialization Complete.
    Cortex_M4_0: Flashloader: Verbose output enabled.
    Cortex_M4_0: Failed System Reset: (Error -2063 @ 0x0) Unable to reset device. Power-cycle the board. If error persists, confirm configuration and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.4.0.00129) 
    Cortex_M4_0: Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.4.0.00129) 
    Cortex_M4_0: Unable to determine target status after 20 attempts
    Cortex_M4_0: Failed to remove the debug state from the target before disconnecting.  There may still be breakpoint op-codes embedded in program memory.  It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    作为测试、您是否也可以检查 LaunchPad 上的固件、以查看是否重现了相同的问题?

    我将咨询 Rnd 以检查此异常的可能原因、并返回给您。

    此致、

    Siddanth   

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我们有一个 LAUNCHXL-CC1351P1板、并将 I/O 接头引脚与目标板之间的导线连接在一起。  我加载并运行了我们的固件几次、在我运行调试会话时、可能会重现几乎100%的相同硬故障。 产生总线故障的 PC 值和地址与我之前的帖子相同。

    如果为传感器控制器添加一些新生成的代码、我注意到、有时会在新添加的代码中生成总线故障。 背靠背运行多个调试会话将生成上述或下面的故障。 我没有注意到一种模式是为什么或何时执行一种模式、它看起来是随机的。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    在本例中、您是否在 Launchpad 上运行代码尚不清楚。 I/O 接头与定制板上的传感器、显示屏等之间的导线是否连接?

    是否可以重现您在我们身边看到的内容?  

    硬故障通常由内存问题引起、通常是 NULL 指针、堆栈大小不足或类似问题、这会导致程序计数器进入未定义的内存空间。 尽管看起来它与 SPI 相关、但它可能是另一种情况。  

    是否可以逐步简化代码(或者更好的方法是从 main 开始、然后按任务添加任务)、以查看您所做的从工作到不工作(或其他方法)的更改

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    重新阅读您的部分最新答复:如果您使用传感器控制器时发现问题、但它在其他情况下工作正常:  

    您是否在 CM4和传感器控制器之间共享资源、这会导致冲突?  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    是的、代码在我之前发布的 LAUNCHXL-CC1351P1上运行。 我们将 Launchpad 上的 I/O 接头连接到目标板上的传感器、显示屏等。 在这种情况下、我们的目标板上没有焊接 CC1351P1。  我之前的开机自检中的总线故障来自该设置。 无论我们使用 Launchpad 还是仅使用目标板 、在 SPI 驱动器中生成的总线故障几乎完全相同(相同的 PC 值0x0001766c 和0x08f3854c 的无效存储寄存器地址)。 我同意它看起来与 SPI 无关、因为 有时总线故障现在出现在传感器控制器代码中。

    此后、我们尝试删除了运行显示器( 使用 SPI)的任务。 在这种情况 下、当我们刷写固件并启动调试会话时、我们停止看到任何总线故障、但请注意传感器控制器无法正常工作。 它在信标上一直挂起。 如果我们对电路板进行下电上电、则电路板工作正常、同一个信号量也不会挂起。

    在目前的每种情况下、我们只会在刷写固件后立即看到这些独特的问题。 重启电源后、我们没有注意到这些问题。  我们将尝试增加主堆栈、任务堆栈和堆、以查看这是否可以解决问题。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您是否在 CCS 中使用过 ROV 来检查堆栈大小等?

    在本例中、我不理解的是、当连接调试器时、您似乎遇到问题、而不是其他问题。 连接调试器后、JTAG 域被强制打开、芯片在待机模式下不会下降。 出于某种原因、这会导致问题吗? 如果系统可以在待机状态下运行、有何不同?  

    不幸的是、如果没有代码和硬件来运行代码、调试所看到的内容会有点困难。   

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="66607" URL"~/support/wireless-connectivity/other-wireless-group/other-wireless/f/other-wireless-technologies-forum/1046567/cc1352p-ti-rtos-abort-assert-no-debug-info-hard-fault-only-after-flashing/3879307 #3879307"]您是否在 CCS 中使用了 ROV 来检查堆栈大小等?

    这是发生硬故障时的 ROV。 我尝试将每个任务的堆栈大小增加1024字节、并将主系统堆栈从2048字节增加到4096字节。 仍然出现硬故障。 另一件使调试工作变得困难的事情是、即使固件运行正常、ROV 中的 CallStacks 视图也根本无法正常工作。 如下面所示、它始终为空(或者如果我使用 ROV Classic、则会显示"symbol not available under each task (每个任务下都没有可用的符号)")。 是否有一些配置设置缺失以纠正此问题的想法?

    [引用 userid="66607" URL"~/support/wireless-connectivity/other-wireless-group/other-wireless/f/other-wireless-technologies-forum/1046567/cc1352p-ti-rtos-abort-assert-no-debug-info-hard-fault-only-after-flashing/3879307 #3879307"]

    在本例中、我不理解的是、当连接调试器时、您似乎遇到问题、而不是其他问题。 连接调试器后、JTAG 域被强制打开、芯片在待机模式下不会下降。 出于某种原因、这会导致问题吗? 如果系统可以在待机状态下运行、有何不同?  

    [/报价]

    这与我们想知道的情况相同。 电源管理器/TI-RTOS 是否存在我们可能刚刚意识到的任何复杂问题?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    此外、我在 BIOS >扫描错误下注意到这一点。 这些错误是否合法?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    检查 ROV 的 HWI 模块的异常视图可能会很有用。  

    https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/tirtos/sysbios/docs/cdoc/index.html#ti/sysbios/family/arm/m3/Hwi.html#exc.Handler.Func

    您能告诉我们您在该视图中看到了什么吗?  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我通过运行调试会话、暂停、然后发出 CPU 复位(Ctrl+Shift+R)来生成此代码。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    遗憾的是、这些屏幕截图仅包含的信息不足以说明主要问题。 当我遇到 imreciser 错误时、错误消息不能帮助我准确判断出出现了什么问题、因为错误消息通常指向的不是真正的问题。   

    是否可以创建一个示例、以复制您在 Launchpad 上看到的运行情况? SPI 可以与其他 Launchpad 进行通信。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我将在 Launchpad 上尝试。

    另请注意、通过将 XDS110的 nRESET 引脚(15)连接到 CC1352上的 RESET_N 引脚(35)、我们看到了一些改进。 我们的目标配置.ccxmml 已针对2引脚 cJTAG 进行配置:

    1. 我们似乎不再从 SPI TI 驱动程序中获得硬(总线)故障、该故障将在刷写固件并启动调试会话后触发(相反、仅当我们使用 Ctrl + Shift + R 进行 CPU 复位时才会发生总线故障)。
    2. CC1352现在还可以在通过独立的 SmartRF 闪存编程器软件刷写固件后正确复位。

    我还注意到手册中的这个表。 对于 复位引脚、功能复位和测试复位实际上意味着什么? 我们之前在 MSP432P4上使用2引脚 Spy-Bi-Wire 和 MSP-FET、但未连接显式复位引脚、因此我们能够正常开发。 这与 cJTAG 完全不同吗?

    最后、我们需要了解是否应修改电路板设计以适应 XDS110的复位引脚输出。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    据我了解、调试器使用 N_RESET 引脚将芯片设置为定义的状态(另请参阅 https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/proprietary-rf/proprietary-rf-users-guide/proprietary-rf-guide/debugging-index.html#connect-the-debugger-to-a-running-target)。 如果您尚未连接我怀疑有问题的复位引脚、那么您最终会处于未定义状态。

    对于 CC13xx 系列、我始终建议在 XDS 和 DUT 之间至少连接5个引脚:

    VDD、GND、RESET、TMS、TCK

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="411118" URL"~/support/wireless-connectivity/other-wireless-group/other-wireless/f/other-wireless-technologies-forum/1046567/cc1352p-ti-rtos-abort-assert-no-debug-info-hard-fault-only-after-flashing/3877929 #3877929">我们有一个 LAUNCHXL-CC1351P1板、并将 I/O 接头引脚与目标板之间的导线连接在一起。  我加载并运行了我们的固件几次、在我运行调试会话时、可能会重现几乎100%的相同硬故障。 [/报价]

    另一点好奇:我假设您在本例中使用了 Launchpad 上的 XDS110、所有跳线都已就位。 这种假设是否错误?  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    在该设置中、我使用 launchpad 的板载调试器。 我没有使用独立的 XDS110调试探针 www.ti.com/.../TMDSEMU110-U。 我们将导线从 I/O 接头引脚跳至我们的目标硬件、该硬件组装了除 CC1352以外的所有器件。 我在这种情况下按原样运行了我们的固件。

    我现在要做的是从这个示例中的一个全新的完全空项目开始、然后从我们的 SPI/显示任务中逐渐添加非常小的代码:simplelink_cc13x2_26x2_sdk_5_20_00_52\examples\rtos\CC1352p1_LAUNCHXL\drivers\empty\tirtos\ticlang

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Derrick、

    代码的增量添加似乎是正确的方法。 如果不能在此处重现问题、则很难评论导致问题的原因。  

    此致、
    Siddanth

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我还创建了有关ROV 问题的新主题(e2e.ti.com/.../cc1352p-rov-not-working-during-debug-session)、该问题限制了我们的故障排除能力。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    除了 ROV 问题现在被分成一个新的线程:我得到的印象是、在连接复位线之后、您的电路板开始按预期运行。 但这似乎是错误的假设。 您能否总结一下连接重置线路时当前的主要问题是什么?  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    原始方案

    我们的目标硬件和固件目前的主要问题是、当  我们通过 RS-485持续发送目标器件 Modbus 请求(每秒2次)时、SPI 驱动程序(simplelink_cc13xx_cc26xx_sdk_5_30_00_56\source\ti\drivers\spi.h)在一段不确定的时间(大约30秒到3分钟)后挂起。

    状态会卡在 SPI_TRANSFER_Started 状态下、永远不会完成。 我们使用 SPI 来驱动小位图显示。 SPI 配置有 SPI_MODE_CALLBACK、以发布信号量、我们的显示固件会在获取 RAM 中的本地帧缓冲区或通过 SPI 跳过任何命令之前永久挂起该信号量。

    我们的 Modbus 堆栈 使用配置了 Timer_Continuous_callback 的计时器(simplelink_cc13xx_cc26xx_sdk_5_30_00_56\source\ti\drivers\Timer.h)驱动程序来递增时间跟踪变量。 它还使用 UART2 (simplelink_cc13xx_cc26xx_sdk_5_30_00_56\sources\ti\drivers\UART2.h)驱动程序来处理 TX 和 Rx 操作。  

    权变措施

    我更改了显示挂起的信标、如果信标无法开机自检、则使用1秒的超时。  无法开机自检时、我 只需调用 SPI_transferCancel、然后继续正常运行显示固件。 这在不产生额外副作用的情况下似乎可以正常工作、但不能真正解决问题。

    阻止方法

    我尝试使用 SPI_MODE_BLOCKING 来配置 SPI 驱动器、并从我们的显示固件中删除了所有信号量(以防出现此问题)。 SPI 驱动程序不再挂起、但经过一段较长的时间(5到10分钟)后、图形会被损坏。 我不确定如何解释或排除故障、但目标像素仍以某种结构化形式存在(几乎像应相邻的像素现在以几个像素为间隔)。 同样、由于调试器停止工作、因此很难进行故障排除。 即使在重新启动程序后、CCS 也会冻结、我无法连接到器件并启动调试会话(仅加载符号)。 除了显示屏损坏之外、我们设备上的所有其他组件似乎都可以正常工作。 我可以私下向您发送显示损坏的照片、如果这样做有所帮助。

    LaunchPad 娱乐

    如果按原样移植固件、我可以在 Launchpad 上重新创建问题。 我尝试从一个裸示例项目开始、缓慢地添加小增量代码、以模仿我们的固件使用 SPI、计时器和 UART2驱动程序的方式、但无法明显地重现问题。 我可以继续在该测试代码的基础上进行构建、直到它与我们的目标固件更接近、但这非常耗时。 此时、我尝试对目标硬件和固件进行修复(如上所述)、以查看最终是否只是问题 如果可以接受、我们的团队愿意向您发送目标固件以供审核。 有什么想法?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Derrick、

    请提供您正在使用的 SPI 驱动程序实例的所有参数。
    2.要弄清楚的一个重要问题是 SPI 传输发生故障的时间点。
    一种调试方法是获取事务的逻辑分析仪跟踪。 这将使我们能够检查交易何时发生故障。 或者 它只是未触发回调。  

    此致、
    Siddanth

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    这里是 SysConfig 的 SPI 和 UART 2 (用于 RS-485)配置:

    /*
     *  =============================== SPI DMA ===============================
     */
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/spi/SPICC26X2DMA.h>
    
    #define CONFIG_SPI_COUNT 1
    
    /*
     *  ======== spiCC26X2DMAObjects ========
     */
    SPICC26X2DMA_Object spiCC26X2DMAObjects[CONFIG_SPI_COUNT];
    
    /*
     *  ======== spiCC26X2DMAHWAttrs ========
     */
    const SPICC26X2DMA_HWAttrs spiCC26X2DMAHWAttrs[CONFIG_SPI_COUNT] = {
        /* SPI_OLED_DISPLAY */
        {
            .baseAddr = SSI0_BASE,
            .intNum = INT_SSI0_COMB,
            .intPriority = (~0),
            .swiPriority = 0,
            .powerMngrId = PowerCC26XX_PERIPH_SSI0,
            .defaultTxBufValue = ~0,
            .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
            .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
            .minDmaTransferSize = 0,
            .mosiPin = IOID_17,
            .misoPin = IOID_30,
            .clkPin  = IOID_18,
            .csnPin  = PIN_UNASSIGNED
        },
    };
    
    /*
     *  ======== SPI_config ========
     */
    const SPI_Config SPI_config[CONFIG_SPI_COUNT] = {
        /* SPI_OLED_DISPLAY */
        {
            .fxnTablePtr = &SPICC26X2DMA_fxnTable,
            .object = &spiCC26X2DMAObjects[SPI_OLED_DISPLAY],
            .hwAttrs = &spiCC26X2DMAHWAttrs[SPI_OLED_DISPLAY]
        },
    };
    
    const uint_least8_t SPI_OLED_DISPLAY_CONST = SPI_OLED_DISPLAY;
    const uint_least8_t SPI_count = CONFIG_SPI_COUNT;

    /*
     *  =============================== UART2 ===============================
     */
    
    #include <ti/drivers/UART2.h>
    #include <ti/drivers/uart2/UART2CC26X2.h>
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26X2.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_memmap.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_ints.h>
    
    #define CONFIG_UART2_COUNT 2
    
    UART2CC26X2_Object uart2CC26X2Objects[CONFIG_UART2_COUNT];
    
    static unsigned char uart2RxRingBuffer0[32];
    static unsigned char uart2TxRingBuffer0[32];
    static unsigned char uart2RxRingBuffer1[64];
    static unsigned char uart2TxRingBuffer1[512];
    
    static const UART2CC26X2_HWAttrs uart2CC26X2HWAttrs[CONFIG_UART2_COUNT] = {
      {
        .baseAddr           = UART1_BASE,
        .intNum             = INT_UART1_COMB,
        .intPriority        = (~0),
        .rxPin              = IOID_15,
        .txPin              = IOID_16,
        .ctsPin             = PIN_UNASSIGNED,
        .rtsPin             = PIN_UNASSIGNED,
        .flowControl        = UART2_FLOWCTRL_NONE,
        .rxBufPtr           = uart2RxRingBuffer0,
        .rxBufSize          = sizeof(uart2RxRingBuffer0),
        .txBufPtr           = uart2TxRingBuffer0,
        .txBufSize          = sizeof(uart2TxRingBuffer0),
        .rxChannelMask      = 1 << UDMA_CHAN_UART1_RX,
        .txChannelMask      = 1 << UDMA_CHAN_UART1_TX,
        .txIntFifoThr       = UART2CC26X2_FIFO_THRESHOLD_1_8,
        .rxIntFifoThr       = UART2CC26X2_FIFO_THRESHOLD_4_8
      },
      {
        .baseAddr           = UART0_BASE,
        .intNum             = INT_UART0_COMB,
        .intPriority        = 0xc0,
        .rxPin              = IOID_12,
        .txPin              = IOID_13,
        .ctsPin             = PIN_UNASSIGNED,
        .rtsPin             = PIN_UNASSIGNED,
        .flowControl        = UART2_FLOWCTRL_NONE,
        .rxBufPtr           = uart2RxRingBuffer1,
        .rxBufSize          = sizeof(uart2RxRingBuffer1),
        .txBufPtr           = uart2TxRingBuffer1,
        .txBufSize          = sizeof(uart2TxRingBuffer1),
        .rxChannelMask      = 1 << UDMA_CHAN_UART0_RX,
        .txChannelMask      = 1 << UDMA_CHAN_UART0_TX,
        .txIntFifoThr       = UART2CC26X2_FIFO_THRESHOLD_1_8,
        .rxIntFifoThr       = UART2CC26X2_FIFO_THRESHOLD_1_8
      },
    };
    
    const UART2_Config UART2_config[CONFIG_UART2_COUNT] = {
        {   /* UART_MFG */
            .object      = &uart2CC26X2Objects[UART_MFG],
            .hwAttrs     = &uart2CC26X2HWAttrs[UART_MFG]
        },
        {   /* UART_RS485 */
            .object      = &uart2CC26X2Objects[UART_RS485],
            .hwAttrs     = &uart2CC26X2HWAttrs[UART_RS485]
        },
    };
    
    const uint_least8_t UART_MFG_CONST = UART_MFG;
    const uint_least8_t UART_RS485_CONST = UART_RS485;
    const uint_least8_t UART2_count = CONFIG_UART2_COUNT;

    下面是我们的代码的初始化:

        static struct {
            SPI_Handle hdl;
            SPI_Transaction xfer;
        } m_spi;
        SPI_Params spiParams;
    
        // Initialize SPI driver.
        SPI_init();
    
        // Configure SPI parameters.
        SPI_Params_init(&spiParams);
        spiParams.transferMode = SPI_MODE_BLOCKING;
        spiParams.transferTimeout = 3000;
        spiParams.transferCallbackFxn = _txCb;
        spiParams.mode = SPI_MASTER;
        spiParams.bitRate = MBITS(3);
        spiParams.dataSize = 8;
        spiParams.frameFormat = SPI_POL0_PHA0;
        spiParams.custom = NULL;
    
        m_spi.hdl = SPI_open(SPI_OLED_DISPLAY, &spiParams);

        Semaphore_Params semaParams;
        UART2_Params rs485UARTParams = {
                UART2_Mode_NONBLOCKING, /*!< Mode for all read calls */
                UART2_Mode_NONBLOCKING, /*!< Mode for all write calls */
                NULL,                   /*!< Pointer to read callback function for callback mode. */
                NULL,                   /*!< Pointer to write callback function for callback mode. */
                _RS485_eventCb,         /*!< Pointer to event callback function. */
                UART2_EVENT_TX_BEGIN | UART2_EVENT_TX_FINISHED,
                                        /*!< mask of events that the application is interested in */
                UART2_ReadReturnMode_FULL,
                                        /*!< Receive return mode */
                baud,                   /*!< Baud rate for UART */
                UART2_DataLen_8,        /*!< Data length for UART */
                nStopBits,              /*!< Stop bits for UART */
                parity,                 /*!< Parity bit type for UART */
                NULL                    /*!< User supplied argument for callback functions */
        };
    
        // Disable RS-485 tx.
        IOCPinTypeGpioOutput(RS485_TX_ENABLE_IOID);
        GPIO_clearDio(RS485_TX_ENABLE_DIO_NUM);
        // Initialize RS-485 UART.
        m_uart = UART2_open(UART_RS485, &rs485UARTParams);
        C_ASSERT(m_uart != NULL);
        // Enable receiver.
        UART2_rxEnable(m_uart);

    2.参考我的原始帖子、 如果    SPI_transfer 返回超时、则通过添加对 SPI_transferCancel 的调用来解决阻塞方法的显示损坏问题。 这使我们回到了 SPI 传输(仲裁)挂起的原始问题、无论它是处于回调模式还是阻塞模式。

    当使用 Launchpad 发生问题时、我有一个 SPI 和 UART/RS-485线路的逻辑分析仪捕获。 以下是缩小后的捕获、它只会停止响应:

    放大突出显示区域:

    我注意到的唯一尴尬情况是、在 SPI 事务的最末尾、有一个很小的间隙"暂停"、然后再传输最后9个字节。 我在以前的任何交易中都找不到这种情况

    同样、当该问题发生时、SPI_Transaction 结构最终会显示 SPI_TRANSFER_Started 状态、并永久保持该状态。 如果我在 阻塞模式下超时(或回调模式下信号量上的超时)后强制调用 SPI_transferCancel 并继续运行显示代码、则显示屏和系统的其余部分似乎可以正常运行、而不会产生任何副作用。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Derrick、

    我将联系驾驶员团队并告知您他们对此问题的反馈。  

    此致、

    Siddanth

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢你。 就像另一个数据点一样、 大多数 SPI/ 显示代码之前在 MSP432P401R 中实现、并未出现此问题。 我们尝试仅进行必要的更改、以便使用 CC1352的库/驱动程序。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Derrick、

    将问题与这些屏幕截图隔离是非常困难的。 我们需要一些使用 SPI 和您正在使用的显示屏的代码示例或最小软件。  如果您能够以极少的示例重现问题、我们可以复制问题并提出更改建议。


    由于问题似乎与 SPI 有关、请暂时忽略 UART 等其他组件。 我们首先需要确定 SPI 驱动程序是否存在错误。 如果没有、那么这可能更多地是实现问题、我们可能会指导您为不同的外设找到正确的设置。

    此致、

    Siddanth

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    只有当另一个 UART 正在主动发送/接收数据时才会出现此问题、否则没有任何问题需要解决。 SPI 和 UART 在单独的任务中运行、不应按照我们的理解进行交互。 由于 TI-RTOS 和 TI-Drivers 下运行的代码太多、并且 ROV 被置位(任务视图根本不起作用、并且已在您的官方错误跟踪器中被接受)、我们需要更多的支持来了解哪些可能导致 SPI 驱动程序冻结。 同样、我们在 MSP432上没有遇到此问题。 如果需要、我们可以发送我们的代码进行审查、并在必要时将其删除、以便更易于理解。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Derrick、  

    我怀疑可能存在一些竞争情况或对外设的非法访问。 查看您的代码可能是一种找到问题底部的好方法。 我将通过 E2E 聊天与您联系、讨论如何获取代码。  

    此致、

    Siddanth