Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE
Tool/software: Code Composer Studio
Note: This is actually for TMS320C28075, but E2E didn't recognize that part number.
According to the TMS320C28x C/C++ compiler manual, in the section “Initializing Static and Global Variables”, static and global variables that are not explicitly initialized will remain uninitialized, in violation of the C standard which requires that they be initialized to zero.
We just noticed this statement in the manual, and we are at a late stage where it would be cause some pain to change our code to account for it. And according to experiments that I have run, the manual actually does not seem to be correct. As far as I can tell, static and global variables are correctly initialized – I assume in some startup code that is run before our application code. I have tested this when booting either from internal flash memory or from an external EEPROM (we utilize both). Each time that I pull on the processor’s reset pin to reboot it, variables that were previously set to non-zero values are reset to zero, without explicit initialization in our code.
A couple of other details:
- We are using the --rom_model linker option.
- We do not specify a fill value in the linker command file.
Can you confirm that we can count on this initialization of all static and global variables, despite the contrary statement in the manual?