Compiler/CCSTUDIO: Why instruction is push rather than stmdb?
Part Number: AM3352
Tool/software: TI C/C++ Compiler
Program before main() initializes structure DSP_Component.
I'm sure about the initializing value to DSP_Component here is not a random value.
Also, I searched DSP_Component in Memory Browser and found nothing.
The true values at 0x81C2510C seems not matching with value in Expressions window.
This variable is placed at named section .mass_data, but I'm not sure this is related with this problem or not.
I also set a hardware watchpoint on this variable, still found nothing.
How it comes? Thanks
I'm not sure what you are asking. Is DSP_Component initialized with the correct values? Does this initialization occur before main starts? Do you want an explanation of how that works?
Thanks and regards,
TI C/C++ Compiler Forum ModeratorPlease click This Resolved My Issue on the best reply to your questionThe CCS Youtube Channel has short how-to videosThe Compiler Wiki answers most common questionsTrack an issue with SDOWP. Enter your bug id in the Search box.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to George Mock:
Sorry that I asked a question in a stupid way.
As far as I know, variable DSP_Component should be initialized to 0, because it's a global variable.
But now it's with a neat value(not random).
I changed its value directly from within expression window and reloaded program again, and found that this changed value is unchanged.
Then I went through DSECT and manual says:
「Global symbols defined in a dummy section are relocated normally. They appear in the output module's symbol table with the same value they would have if the DSECT had actually been loaded. These symbols can be referenced by other input sections」
Although I cannot understand it totally, this phenomenon partly makes sense.
In reply to Andy Lin94:
Andy Lin94As far as I know, variable DSP_Component should be initialized to 0, because it's a global variable.
Correct. This initialization to 0 does not happen when the device powers on. Startup code, which executes before main, performs that task, among many others. Whenever you somehow restart execution, you have to make sure the startup code executes.
Regarding DSECT ... This is a rarely used feature of the linker. It appears to be wrong to use it in your case. Please read more about DSECT here.
The startup code comes from the compiler RTS library. The source code to the RTS library is part of the compiler installation. If you have the compiler installed as part of Code Composer Studio, then a typical location is ...
The startup code is split among a few files. Start with the files named boot_something.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.