cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with STM32F407 using RTC_SmoothCalibConfig

CCars
Associate II
  • DBP bit (PWR_CR) is set to enable write access
  • RTC_WPR is written key-sequenze (by function itself) to enable write access
  • call of RTC_SmoothCalibConfig(...) does not change Register RTC->CALR
  • return of RTC_SmoothCalibConfig(...) is SUCSESS, nevetheless RTC->CALR remains always 0x0000
  • I find no Remarks in Errata sheet about this problem
4 REPLIES 4

And writing to RTC->CALR?

JW

CCars
Associate II

the function from ST library should direct write to this register, but does not, although write permissions are released. The debugger is walking to the command, the parameter have valid values and the function returns SUCCESS, but the register remains 0x0000

ErrorStatus RTC_SmoothCalibConfig(uint32_t RTC_SmoothCalibPeriod,

                 uint32_t RTC_SmoothCalibPlusPulses,

                 uint32_t RTC_SmouthCalibMinusPulsesValue)

{

...

  /* Configure the Smooth calibration settings */

  RTC->CALR = (uint32_t)((uint32_t)RTC_SmoothCalibPeriod | (uint32_t)RTC_SmoothCalibPlusPulses | (uint32_t)RTC_SmouthCalibMinusPulsesValue);

...

}

And writing to other RTC registers at that moment succeeds?

Is RTC clock running? Is PWR_CR.DBP set (check by reading back).

JW

CCars
Associate II

ok, found the problem:

PWR_BackupAccessCmd( ENABLE );       // Allow access to BKP Domain

has to be additionally set before 'RTC_SmoothCalibConfig'

... and after don't forget to reset into safe estate with

PWR_BackupAccessCmd( DISABLE );      // deny access to BKP Domain

thx for support