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.

TI-RTOS & Linaro v4.9.3 vs Linaro v4.7.4

Other Parts Discussed in Thread: SYSBIOS

I am trying to debug a test project compiled with Linaro v4.9.3.  The compilation completes successfully but when I debug the program it never makes it into main().

The source code I am debugging is: (it's one of the the typical templates)

/*
 *  ======== main.c ========
 */

#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
/*
 *  ======== taskFxn ========
 */
Void taskFxn(UArg a0, UArg a1)
{
    System_printf("enter taskFxn()\n");

    Task_sleep(10);

    System_printf("exit taskFxn()\n");

    System_flush(); /* force SysMin output to console */
}

/*
 *  ======== main ========
 */
Int main()
{ 
    Task_Handle task;
    Error_Block eb;

    System_printf("enter main()\n");

    Error_init(&eb);
    task = Task_create(taskFxn, NULL, &eb);
    if (task == NULL) {
        System_printf("Task_create() failed!\n");
        BIOS_exit(0);
    }

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

When I debug, it never makes it into main, when I pause the execution is stuck at:

UInt64 Timer_getExpiredCounts64(Timer_Object *obj)
{
    ti_catalog_arm_peripherals_timers_TimerRegsM4 *timer;
    UInt32 count1, count2;
    UInt32 intr1, intr2;
    UInt32 wrap;

    timer = (ti_catalog_arm_peripherals_timers_TimerRegsM4 *)
        Timer_module->device[obj->id].baseAddr;

    if (obj->runMode != Timer_RunMode_DYNAMIC) {
        count1 = timer->GPTMTAR; <----------------- THIS LINE
        wrap = timer->GPTMRIS & 0x1; /* roll-over occurred */
        count2 = timer->GPTMTAR;

        if ((count1 > count2) && wrap) {
            return ((UInt64)(obj->period - count1) + (UInt64)obj->period);
        }
        else {
            return ((UInt64)(obj->period - count1));
        }
    }

When I use Linaro v4.7.4 compilation and debug works successfully.  I am using the Tiva TM4C129x dev board.

Any help would be appreciated in finding out the reason for this.

Thanks

  • Just as an update I found a discrepancy in the map file from the two different compilers:

    ---------------- v4.9.3 ------------------------------------------------

    Allocating common symbols
    Common symbol size file

    xdc_runtime_LoggerBuf_Instance_State_0_entryArr__A
    0x200 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    errno 0x4 C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-reent.o)
    xdc_runtime_SysMin_Module_State_0_outbuf__A
    0x200 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    ti_sysbios_knl_Task_Instance_State_0_hookEnv__A
    0x4 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    ti_sysbios_family_arm_m3_Hwi_dispatchTable
    0x360 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A
    0x1000 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg

    -------------- v4.7.4 ----------------------------------------------------

    Allocating common symbols
    Common symbol size file

    xdc_runtime_LoggerBuf_Instance_State_0_entryArr__A
    0x200 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    errno 0x4 C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-reent.o)
    _vtable_base_address
    0x4 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    xdc_runtime_SysMin_Module_State_0_outbuf__A
    0x200 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    ti_sysbios_knl_Task_Instance_State_0_hookEnv__A
    0x4 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    ti_sysbios_family_arm_m3_Hwi_dispatchTable
    0x360 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A
    0x1000 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg
    _intvecs_base_address
    0x4 Z:\gcc-test\Debug\configPkg\package\cfg\app_pm4fg.om4fg

    The vtable/intvecs doesnt seem to be placed by the linker... perhaps I'm missing linker flags?
  • Roque Obusan,
    could you please post the full content of the build console for both builds?

  • Hi, 

    Full build context from the builds below.  I've also added v4.8.4 in there as it is exhibiting the same symptoms of the 4.9.3 build for me.

    -------------------------------------------------------- v4.7.4 ---------------------------------------------------

    **** Build of configuration Debug for project gcc-test ****
    
    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all 
    making ../src/sysbios/sysbios.am4fg ...
    gmake[1]: Entering directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport_asm_gnu.sv7M ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/BIOS.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Clock.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Idle.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Intrinsics.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Queue.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Semaphore.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi_andn.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Task.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_stack.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_startup.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/TimestampProvider.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/Timer.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateHwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateMutex.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/heaps/HeapMem.c ...
    arm4fg m3_Hwi_asm_gnu.o m3_Hwi_asm_switch_gnu.o m3_IntrinsicsSupport_asm_gnu.o m3_TaskSupport_asm_gnu.o _BIOS.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o m3_Hwi.o m3_TaskSupport.o gnu_ReentSupport.o lm4_TimestampProvider.o lm4_Timer.o gates_GateHwi.o gates_GateMutex.o heaps_HeapMem.o ...
    gmake[1]: Leaving directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    'Building file: ../app.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_31_00_24_core/xs" --xdcpath="C:/ti/tirtos_tivac_2_10_01_38/packages;C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages;C:/ti/tirtos_tivac_2_10_01_38/products/ndk_2_24_01_18/packages;C:/ti/tirtos_tivac_2_10_01_38/products/uia_2_00_02_39/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.M4F -p ti.platforms.tiva:TM4C129ENCZAD -r debug -c "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_7-2014q2-20140408-win32" "../app.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring app.xm4fg from package/cfg/app_pm4fg.cfg ...
    generating custom ti.sysbios library makefile ... 
    Starting build of library sources ...
    making C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios/sysbios.am4fg ...
    gmake[1]: Entering directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    gmake[1]: Nothing to be done for `all'.
    gmake[1]: Leaving directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    Build of libraries done.
    clm4fg package/cfg/app_pm4fg.c ...
    'Finished building: ../app.cfg'
    ' '
    'Building file: ../main.c'
    'Invoking: GNU Compiler'
    "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_7-2014q2-20140408-win32/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPART_TM4C129ENCZAD -I"C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_7-2014q2-20140408-win32/arm-none-eabi/include" -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -MD -std=c99 -pedantic -c -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" @"./configPkg/compiler.opt"  "../main.c"
    'Finished building: ../main.c'
    ' '
    'Building target: gcc-test.out'
    'Invoking: GNU Linker'
    "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_7-2014q2-20140408-win32/bin/arm-none-eabi-gcc.exe" -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPART_TM4C129ENCZAD -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"gcc-test.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7e-m/fpu" -o"gcc-test.out" "./main.o" -Wl,-T"../TM4C129ENCZAD.lds" -Wl,-T"./configPkg/linker.cmd"  -Wl,--start-group -l"c" -l"gcc" -l"m" -l"nosys" -Wl,--end-group 
    'Finished building target: gcc-test.out'
    ' '
    
    **** Build Finished ****
    

    -------------------------------------------------------- v4.8.4 ---------------------------------------------------

    **** Build of configuration Debug for project gcc-test ****
    
    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all 
    making ../src/sysbios/sysbios.am4fg ...
    gmake[1]: Entering directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport_asm_gnu.sv7M ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/BIOS.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Clock.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Idle.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Intrinsics.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Queue.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Semaphore.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi_andn.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Task.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_stack.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_startup.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/TimestampProvider.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/Timer.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateHwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateMutex.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/heaps/HeapMem.c ...
    arm4fg m3_Hwi_asm_gnu.o m3_Hwi_asm_switch_gnu.o m3_IntrinsicsSupport_asm_gnu.o m3_TaskSupport_asm_gnu.o _BIOS.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o m3_Hwi.o m3_TaskSupport.o gnu_ReentSupport.o lm4_TimestampProvider.o lm4_Timer.o gates_GateHwi.o gates_GateMutex.o heaps_HeapMem.o ...
    gmake[1]: Leaving directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    'Building file: ../app.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_31_00_24_core/xs" --xdcpath="C:/ti/tirtos_tivac_2_10_01_38/packages;C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages;C:/ti/tirtos_tivac_2_10_01_38/products/ndk_2_24_01_18/packages;C:/ti/tirtos_tivac_2_10_01_38/products/uia_2_00_02_39/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.M4F -p ti.platforms.tiva:TM4C129ENCZAD -r debug -c "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3" "../app.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring app.xm4fg from package/cfg/app_pm4fg.cfg ...
    generating custom ti.sysbios library makefile ... 
    Starting build of library sources ...
    making C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios/sysbios.am4fg ...
    gmake[1]: Entering directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport_asm_gnu.sv7M ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/BIOS.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Clock.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Idle.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Intrinsics.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Queue.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Semaphore.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi_andn.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Task.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_stack.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_startup.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/TimestampProvider.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/Timer.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateHwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateMutex.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/heaps/HeapMem.c ...
    arm4fg m3_Hwi_asm_gnu.o m3_Hwi_asm_switch_gnu.o m3_IntrinsicsSupport_asm_gnu.o m3_TaskSupport_asm_gnu.o _BIOS.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o m3_Hwi.o m3_TaskSupport.o gnu_ReentSupport.o lm4_TimestampProvider.o lm4_Timer.o gates_GateHwi.o gates_GateMutex.o heaps_HeapMem.o ...
    gmake[1]: Leaving directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    Build of libraries done.
    clm4fg package/cfg/app_pm4fg.c ...
    'Finished building: ../app.cfg'
    ' '
    'Building file: ../main.c'
    'Invoking: GNU Compiler'
    "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPART_TM4C129ENCZAD -I"C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/arm-none-eabi/include" -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -MD -std=c99 -pedantic -c -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" @"./configPkg/compiler.opt"  "../main.c"
    'Finished building: ../main.c'
    ' '
    'Building target: gcc-test.out'
    'Invoking: GNU Linker'
    "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc.exe" -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPART_TM4C129ENCZAD -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"gcc-test.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7e-m/fpu" -o"gcc-test.out" "./main.o" -Wl,-T"../TM4C129ENCZAD.lds" -Wl,-T"./configPkg/linker.cmd"  -Wl,--start-group -l"c" -l"gcc" -l"m" -l"nosys" -Wl,--end-group 
    'Finished building target: gcc-test.out'
    ' '
    
    **** Build Finished ****
    

    -------------------------------------------------------- v4.9.3 ---------------------------------------------------

    **** Build of configuration Debug for project gcc-test ****
    
    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all 
    making ../src/sysbios/sysbios.am4fg ...
    gmake[1]: Entering directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport_asm_gnu.sv7M ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/BIOS.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Clock.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Idle.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Intrinsics.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Queue.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Semaphore.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi_andn.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Task.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_stack.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_startup.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/TimestampProvider.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/Timer.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateHwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateMutex.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/heaps/HeapMem.c ...
    arm4fg m3_Hwi_asm_gnu.o m3_Hwi_asm_switch_gnu.o m3_IntrinsicsSupport_asm_gnu.o m3_TaskSupport_asm_gnu.o _BIOS.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o m3_Hwi.o m3_TaskSupport.o gnu_ReentSupport.o lm4_TimestampProvider.o lm4_Timer.o gates_GateHwi.o gates_GateMutex.o heaps_HeapMem.o ...
    gmake[1]: Leaving directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    'Building file: ../app.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_31_00_24_core/xs" --xdcpath="C:/ti/tirtos_tivac_2_10_01_38/packages;C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages;C:/ti/tirtos_tivac_2_10_01_38/products/ndk_2_24_01_18/packages;C:/ti/tirtos_tivac_2_10_01_38/products/uia_2_00_02_39/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.M4F -p ti.platforms.tiva:TM4C129ENCZAD -r debug -c "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_9-2015q1-20150306-win32" "../app.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring app.xm4fg from package/cfg/app_pm4fg.cfg ...
    generating custom ti.sysbios library makefile ... 
    Starting build of library sources ...
    making C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios/sysbios.am4fg ...
    gmake[1]: Entering directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm_gnu.sv7M ...
    asmm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport_asm_gnu.sv7M ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/BIOS.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Clock.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Idle.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Intrinsics.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Queue.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Semaphore.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Swi_andn.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/knl/Task.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_stack.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/hal/Hwi_startup.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/Hwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/m3/TaskSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/TimestampProvider.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/family/arm/lm4/Timer.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateHwi.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/gates/GateMutex.c ...
    clm4fg C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/ti/sysbios/heaps/HeapMem.c ...
    arm4fg m3_Hwi_asm_gnu.o m3_Hwi_asm_switch_gnu.o m3_IntrinsicsSupport_asm_gnu.o m3_TaskSupport_asm_gnu.o _BIOS.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o m3_Hwi.o m3_TaskSupport.o gnu_ReentSupport.o lm4_TimestampProvider.o lm4_Timer.o gates_GateHwi.o gates_GateMutex.o heaps_HeapMem.o ...
    gmake[1]: Leaving directory `C:/Users/RoqueO/workspace_v6_1/gcc-test/src/sysbios'
    Build of libraries done.
    clm4fg package/cfg/app_pm4fg.c ...
    'Finished building: ../app.cfg'
    ' '
    'Building file: ../main.c'
    'Invoking: GNU Compiler'
    "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_9-2015q1-20150306-win32/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPART_TM4C129ENCZAD -I"C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_9-2015q1-20150306-win32/arm-none-eabi/include" -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -MD -std=c99 -pedantic -c -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" @"./configPkg/compiler.opt"  "../main.c"
    'Finished building: ../main.c'
    ' '
    'Building target: gcc-test.out'
    'Invoking: GNU Linker'
    "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_9-2015q1-20150306-win32/bin/arm-none-eabi-gcc.exe" -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPART_TM4C129ENCZAD -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"gcc-test.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/tirtos_tivac_2_10_01_38/products/bios_6_41_00_26/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7e-m/fpu" -o"gcc-test.out" "./main.o" -Wl,-T"../TM4C129ENCZAD.lds" -Wl,-T"./configPkg/linker.cmd"  -Wl,--start-group -l"c" -l"gcc" -l"m" -l"nosys" -Wl,--end-group 
    'Finished building target: gcc-test.out'
    ' '
    
    **** Build Finished ****
    

     

  • I will look into this and see if I can reproduce what you are seeing here. Maybe attached your project here.
    Also what version of CCS are you using?
  • Project attached.

    I'm using 6.1.0.00104. 

    Appreciate the help.

    0753.gcc-test.rar

  • Hi Roque,

    We do not validate SYS/BIOS (TI-RTOS kernel) against GCC 4.9 release so I would not recommend using that version of GCC. That said, while testing the kernel with GCC 4.8.3 it was discovered that the intvecs/vtable placement does not work under some cases. For example, it does not work if intvecs are moved to SRAM address space using 'Hwi.resetVectorAddress' Hwi module config param. This was due to changes in the way the linker behaves between GCC 4.7 and GCC 4.8. The fix for this involved changing the section placements for intvecs and vtable in the linker script as shown below. We updated all the linker scripts shipped with kernel examples starting with SYS/BIOS 6.41.03 and newer (present in TI-RTOS 2.12).

    SECTIONS {
    
        PROVIDE (_intvecs_base_address =
            DEFINED(_intvecs_base_address) ? _intvecs_base_address : 0x0);
    
        .intvecs (_intvecs_base_address) : AT (_intvecs_base_address) {
            KEEP (*(.intvecs))
        } > REGION_TEXT
    
        PROVIDE (_vtable_base_address =
            DEFINED(_vtable_base_address) ? _vtable_base_address : 0x20000000);
    
        .vtable (_vtable_base_address) : AT (_vtable_base_address) {
            KEEP (*(.vtable))
        } > REGION_DATA
    
    ...

    You may be seeing the same problem as described above with GCC 4.9. Can you try updating your linker script to reflect the above change and see if it helps ?

    Best,

    Ashish

  • I just looked at the map file you shared and based on that I can confirm that the intvecs/vtable sections are getting placed correctly. So, the issue is not related to vector table placement.

    Best,
    Ashish
  • Hi Roque,

    I ran your out file on my board. The issue is that with newer versions of GCC (newer than 4.7.3) the compiler optimization is a little different and our Hwi stack init function generates bad code that ends up corrupting the system stack. In your particular application's case this prevents the timer enable startup function (enables the timer clock) from running and therefore, when the timer module's startup routine runs and tries to access the timer registers, it generates an exception.

    While testing the kernel with GCC 4.8, we had discovered this problem and fixed it in SYS/BIOS 6.41.01 release. Moving to TI-RTOS 2.12 should fix the problem for you as it ships with a newer kernel that has the fix.

    Here's a one line description of this issue as stated in the release notes for SYS/BIOS 6.41.01:
    SDOCM00113541 Hwi_initStack() routine may generate code that corrupts the stack during boot time (gcc v4.8 Arm issue)

    Best,
    Ashish
  • Hi Ashish,

    Performing the move to TI-RTOS 2.12 fixed the issue. Appreciate the help and the detailed response.

    Thanks,
    Roque