cancel
Showing results for 
Search instead for 
Did you mean: 

Proper backup domain access question

Clonimus74
Senior II
Posted on October 29, 2017 at 10:26

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-domain
5 REPLIES 5
Posted on October 29, 2017 at 11:39

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

Posted on October 29, 2017 at 12:07

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?

Posted on October 29, 2017 at 12:51

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

Posted on October 29, 2017 at 14:03

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?

Posted on October 29, 2017 at 16:02

>>

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..