Problem with STM32F407 using RTC_SmoothCalibConfig
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-02-13 5:17 AM
- 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
- Labels:
-
RTC
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-02-15 11:50 AM
And writing to RTC->CALR?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-02-18 12:25 AM
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);
...
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-02-18 1:01 AM
And writing to other RTC registers at that moment succeeds?
Is RTC clock running? Is PWR_CR.DBP set (check by reading back).
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-02-18 2:19 AM
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
