2017-10-29 02:26 AM
Hi all,
I've noticed that in every example and CubeMX generated code the backup domain access bit is set and never reset. It is as if once the application starts the access is allowed and never restricted again, so it make s me wonder what's the point?
In my code I enable access when needed (e.g. setting RTC time and date) and disable the access once I'm done, seems more appropriate to me. My question is if what I do is necassary or should I just eave the enable bit set an forget about it?
#rtc #backup-domain2017-10-29 03:39 AM
My question is if what I do is necessary
No, it's not *necessary*.
Other question is, whether it's a *good practice*, or whether there's any benefit in the extra work done.
Very similar questions can be asked of reasonability of the exercises prescribed by the various ISO 'functional safety' standards, where, in the hope of mitigating hardware glitches and programmer errors, certain naive operations - processor registers write-and-readback, code memory checksumming, etc. - are performed periodically (as that's relatively easy to require and check by the various associated parasi^H^H^H^H^H^Hcertifying authorities) without assessing their effectiveness on the particular hardware or real impact on the resulting application (as that's very hard).
JW
2017-10-29 05:07 AM
I used '
necessary' in place of '
good practice' :)
In any case if it is not necessary nor a good practice why bother making this bit? what is the scenario where it is necessary? if it is to protect the application from a one in a trillion event why bother?
2017-10-29 05:51 AM
Note, that I did *not* say above it's *not* a good practice... ;)
why bother making this bit
The same reason as above: it's easy. And, you may come to a conclusion that in *your particular* application it's beneficial to use it. It's always upon you and your particular application, to assess the costs and benefits.
There's a similar issue with watchdogs: they are *not* universally beneficial; their usage can be and often is mocked; yet in particular application their usage may be highly needed - but then there's an incredibly lot of work to get them right (it is especially hard to explain to the managerial types that amount of work).
JW
2017-10-29 07:03 AM
I understand it is up to me, and my choice.
What I don't get is why use it? What is the benefit? Assuming the access to these registers are specific within my application, how can an 'accidental access' occur? When is ti good practice to set and reset the bit and when is it OK to just allow constant access?
2017-10-29 09:02 AM
>>
What I don't get is why use it?
Errant code execution. It perhaps turns off some clocks and synchronization circuitry.
The more general point would be not to enable until you have a board level indication that power is good, and persistent.