|
|||||||||||
Technical Support Support Resources
Product Information |
C51: Avoiding Startup Initialization of Static VariablesInformation in this article applies to:
QUESTIONI have a C function which contains some xdata static variables. When the device is reset I do not want the locations those variables are stored at to be initialized to 00H by the startup code. How can that be achieved? ANSWERThe file STARTUP.A51 includes the code for initialization of data memory and is included with every project if required. By default the XDATA is not initialized however the STARTUP.A51 file allows this to be easily configured. The easiest way to avoid initialization of static or global variables is by performing the following steps:
If you include all your static variables in a single structure then you can absolutely locate that structure rather than every single variable. Note that you need to copy INIT.A51 to your project directory and modify it if you want to remove initialization of all global variables. MORE INFORMATION
SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.