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.

CS_DAP_0 on Tiva TM4C129ENCPDT

Other Parts Discussed in Thread: TM4C129ENCPDT, SYSBIOS

Hi all,

Today I attempted to program my TM4C129ENCPDT with the mutex example provided in the TI-RTOS for TivaC. It was not modified, only run and an attempted debugging. However, I got the following error: CS_DAP_0 (Error -260 @ 0x0). This has happened on two separate computers, and I am able to connect and debug on my MSP432 board as well as run a driverlib-based program on the TivaC from the same computer. Is this a known issue, or is there something special that I'm not doing for the TI-RTOS based examples?

Thanks in advance!

  • Hello Cody

    What was the code on TI RTOS? My bet based on an early description. the issue happens around system clock configuration?

    Regards
    Amit
  • Here is "mutex.c"

    /*
    * Copyright (c) 2015-2016, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */

    /*
    * ======== mutex.c ========
    */

    /* XDC module Headers */
    #include <xdc/std.h>
    #include <xdc/runtime/System.h>

    /* BIOS module Headers */
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Clock.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Semaphore.h>

    /* Example/Board Header files */
    #include "Board.h"

    #define TASKSTACKSIZE 512

    Void task1Fxn(UArg arg0, UArg arg1);
    Void task2Fxn(UArg arg0, UArg arg1);

    Int resource = 0;
    Int finishCount = 0;
    UInt32 sleepTickCount;

    Task_Struct task1Struct, task2Struct;
    Char task1Stack[TASKSTACKSIZE], task2Stack[TASKSTACKSIZE];
    Semaphore_Struct semStruct;
    Semaphore_Handle semHandle;

    /*
    * ======== main ========
    */
    Int main()
    {
    /* Construct BIOS objects */
    Task_Params taskParams;
    Semaphore_Params semParams;

    /* Call board init functions */
    Board_initGeneral();

    /* Construct writer/reader Task threads */
    Task_Params_init(&taskParams);
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task1Stack;
    taskParams.priority = 1;
    Task_construct(&task1Struct, (Task_FuncPtr)task1Fxn, &taskParams, NULL);

    taskParams.stack = &task2Stack;
    taskParams.priority = 2;
    Task_construct(&task2Struct, (Task_FuncPtr)task2Fxn, &taskParams, NULL);

    /* Construct a Semaphore object to be use as a resource lock, inital count 1 */
    Semaphore_Params_init(&semParams);
    Semaphore_construct(&semStruct, 1, &semParams);

    /* Obtain instance handle */
    semHandle = Semaphore_handle(&semStruct);

    /* We want to sleep for 10000 microseconds */
    sleepTickCount = 10000 / Clock_tickPeriod;

    BIOS_start(); /* Does not return */
    return(0);
    }

    /*
    * ======== task1Fxn ========
    */
    Void task1Fxn(UArg arg0, UArg arg1)
    {
    UInt32 time;

    for (;;) {
    System_printf("Running task1 function\n");

    if (Semaphore_getCount(semHandle) == 0) {
    System_printf("Sem blocked in task1\n");
    }

    /* Get access to resource */
    Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);

    /* Do work by waiting for 2 system ticks to pass */
    time = Clock_getTicks();
    while (Clock_getTicks() <= (time + 1)) {
    ;
    }

    /* Do work on locked resource */
    resource += 1;
    /* Unlock resource */

    Semaphore_post(semHandle);

    Task_sleep(sleepTickCount);
    }
    }

    /*
    * ======== task2Fxn ========
    */
    Void task2Fxn(UArg arg0, UArg arg1)
    {
    for (;;) {
    System_printf("Running task2 function\n");

    if (Semaphore_getCount(semHandle) == 0) {
    System_printf("Sem blocked in task2\n");
    }

    /* Get access to resource */
    Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);

    /* Do work on locked resource */
    resource += 1;
    /* Unlock resource */

    Semaphore_post(semHandle);

    Task_sleep(sleepTickCount);

    finishCount++;
    if (finishCount == 5) {
    System_printf("Calling BIOS_exit from task2\n");
    BIOS_exit(0);
    }
    }
    }
  • Hello Cody,

    You need to be more precise. Where during a step debug does the lock out occur?

    Regards
    Amit
  • That's the thing, I can't even hit the main function.
  • Hello Cody,

    I am moving it to the TI RTOS forum where you would could specific information regarding RTOS projects

    Regards
    Amit
  • Hi Cody,

    I will look more into your issue. Can you let me know what can of board you are using? Is it a custom board or one of our Launchpads?

    Regards,
    Gilbert
  • Hi Cody,

    Apologies for the delay. I tried running the mutex example on one of our Tiva launchpads, and it seemed to work fine. Can you confirm for me if the issue is only occurring on this mutex example or is is occurring for other TIRTOS examples? Also, are you importing the examples through the CCS Resource Explorer?

    Regards,
    Gilbert
  • Sorry for the delay, and thanks for the great response.

    Yes, the issue seems to be across multiple RTOS example projects - I verified by attempting to use the swi example and the same error occurred (by using the CCS resource explorer - under projects, examples and Tiva TM4C129ENCPDT). This is the error:

    Error connecting to the target:
    (Error -260 @ 0x0)
    An attempt to connect to the XDS110 failed.
    The cause may be one or more of: no XDS110 is connected, invalid
    firmware update, invalid XDS110 serial number, or faulty USB
    cable. The firmware and serial number may be updated using the
    xdsdfu utility found in the .../ccs_base/common/uscif/xds110
    directory of your installation. View the ReadMe.txt file there
    for instructions.
    (Emulation package 6.0.407.3)

    I've attempted to update the XDS110 using the suggested method, but it appears to be up-to-date and I am still able to flash driverlib level projects to the board.

    Included is an image comparing the include listing/size of the two projects.

  • Hi Cody,

    If you are using one of our Tiva Launchpads, it is likely that they do not have a XDS110 on the board. CCS by default will attempt to connect with the XDS110 unless you specify otherwise. Instead, the Tiva boards have a "Stellaris In-Circuit Debug Interface". You can update the connection type by going to the project properties, and under the "General" menu, selecting the correct debug connection.

    Regards,

    Gilbert

  • Is there any reason that this only happens with tiRTOS functionality?

    Worked as suggested, it appears (at least the board flashed). Great thinking :D And thanks for the help!

  • It looks like the driverlib examples already have the debug connection set correctly in their project settings. Due to the way we generate the examples, the debug connection will not be set. If the debug connection is not set, CCS will try to choose an appropriate connection which appears to be the XDS110.

    Regards,
    Gilbert