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.
Tool/software:
hello
When we use the TMS320F28035 chip, the global variable defined in the code is not initialized in the main function, and this address is not initialized in the launcher.
If you use this global variable in your code, what is the value of this variable?
So far we've tested in the lab that this value is always 0;
But the same version of the program, when the client test, this value is random, sometimes 0, sometimes 1.
From a chip point of view, under what circumstances could it be 0 and under what circumstances could it be 1?
Hi,
The uninitialized global variables are not initialized to zero. They are left as is in RAM, which means either can be 0 or 1 on power-up. There are various factors like electromagnetic interference, electrical noise, tempearture which might affect the uninitialized values to have random values (0 or 1).
C standard specifies that global (extern) and static variables without explicit initializations must be initialized to 0 before the program begins running.
Best Regards
Siddharth