Device OS: 2.0.1
On the first version of the my firmware, I had a list of retained variables that are simply declared. Not in the class and not in the structure.
In (Picture 1), shown the physical memory addresses of each retained variable that I have declared.
On the second firmware version I added two retained variables to the end of the list, as described in the reference (bool hasFlowSensor and double amountPerRotation, Picture 2 and 3).
Picture 2 and 3
I updated the firmware and looked at their addresses (Picture 4).
The addresses of all variables have shifted - the count starts from the last. As a result, the last variable that had the address 0x40024000 became the address 0x40024009. This resulted in an SOS error (5 blinks between sos blinks). I can explain why, but this is irrelevant to the question.
The question is: why does the official reference say that the retained variable should be added after all the others? (Picture 5)
If I add retained variables to the beginning of the list, then everything will be fine, the addresses of the variables will go after the old ones (Picture 6).
Is this a mistake in the reference or am I missing something?