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.

TMS320F28379S: Compiler error when using stl_hwbist_s.asm from SafeTIDiagnosticLibrary with C6000 EABI

Part Number: TMS320F28379S

Tool/software:

I'm trying to run the hwbist provided by the SafeTIDiagnosticLibrary in a project that's using the C6000 EABI but I'm getting an error during compilation. Is it possible to do that and if so what workarounds do I need to employ to get the project to build properly?

Below there's the related compiler output up to the firs error. I've checked and "hw_sysctl.h" appears to have loaded properly and "SYSCTL_O_RESC" shows up in the .lst file.

"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", WARNING! at line 43: [E1000] error while processing C code in .cdecls directive
            .cdecls C, LIST, WARN, "inc/hw_memmap.h"
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", WARNING! at line 44: [E1000] error while processing C code in .cdecls directive
            .cdecls C, LIST, "inc/hw_sysctl.h"
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", WARNING! at line 168: [W1500] warning:  relocation template 275 not found; returning OFR_INVALID
            MOVW    DP, #((CPUSYS_BASE + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", REMARK   at line 168: [R0001] After symbol substitution the line became:
            MOVW    DP, #((0x0005D300U + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", WARNING! at line 168: [W1500] warning:  relocation template 277 not found; returning OFR_INVALID
            MOVW    DP, #((CPUSYS_BASE + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", REMARK   at line 168: [R0001] After symbol substitution the line became:
            MOVW    DP, #((0x0005D300U + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", WARNING! at line 168: [W1500] warning:  relocation template 258 not found; returning OFR_INVALID
            MOVW    DP, #((CPUSYS_BASE + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", REMARK   at line 168: [R0001] After symbol substitution the line became:
            MOVW    DP, #((0x0005D300U + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", WARNING! at line 168: [W1500] warning:  relocation template 277 not found; returning OFR_INVALID
            MOVW    DP, #((CPUSYS_BASE + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", REMARK   at line 168: [R0001] After symbol substitution the line became:
            MOVW    DP, #((0x0005D300U + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", WARNING! at line 168: [W1500] warning:  relocation template 265 not found; returning OFR_INVALID
            MOVW    DP, #((CPUSYS_BASE + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", REMARK   at line 168: [R0001] After symbol substitution the line became:
            MOVW    DP, #((0x0005D300U + SYSCTL_O_RESC) >> 6)
 
"/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", ERROR!   at line 169: [E0200] Unable to resolve this relocatable expression; relocation support for arbitrary expressions is not available in the C6000 EABI
            MOV     @(SYSCTL_O_RESC & 0x40), #0x00000000

  • There is a typo in this diagnostic ...

    "/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm", ERROR!   at line 169: [E0200] Unable to resolve this relocatable expression; relocation support for arbitrary expressions is not available in the C6000 EABI

    Instead of C6000 EABI, it should say C2000 EABI.

    I'm trying to run the hwbist provided by the SafeTIDiagnosticLibrary

    It is likely that this library is not tested and documented to work with C2000 EABI.  I have no expertise in this library.  So I have changed responsibility for this thread to those with more expertise than me.

    Thanks and regards,

    -George

  • Can you explain how you ported the project to EABI? It seems odd that it says "C6000 EABI." Please follow the guidance in our EABI migration guide to update the code. I can give you some specific tips on this HWBIST code though--

    In stl_hwbist_s.asm you can add the following lines to handle the assembly underscore name changes (below the .cdecls lines is a good spot for them):

    		.if __TI_EABI__
    		.asg STL_HWBIST_runMicroTest, _STL_HWBIST_runMicroTest
    		.asg STL_HWBIST_handleReset, _STL_HWBIST_handleReset
    		.endif

    In stl_hwbist.c, you should add a #pragma RETAIN line for STL_HWBIST_restoreContext():

    /*LDRA_INSPECTED 69 S MR:D.1.1 Comment_69S*/
    #pragma RETAIN(STL_HWBIST_restoreContext);
    #pragma CODE_SECTION(STL_HWBIST_restoreContext, "hwbist");
    void STL_HWBIST_restoreContext(void)

    Whitney

  • I've made some progress in figuring out what's going on:
    so we've decided to do the name adaptation for the lack of "_" with EABI in a separate file so we don't have to change any of the library file. This file consists of the .asg statements for translation followed by .include for the library .asm files in question. It appears however that the compiler is unable to properly process the .cdecls statements when loaded as an .include...

    The file roughly looks like this (removed other function adaptation)


        .if __TI_EABI__
        .asg STL_HWBIST_runMicroTest, _STL_HWBIST_runMicroTest
        .asg STL_HWBIST_handleReset, _STL_HWBIST_handleReset
        .endif
        .include "/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm"

    if I manually include both .cdecls statements in the adapter file this part seems to build fine thou it still complains about "error while processing C code in .cdecls directive" presumably when trying to parse these statements in the included stl_hwbist_s.asm file.


    Why does it fail to parse the .cdecls statements when loaded using .include?

    P.s. I've checked and we're using "C2000 Code Generation Tools v22.6.1.LTS" so it appears as thou there really is a typo in the diagnostics message...

  • I tried this in my own copy of the library and couldn't reproduce that "error while processing C code message." Did you make any changes to the stl_hwbist_s.asm file?

    Whitney

  • Thank you, I did some more testing and figured out it only happens when I .include stl_cla_s.asm and stl_hwbist_s.asm in the same file. both of them uses the .cdecls command and both include hw_memmap.h
    When both are included the 2nd one fails both .cdecls commands even thou they only have one of the loaded files in common.

    here's what the file looks like:


        .if __TI_EABI__
        .asg STL_HWBIST_runMicroTest, _STL_HWBIST_runMicroTest
        .asg STL_HWBIST_handleReset, _STL_HWBIST_handleReset

        .asg STL_CLA_copySegment, _STL_CLA_copySegment
        .asg STL_CLA_copy1stHalfSegment, _STL_CLA_copy1stHalfSegment
        .asg STL_CLA_copy2ndHalfSegment, _STL_CLA_copy2ndHalfSegment
        .asg STL_CLA_runTest, _STL_CLA_runTest

        .endif
        .include "/libraries/diagnostic/f2837xs/source/stl_cla_s.asm"
        .include "/libraries/diagnostic/f2837xs/source/stl_hwbist_s.asm"

  • I'm still not able to reproduce this. Are you adding the new mapping asm file to the library project and rebuilding the .lib or are you adding it to your application build?

    --Do you have any idea what might be causing this error? I don't write enough assembly to know the ins and outs of using .cdecls and .include.

    Whitney