Skip to main content
Clonimus74
Senior II
October 29, 2017
Question

Proper backup domain access question

  • October 29, 2017
  • 1 reply
  • 874 views
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
This topic has been closed for replies.

1 reply

waclawek.jan
Super User
October 29, 2017
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

Clonimus74
Senior II
October 29, 2017
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?

waclawek.jan
Super User
October 29, 2017
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