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.

Runtime error (not a duplicate)

Other Parts Discussed in Thread: SYSBIOS

Dear moderator,

I posted this question a few days ago. I don't find an duplicate for it in the forum. If a duplicate exists, please direct me to the answer for it. Otherwise, please leave it in the forum for people to reply. Thank you.

Jonathan

p.s. This is not the same question as the "SPI run time error" question that I posted a few days ago, if that's the confusion.

 

Unfortunately, a moderator needed to remove your forum post in TI-RTOS Forum.

Reason: Duplicate.

Subject: Run time error

Body:

Every time when I start my RTOS App, I get an error message from the console window as shown below. My App still runs. What does the message mean? How do I get rid of this error message?

{module#48}: line 143: error {id:0x110000, args:[0x13, 0x0]}

Starting ESU Firmware ...
Level 0, 1mS

Regards, 

Jonathan 

  • Jonathan,
    sorry for the mixup, the first line of the error output looked the same as in https://e2e.ti.com/support/embedded/tirtos/f/355/t/479305, so I thought it's a duplicate. To get a full name of modules and the exact type of error, find the line in your CFG script that defines the parameter Text.isLoaded and set it to 'true':
    Text.isLoaded = true;

  • It's ok. They do look similar. Thanks for putting it back to the forum.

    I have modified the .cfg file as you suggested. It gave me more messages now :

    {module#49}: line 143: error {id:0x110000, args:[0x13, 0x0]}
    Starting ESU Firmware ...
    Level 0, 1mS
    {module#47}: line 143: E_alreadyDefined: Hwi already defined: intr# 19
    Starting ESU Firmware ...
    Level 0, 1mS

    I captured the previous message and the new message after I set Text.isLoaded = true. It looks like something is being re-defined. Could you decipher the message for me? I don't know what it is pointing at. Just in case you need it, I am pasting the entire .cfg file here:

    /*
    * Copyright (c) 2015, 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.
    */

    /*
    * ======== spiloopback.cfg ========
    */

    /* ================ General configuration ================ */
    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Error = xdc.useModule('xdc.runtime.Error');
    var Main = xdc.useModule('xdc.runtime.Main');
    var Memory = xdc.useModule('xdc.runtime.Memory');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Timer = xdc.useModule('ti.sysbios.hal.Timer');
    var Idle = xdc.useModule('ti.sysbios.knl.Idle');
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    var GateAll = xdc.useModule('ti.sysbios.gates.GateAll');
    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var Log = xdc.useModule('xdc.runtime.Log');

    /*
    * Program.stack is ignored with IAR. Use the project options in
    * IAR Embedded Workbench to alter the system stack size.
    */
    if (!Program.build.target.$name.match(/iar/)) {
    /*
    * Reducing the system stack size (used by ISRs and Swis) to reduce
    * RAM usage.
    */
    Program.stack = 4096;
    }

    /*
    * Comment this line to allow module names to be loaded on the target.
    * The module name strings are placed in the .const section. Setting this
    * parameter to false will save space in the .const section. Error and
    * Assert messages will contain an "unknown module" prefix instead
    * of the actual module name.
    */
    Defaults.common$.namedModule = false;

    /*
    * Minimize exit handler array in System. The System module includes
    * an array of functions that are registered with System_atexit() to be
    * called by System_exit().
    */
    System.maxAtexitHandlers = 2;

    /*
    * Comment this line to allow Error, Assert, and Log strings to be
    * loaded on the target. These strings are placed in the .const section.
    * Setting this parameter to false will save space in the .const section.
    * Error, Assert and Log message will print raw ids and args instead of
    * a formatted message.
    */
    //Text.isLoaded = false;
    Text.isLoaded = true;

    /* ================ System configuration ================ */
    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    System.SupportProxy = SysMin;
    SysMin.bufSize = 128;

    /* Enable Semihosting for GNU targets to print to CCS console */
    if (Program.build.target.$name.match(/gnu/)) {
    var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
    }

    /* ================ BIOS configuration ================ */
    /*
    * Disable unused BIOS features to minimize footprint.
    * This example uses Tasks but not Swis or Clocks.
    */
    BIOS.libType = BIOS.LibType_Custom;
    BIOS.logsEnabled = true;
    //BIOS.assertsEnabled = true;
    //BIOS.logsEnabled = false;
    BIOS.assertsEnabled = false;

    BIOS.heapSize = 4096;

    /* Runtime stack checking is performed */
    Task.checkStackFlag = true;
    Hwi.checkStackFlag = true;

    /* Reduce the number of task priorities */
    Task.numPriorities = 16;

    /* ================ Driver configuration ================ */
    var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
    TIRTOS.useGPIO = true;
    TIRTOS.useSPI = true;
    var semaphore2Params = new Semaphore.Params();
    semaphore2Params.instance.name = "ISRSem";
    semaphore2Params.mode = Semaphore.Mode_COUNTING_PRIORITY;
    Program.global.ISRSem = Semaphore.create(null, semaphore2Params);
    var semaphore3Params = new Semaphore.Params();
    semaphore3Params.instance.name = "miscompareSem";
    semaphore3Params.mode = Semaphore.Mode_COUNTING_PRIORITY;
    Program.global.miscompareSem = Semaphore.create(null, semaphore3Params);
    Idle.idleFxns[0] = null;
    Idle.idleFxns[1] = null;
    var task3Params0 = new Task.Params();
    task3Params0.instance.name = "miscompareFxnTask";
    Program.global.miscompareFxnTask = Task.create("&miscompareFxn", task3Params0);
    BIOS.cpuFreq.lo = 80000000;
    LoggingSetup.sysbiosTaskLogging = true;
    LoggingSetup.loadLogging = true;
    LoggingSetup.mainLogging = true;
    LoggingSetup.mainLoggingRuntimeControl = false;
    LoggingSetup.sysbiosSemaphoreLogging = true;
    Hwi.dispatcherAutoNestingSupport = false;
    var hwi0Params = new Hwi.Params();
    hwi0Params.instance.name = "syncManagerISR_HWI";
    hwi0Params.maskSetting = xdc.module("ti.sysbios.interfaces.IHwi").MaskingOption_SELF;
    Program.global.syncManagerISR_HWI = Hwi.create(19, "&syncManagerISR", hwi0Params);
    TIRTOS.libType = TIRTOS.LibType_NonInstrumented;
    var gateAll0Params = new GateAll.Params();
    gateAll0Params.instance.name = "gateAll0";
    Program.global.gateAll0 = GateAll.create(gateAll0Params);
    var task2Params = new Task.Params();
    task2Params.instance.name = "SPI_Init_Task";
    task2Params.priority = 10;
    Program.global.SPI_Init_Task = Task.create("&ESU_SPI_Init", task2Params);
    LoggingSetup.sysbiosSwiLogging = true;

    Thank you.

    Jonathan
  • Jonathan,

    Thanks for posting your .cfg file contents.  It includes this:

    Defaults.common$.namedModule = false;

    This saves some footprint by not loading module names to the target.  To get the module names in the error text you need to use this instead:

    Defaults.common$.namedModule = true;

    I expect this will show it is the ‘Hwi’ module, indicating that you are trying to assign your  "syncManagerISR" to interrupt 19 (GPIO Port D), which is colliding with some other component that is already using this interrupt vector...

    Regards,
    Scott

  • {module#47}: line 143: E_alreadyDefined: Hwi already defined: intr# 19
    Starting ESU Firmware ...
    Level 0, 1mS
    sysbios.family.arm.m3.Hwi: line 143: E_alreadyDefined: Hwi already defined: intr# 19
    Starting ESU Firmware ...
    Level 0, 1mS

    Is this what you expected? How do I track down where the conflict comes from?

    I do use interrupt 19 for HWI to syncManagerISR; however, I do not use it for anything else (not intentionally, that is). The only thing I can think of is, before I used HWI, I was using a call back function. Therefore, I still have these lines of code in  EK_TM4C123GX.c :


    /*
    * Array of Pin configurations
    * NOTE: The order of the pin configurations must coincide with what was
    * defined in EK_TM4C123GXL.h
    * NOTE: Pins not used for interrupts should be placed at the end of the
    * array. Callback entries can be omitted from callbacks array to
    * reduce memory usage.
    */
    GPIO_PinConfig gpioPinConfigs[] = {
    /* Input pins */
    /* EK_TM4C123GXL_GPIO_SW1 */
    GPIOTiva_PF_4 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
    /* EK_TM4C123GXL_GPIO_SW2 */
    //GPIOTiva_PF_0 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
    /* EK_TM4C123GXL_GPIO_SW3 */
    //GPIOTiva_PC_6 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
    /* EK_TM4C123GXL_GPIO_SPI_IRQ */
    //GPIOTiva_PD_4 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
    GPIOTiva_PD_4 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_LOW,

    /* Output pins */
    /* EK_TM4C123GXL_LED_RED */
    //GPIOTiva_PF_1 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    /* EK_TM4C123GXL_LED_BLUE */
    //GPIOTiva_PF_2 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    /* EK_TM4C123GXL_LED_GREEN */
    //GPIOTiva_PF_3 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    /* EK_TM4C123GXL_GPIO_WD */
    GPIOTiva_PC_7 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    /* EK_TM4C123GXL_GPIO_MCU_CLR_DAC */
    GPIOTiva_PA_6 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    /* EK_TM4C123GXL_GPIO_TP1 */
    GPIOTiva_PD_6 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    /* EK_TM4C123GXL_GPIO_GDO_1 */
    GPIOTiva_PE_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    /* EK_TM4C123GXL_GPIO_POWER */
    GPIOTiva_PD_2 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW

    };

    /*
    * Array of callback function pointers
    * NOTE: The order of the pin configurations must coincide with what was
    * defined in EK_TM4C123GXL.h
    * NOTE: Pins not used for interrupts can be omitted from callbacks array to
    * reduce memory usage (if placed at end of gpioPinConfigs array).
    */
    GPIO_CallbackFxn gpioCallbackFunctions[] = {
    NULL, /* EK_TM4C123GXL_GPIO_SW1 */
    //NULL, /* EK_TM4C123GXL_GPIO_SW2 */
    //NULL /* EK_TM4C123GXL_GPIO_SW3 */
    NULL /* EK_TM4C123GXL_GPIO_SPI_IRQ */
    };

    /* The device-specific GPIO_config structure */
    const GPIOTiva_Config GPIOTiva_config = {
    .pinConfigs = (GPIO_PinConfig *) gpioPinConfigs,
    .callbacks = (GPIO_CallbackFxn *) gpioCallbackFunctions,
    .numberOfPinConfigs = sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
    .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
    .intPriority = (~0)
    };

    /*
    * ======== EK_TM4C123GXL_initGPIO ========
    */
    void EK_TM4C123GXL_initGPIO(void)
    {
    /* EK_TM4C123GXL_GPIO_SW2 - PF0 requires unlocking before configuration */
    HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= GPIO_PIN_0;
    //GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_0);

    /* EK_TM4C123GXL_GPIO_SW3 - PC6 requires unlocking before configuration */
    //HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    //HWREG(GPIO_PORTC_BASE + GPIO_O_CR) |= GPIO_PIN_6;
    //GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_6);

    /* EK_TM4C123GXL_GPIO_WD - PC7 requires unlocking before configuration */
    //HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    //HWREG(GPIO_PORTC_BASE + GPIO_O_CR) |= GPIO_PIN_7;
    //GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_7);


    /* EK_TM4C123GXL_GPIO_SPI_IRQ - PD4 requires unlocking before configuration */
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= GPIO_PIN_4;
    //GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_4);
    //GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_3);


    /* Initialize peripheral and pins */
    GPIO_init();
    }

    and these in  EK_TM4C123GX.h:


    /*!
    * @def EK_TM4C123GXL_GPIOName
    * @brief Enum of GPIO names on the EK_TM4C123GXL dev board
    */
    typedef enum EK_TM4C123GXL_GPIOName {
    EK_TM4C123GXL_SW1 = 0,
    //EK_TM4C123GXL_SW2,
    //EK_TM4C123GXL_SW3,
    EK_TM4C123GXL_GPIO_SPI_IRQ,
    //EK_TM4C123GXL_LED_RED,
    //EK_TM4C123GXL_LED_BLUE,
    //EK_TM4C123GXL_LED_GREEN,
    EK_TM4C123GXL_WD,
    EK_TM4C123GXL_MCU_CLR_DAC,
    EK_TM4C123GXL_GPIO_TP3,
    EK_TM4C123GXL_GPIO_GDO_1,
    EK_TM4C123GXL_LED_POWER,

    EK_TM4C123GXL_GPIOCOUNT
    } EK_TM4C123GXL_GPIOName;

    Could any of these lines be causing this error message?

    Jonathan

  • Jonathan,

    Yes, that is the Hwi module that I expected was reporting a collision.

    I haven't used this board, and I don’t know the details of its wiring.  And I haven’t been able to interpret what exactly is going on from the code snippets you posted.  

    There are comments in your snippets that indicates GPIO Port D interrupt is or was at some point being used for a “SPI_IRQ”:

    /* EK_TM4C123GXL_GPIO_SPI_IRQ - PD4 requires unlocking before configuration */
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= GPIO_PIN_4;
    //GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_4);
    //GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_3);

    ...

    typedef enum EK_TM4C123GXL_GPIOName {
    EK_TM4C123GXL_SW1 = 0,
    //EK_TM4C123GXL_SW2,
    //EK_TM4C123GXL_SW3,
    EK_TM4C123GXL_GPIO_SPI_IRQ,
    //EK_TM4C123GXL_LED_RED,
    //EK_TM4C123GXL_LED_BLUE,
    //EK_TM4C123GXL_LED_GREEN,
    EK_TM4C123GXL_WD,
    EK_TM4C123GXL_MCU_CLR_DAC,
    EK_TM4C123GXL_GPIO_TP3,
    EK_TM4C123GXL_GPIO_GDO_1,
    EK_TM4C123GXL_LED_POWER,
    EK_TM4C123GXL_GPIOCOUNT
    } EK_TM4C123GXL_GPIOName;


    If you can’t find the collision by looking at your code, you might try temporarily setting "useSPI" to false in the .cfg file, to see if the error goes away (meaning you are indeed colliding with the SPI driver usage of this interrupt):

    TIRTOS.useSPI = false;

    Hope this helps.

    Regards,
    Scott

  • Sorry for the late response.

    I tried adding this "TIRTOS.useSPI = false;" to my .cfg file. The code still gets the error message.

    sysbios.family.arm.m3.Hwi: line 143: E_alreadyDefined: Hwi already defined: intr# 19
    Starting ESU Firmware ...
    Level 0, 1mS

    Any ideas?

    Jonathan
  • Jonathan,

    You might try looking at the Hwi module state after initial startup, using the ROV tool, to see which function is already plugged for that interrupt.  Load the program in CCS, and go to main() (if the PC is not there after loading).  Click Tools->RTOS Object View (ROV).  Once the ROV window opens, click on the program name, and then click on the Hwi module under Viewable Modules.  Click on the “Basic” tab, and then look for interrupt #19, and the indicated “fxn”.  This name should be a clue as to which other component has plugged the interrupt already.

    Regards,
    Scott