TM4C1290NCPDT: SYS/BIOS Crash at Hwi_switchFromBootStack() on TM4C129DNCPDT whileusing TI RTOS

Part Number: TM4C1290NCPDT
Other Parts Discussed in Thread: TM4C129DNCPDT, SYSBIOS

We are trying to debug TI Rtos in TM4C129DNCPDT Controller using code composor studio , when we try to debug this it is crashing at this function Hwi_switchFromBootStack  in main it is excuting just before  startAppBIOS() function but once it reach  startAppBIOS(), in  startAppBIOS(); it is doing all initilization of all bios and then shift to hwi.c file in that it reaches Hwi_initStacks , it is crashing after that it reaches to memory 0xFFFF FFFC. 
Whwn we try to debug it is throwing error at this point. Crashing. Once  startAppBIOS() starts it is initilizing all and getting crash. Our ram is 256 kb so We increase the stack size and heap size and we also check the size allocated to each task and understood tasks having enough stack size  But we still not able to find why it is crashing , I need help over this topic. Then I commented task in main andhen also it is crashing at that point. 
We even commented the system got crash at the eariler mention point. We alos removed ccs studio properties and made heap and stack size to 0. I dont want it to take from properties i want it to take from config file. We need help over herer How we can run this in debug mode.                RTOS_Files.zip  , Firmware_Optimization.cfg  , main.c ,rtos_task.h 

  • Hi Sarath,

    Does the crash only happen in debug mode or does it happen outside of debug as well?

    Thanks,

    -Eric Rentschler

  • It is happening in debug mode. I am attaching the linker script.

  • It is happening only in Debug mode. I am attaching the linker script also.  

  • It is happening in debug mode. I am attaching the contents of linker file, You can check below. 

       /*
     * Do not modify this file; it is automatically generated from the template
     * linkcmd.xdt in the ti.platforms.tiva package and will be overwritten.
     */

    /*
     * put '"'s around paths because, without this, the linker
     * considers '-' as minus operator, not a file name character.
     */


    -l"/home/sK/mainApp/Debug/configPkg/package/cfg/OptimizedCode_4_pem4f.oem4f"
    -l"/home/sK//mainApp/src/sysbios/sysbios.aem4f"
    -l"/home/sK/ti/bios_6_83_00_18/packages/ti/catalog/arm/cortexm4/tiva/ce/lib/Boot.aem4f"
    -l"/home/sK/ti/bios_6_83_00_18/packages/ti/targets/arm/rtsarm/lib/ti.targets.arm.rtsarm.aem4f"
    -l"/home/sK//ti/bios_6_83_00_18/packages/ti/targets/arm/rtsarm/lib/boot.aem4f"
    -l"/home/sK/ti/bios_6_83_00_18/packages/ti/targets/arm/rtsarm/lib/auto_init.aem4f"
    -l"/home/sK//xdctools_3_62_01_16_core/packages/xdc/rov/runtime/lib/xdc.rov.runtime.aem4f"

    --retain="*(xdc.meta)"

    /* C6x Elf symbols */
    --symbol_map __TI_STACK_SIZE=__STACK_SIZE
    --symbol_map __TI_STACK_BASE=__stack
    --symbol_map _stack=__stack


    --args 0x0
    -heap  0x0
    -stack 0x1800

    /*
     * Linker command file contributions from all loaded packages:
     */

    /* Content from xdc.services.global (null): */

    /* Content from xdc (null): */

    /* Content from xdc.corevers (null): */

    /* Content from xdc.rov (null): */

    /* Content from xdc.runtime (null): */

    /* Content from xdc.rov.runtime (null): */

    /* Content from xdc.shelf (null): */

    /* Content from xdc.services.spec (null): */

    /* Content from xdc.services.intern.xsr (null): */

    /* Content from xdc.services.intern.gen (null): */

    /* Content from xdc.services.intern.cmd (null): */

    /* Content from xdc.bld (null): */

    /* Content from ti.targets (null): */

    /* Content from ti.targets.arm.elf (null): */

    /* Content from xdc.services.getset (null): */

    /* Content from ti.targets.arm.rtsarm (null): */

    /* Content from ti.sysbios.interfaces (null): */

    /* Content from ti.sysbios.family (null): */

    /* Content from ti.sysbios.family.arm (ti/sysbios/family/arm/linkcmd.xdt): */

    /* Content from ti.sysbios.rts (null): */

    /* Content from xdc.runtime.knl (null): */

    /* Content from ti.catalog.arm.peripherals.timers (null): */

    /* Content from ti.catalog.arm.cortexm4 (null): */

    /* Content from ti.catalog (null): */

    /* Content from ti.catalog.peripherals.hdvicp2 (null): */

    /* Content from xdc.platform (null): */

    /* Content from xdc.cfg (null): */

    /* Content from ti.catalog.arm.cortexm3 (null): */

    /* Content from ti.catalog.arm.cortexm4.tiva.ce (null): */

    /* Content from ti.platforms.tiva (null): */

    /* Content from ti.sysbios.hal (null): */

    /* Content from ti.sysbios.family.arm.lm4 (null): */

    /* Content from ti.sysbios.family.arm.m3 (ti/sysbios/family/arm/m3/linkcmd.xdt): */
    -u _c_int00
    --retain "*(.resetVecs)"
    --retain "*(.vecs)"
    ti_sysbios_family_arm_m3_Hwi_nvic = 0xe000e000;

    /* Content from ti.sysbios.knl (null): */

    /* Content from ti.sysbios (null): */

    /* Content from ti.sysbios.utils (null): */

    /* Content from ti.sysbios.gates (null): */

    /* Content from ti.sysbios.heaps (null): */

    /* Content from ti.sysbios.xdcruntime (null): */

    /* Content from configPkg (null): */

    /* Content from xdc.services.io (null): */

    /* Content from ti.sysbios.family.c28 (null): */



    /*
     * symbolic aliases for static instance objects
     */
    xdc_runtime_Startup__EXECFXN__C = 1;
    xdc_runtime_Startup__RESETFXN__C = 1;
    xdc_rov_runtime_Mon__checksum = 1;
    xdc_rov_runtime_Mon__write = 1;


    SECTIONS
    {
        .bootVecs:  type = DSECT
        .resetVecs: load > 0xc000
        .vecs: load > 0x20000000, type = NOLOAD



        xdc.meta: type = COPY
    }

  • Hi Sarath,

    Is the crash happening outside of debug as well?

    Thanks,

    -Eric Rentschler

  • Yes, when we try to debug this issue we reached Hwi_initStacks then  , it is crashing after that it reaches to memory 0xFFFF FFFC

  • Hi Sarath,

    What is this Hwi_initStacks method doing? If it crashes after reaching memory 0xFFFF FFFC, then I'm suspecting you are creating a stack overflow.

    Thanks,

    -Eric Rentschler

  • We have a task in TIRTOS, inside that we have a function. when ever we add a line inside that function (just copying some data into  a buffer) when we do that the code works fine, we are calculating  and setting DAC inside that function. The DAC containing some complex calculations. When we add this line               "  usprintf(AdcvalueBuff, "\nPR D=%d %d ", abc,efg);"everything works fine. if we remove it unexpected behavior  is happening, How we can solve this. We checked our stack usage everything is on limit only. The .cfg file I all ready attached above you can check the configuration and stack assigning in that. This a high priority task. and we are using Segger J liink for code flashing , Does it makes any issue ? We are calling a i2c related function after this data assigning . While we use that data assigning function the text segment value also changing, Does it cause this issue? The line is at the staring of the function. Please consider it as a high priority issue and give necessary instructions to us.

  • Hi Sarath, 

    Are you using any optimizations with the compiler? This could be changing the behavior.

    Thanks,

    -Eric Rentschler

  • Yes,  We are using Compiler optimization in CCS studio. Please check the image I attached. 

  • Hi Sarath, 

    Please, drop the optimization to 0 and see if this makes fixes the behavior changes.

    Thanks,

    -Eric Rentschler