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.

TMS320F28377S: when to initialize the global variables?

Part Number: TMS320F28377S

Hi expert,

I have a customer doing bootload for F2837XS.

The app receives an upgrade instruction while it is running, places the flag for a special variable, then jumps to the boot area, and after the boot jumps to the app area, which the last instructor of the bootloader seems like this:

ExitBoot(0x80000);

which I suppose will go to the codestart, then go to run c_int00; And it did run to c_int00 in test.

then we can see that the global variables will re-initialized, then the flag can be clear and then run the normal app code. -- this is my assumption

however, they just found the global variable flag is not reinitialized. Causes the upgrade flag persist, then boot and the app to jump back and forth. -- this is what happened.

I found c_int00 function in this application note: https://www.ti.com/lit/ug/spru514w/spru514w.pdf

The c_int00 function performs the following tasks to initialize the environment:
1. Defines a section called .stack for the system stack and sets up the initial stack pointers
2. Initializes global variables by copying the data from the initialization tables to the storage allocated for
the variables in the .ebss or .bss section. If you are initializing variables at load time (--ram_model
option), a loader performs this step before the program runs (it is not performed by the boot routine).
For more information, see Section 7.10.3.
3. Executes the global constructors found in the global constructors table. For more information, see
Section 7.10.3.4.
4. Calls the main() function to run the C/C++ program

BR

EMMA