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.

MSPM0G3519: Fee initialization issue with GHS Compiler.

Part Number: MSPM0G3519

Issue Description:

While performing Fee_Init() using latest MCAL package from TI. Below are the observations.

  • Fee module invokes Fls_blankVerifyFlashWord() as shown below
    • image.png
    • During the execution of funcRun(), it is observed that OS Exception is reported.
  • Rootcause Analysis:

    Fls user guide mentions to have linker command file(CLANG Compiler) as shown below

    • image.png
  • When Clang compiler is used for building Application, we have not observed Fee initialization issue, but when GHS compiler is used, the issue is observed.

    Linker script for GHS compiler :

    • image.png
    • Generated .map
      • image.png

Is MCAL verified with GHS compiler at TI for Fee initialization? and

Can you please share the linker command file used for the initialization of Fee with GHS compiler ?

Test Environment :

  • Target : TI(MSPM0G3519)
  • Compiler : GHS multi (202414)
  • MCAL : MSPM0-MCAL_00_09.00.00

Please let me know if any information is required.

  • Hi,

    Please add the below code into the suggested files as follows:

    In linker command file of GHS, add a section 

        .eraseLoadSram align(16) : {
            __ghsbegin_eraseLoadSram = .;
            *(.eraseLoadSram)
            . = ALIGN(16);
            __ghsend_eraseLoadSram = .;
        } > FLASH

    In Fls_ac.h, add/check this section

    #elif  defined(__ghs__) || defined(GHS)
    /* GHS compiler: Use #pragma ghs section for section placement */
    #pragma ghs section text=".eraseLoadSram"
    void Fls_executeCommand(void);
    #pragma ghs section text=default

    In Fls_ac.c, add/check this section

    #if defined(__ghs__) || defined(GHS)
    /* GHS compiler: Use #pragma ghs section to place function in .eraseLoadSram */
    #pragma ghs section text=".eraseLoadSram"
    #endif

    In Fls_ctrl.c, add/check this section 

    #elif  defined(__ghs__) || defined(GHS)
    /* GHS compiler: Use linker-defined symbols for section info */
    /* These symbols should be defined in the linker script */
    extern uint32 __ghsbegin_eraseLoadSram[];
    extern uint32 __ghsend_eraseLoadSram[];
    #define eraseLoadFlashStart __ghsbegin_eraseLoadSram
    #define eraseLoadFlashSize ((uint32)((uint8*)__ghsend_eraseLoadSram - (uint8*)__ghsbegin_eraseLoadSram))

    This will ensure that the Fls_executeCommand() API is correctly copied from flash to sram and executed from sram.

    Thanks,

    Sreekar

  • Expected functionality is achieved with below changes taken into build environment. Other two changes are checked and already are part of MCAL package.

    * In linker command file of GHS - GHS linker file updated and 

    * In Fls_ac.c, add - MCAL package updated

**Attention** This is a public forum