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.

CCS/TMS320F28375D: TMS320F28375D initialization inside of CCS

Part Number: TMS320F28375D

Tool/software: Code Composer Studio

Hello team,

“I have a customer with a question regarding TMS320F28375D initialization inside of CCS.”

MY PROBLEM

I have different global variables declared to external memories connected to my Delfino TMS320F28375D via EMIF bus (I am using compiler version TI v18.1.3.LTS). The EMIF bus initialization occurs AFTER gloval variables initialization in the boot. And this is my problem, because when I need to use those global variables (defined in external memories and initialized in their definition with a specific value) they do not have their initialization value because the EMIF bus initialization occurs after the global variable init.

 

MY SOLUTION

In TI compiler documentation I found that I can solve my problem by using a custom verion of _system_pre_init() function (present in pre_init.c TI file). In fact, by placing the EMIF bus initialization function in this function, this bus init would occur BEFORE global variable initialization in the boot.

 

ISSUE I AM HAVING

I connected this customized _system_pre_init() function to the project by linking pre_init.c file to the project, I inserted my InitEmif() function in it and build the project. In that way the run time library would call my customized _system_pre_init() function (this is what I have read in forums). It actually gets called during the boot but, please look at the pic of the attachment as a reference, when instruction at line 125 is executed, _system_pre_init() is called. BUT when the PC starts to execute this instruction, line 58 is the last place of this instruction ran by the debugger. InitEmif() is never called, because _system_pre_init() exits after having run line 58. I do not understand why InitEmif() is never called and _system_pre_init() exists immediately.

 

Is there some documentation or examples which describe the use of _system_pre_init() function?

 

Thanks a lot in advance for your help

  • Jarrett

    This looks like it isn't using your custom copy of the pre_init.c. I'm not sure of hand how to prioritize use of your file, I will investigate and get back to you tomorrow (Dec 7).

    Best regards
    Chris
  • While I don't understand why, you are using the _system_pre_init function supplied inside the compiler RTS library, and not the custom one.  To work that out, I would need to see the linker invocation.  Whether you want to pursue that is up to you.  I recommend just moving on to a fix similar to this one:

    • Implement a function named _system_pre_init.  The code shown in the first post is correct.  The name of the source file does not matter.  In fact, just for fun, name it something else.  Say my_init.c.
    • Add my_init.c to the CCS project, just like any other source file
    • The compiler RTS library is normally the last file seen by the linker.  In the Console view, check the linker invocation to be sure this is the case.  The linker invocation should end with something similar to  -l libc.a

    Thanks and regards,

    -George