We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I am just doing some first test with C++ for my STM32F4 controller (coming from C programming - I did not use C++ for controllers before, only for Windows programming).
I want to use mainly static / global classes.
For most of these global classes, I expect all variables to be initialized to zero.
Is it possible, to locate such classes into the ZI data space, so that they are initilized to zero at startup with optimum speed?
I now tested it, as far as I see it, the variables of global classes are put into the RW segment, but the RW segment also is initialized to zero. (and nicely it does not matter whether I define the class variables as static or not - so I can skip the static).
That's ok for me.
Just I would sleep calmer, if this would be defined somehow in the documentation, but I did not find anything. So I hope this will not change in some future?
Does infocenter.arm.com/.../armccref_bcfebjjb.htm explain what you are seeing?
Very interesting - thank you!
(I would also be interested, whether the complete RW segment by default is nulled on start - but as I see it, the answer is yes).