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.

SYSBIOS 6.42.02.29: Strange ReentSupport.c error

Other Parts Discussed in Thread: SYSBIOS

Hi,

Building a BIOS project with CC6.1, I am getting a strange build error in BIOS source:

/home/gunter/ti/ccsv6/utils/bin/gmake -k all
making ../src/sysbios/sysbios.aa9fg ...
gmake[1]: Entering directory `/home/gunter/workspace_sdk_rtos_am437x/testUart/src/sysbios'
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm_gnu.asm ...
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm ...
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/gic/Hwi_asm_gnu.asm ...
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/exc/Exception_asm_gnu.asm ...
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/a9/Cache_asm_gnu.sv7A ...
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/a8/Mmu_asm_gnu.sv7A ...
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/a15/TimestampProvider_asm_gnu.asm ...
asma9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/timers/dmtimer/Timer_asm_gnu.sv7A ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/BIOS.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/IntrinsicsSupport.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/TaskSupport.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Clock.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Idle.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Intrinsics.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Queue.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Semaphore.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Swi.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Swi_andn.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/knl/Task.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/hal/Cache.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/hal/Core.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/hal/CoreNull.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/hal/Hwi.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/hal/Hwi_stack.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/hal/Hwi_startup.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/hal/Timer.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/gic/Hwi.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/exc/Exception.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/a9/Cache.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/a9/Timer.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/heaps/HeapMem.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/family/arm/a8/Mmu.c ...
cla9fg /home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
/home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/rts/gnu/ReentSupport.c: In function 'ti_sysbios_rts_gnu_ReentSupport_Module_startup__E':
/home/gunter/ti/bios_6_42_02_29/packages/ti/sysbios/rts/gnu/ReentSupport.c:67:9: error: request for member 'init_done' in something not a structure or union
lock.init_done = 1;
^
gmake[1]: *** [gnu_ReentSupport.o] Error 1

Has anyone seen this?

Thanks,

--Gunter

  • Hi Gunter,

    What version of GNU codegen are you using? If you tweaked the bios.mak and bios.bld files at the top for sysbios install, can you attach them also? I'll see if I can reproduce the problem.

    Todd

  • Hi Todd,

    I am using
    /ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3

    There are no changes to the build options of sysbios, as far as I know.

    Please let me know if you need any additional information.


    Regards,
    --Gunter
  • Hi Todd,

    I just removed the line

    var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');

    from the .cfg file, and the error went away. Could you explain what this setting does?

    Thanks,
    --Gunter
  • Hi Gunter,

    In order to make the C runtime library re-entrant, we have to modify some of C headers and rebuild the library with some custom options. These modified headers and rebuilt libraries are shipped with the SYS/BIOS product. If the application does not pull in the right headers and does not link with the right C runtime library, an error can occur. Looking at the error you are getting, it seems the SYS/BIOS library is being built with the wrong header files (not the modified header files we ship with SYS/BIOS). This is a bit odd because the correct header files for building the SYS/BIOS library should automatically get selected by our build system.

    I need to repro this on my end to understand why you are getting this error. Can you share your project so I can repro the problem ?

    Best,

    Ashish

  • Hi Ashish,

    I'm also getting this error when I try to build the EtherCAT Slave sample project -- but only when I have SYS/BIOS version 6.42 or above selected (confirmed the issue exists with 6.42.3.35 and 6.42.2.29), but when I select SYS/BIOS version 6.41.0.26 the project compiles just fine.

    Unfortunately, when I compile with SYS/BIOS 6.42 and I disable the SemihostSupport line in my app.cfg file, I still get the compile error;

    cla8fg C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c: In function 'ti_sysbios_rts_gnu_ReentSupport_Module_startup__E':
    C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c:67:9: error: request for member 'init_done' in something not a structure or union
    lock.init_done = 1;
    ^
    gmake[1]: *** [gnu_ReentSupport.o] Error 1

    I'm using XDCtools 3.30.6.67_core, and sysbios_ind_sdk_2.1.0.1.

  • Hi Jeff,

    Can you share your *.cfg file ?

    Thanks,
    Ashish
  • Hi Jeff,

    Can you replace the following line in your *.cfg script with the line below it and try rebuilding your application ?

    BIOS.customCCOpts ="-mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -O3 -Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections -g -Dti_sysbios_Build_useHwiMacros -Dfar= -D__DYNAMIC_REENT__"
    

    Replace the above line with below one:

    BIOS.customCCOpts +="-mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -O3 -Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections -g -Dti_sysbios_Build_useHwiMacros -Dfar= -D__DYNAMIC_REENT__"
    

    The first line (currently in the *.cfg script) is replacing the default BIOS.customCCOpts (compiler options used to build the custom SYS/BIOS library) instead of appending to it. The change I suggested above will cause the options to be appended instead of replaced.

    The first line is part of the AM335x SDK examples and is a known bug. I believe future SDK releases will fix this line in the example *.cfg files.

    Best,

    Ashish

  • Hey Ashish,

    I made the change you suggested, and now I get a different error;

    cla8fg C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c: In function 'ti_sysbios_rts_gnu_ReentSupport_Module_startup__E':
    C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c:65:29: error: storage size of 'lock' isn't known
    volatile struct _LOCK_T lock;
    ^
    C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c:65:29: warning: unused variable 'lock' [-Wunused-variable]
    gmake[1]: *** [gnu_ReentSupport.o] Error 1
    gmake[1]: Leaving directory `C:/Users/JGORCH~1/DOCUME~1/!SIL!~1/Software/DebugIoModule/EtherCatSlaveExample/src/sysbios'
    gmake: *** [C:/Users/JGORCH~1/DOCUME~1/!SIL!~1/Software/DebugIoModule/EtherCatSlaveExample/src/sysbios/sysbios.aa8fg] Error 2
    Build of libraries failed.
    error: xdc.cfg.SourceDir: "C:/ti/xdctools_3_31_02_38_core/packages/xdc/cfg/SourceDir.xs", line 209: xdc.cfg.SourceDir : Build of generated source libraries failed: exit status = 2:

    js: "C:/ti/xdctools_3_31_02_38_core/packages/xdc/cfg/Main.xs", line 160: Error: Configuration failed!
    gmake.exe: *** [package/cfg/am335xx_app_pa8fg.xdl] Error 1

    Looking at the file in question (ReentSupport.c) it looks like it doesn't include "lock.h", which defines the _LOCK_T structure, so it can't determine the structure size...

  • Hi Jeff,

    Did you modify the "C:/ti/bios_6_42_03_35/packages/ti/sysbios/rts/gnu/ReentSupport.c" source file ? From the log it looks like it has "volatile struct _LOCK_T lock" on line 65 whereas in the SYS/BIOS 6.42.03.35 product's "ReentSupport.c" files, line 65 is "volatile _LOCK_T lock".

    Best,
    Ashish
  • Hey Ashish,

    It looks like you're right, I had 'struct' on line 65, and when I removed it the issue went away.

    Thanks!