This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Any ST RTC Experts?

Greetings One and All,

Evaluating uVision V4.21.0.0 (Fabulous!)
Using STM32F10x_StdPeriph_Lib_V3.5.0 and compiling
it's associated RTC demo for an STM32F103VET6.

RTC demo code will run happily in uVision software simulator, using either LSE or LSI oscillators to clock the RTC. Code stops at below indicated points and with corresponding mode, however, when run directly on target hardware.

Snippet from RTC setup routine:
------------------------------------------------------------------------------
...

  /* Allow access to Backup Registers */
  PWR_BackupAccessCmd(ENABLE);

  if(BKP_ReadBackupRegister(BKP_DR1) != CONFIGURATION_DONE)
  {
    /* Enable Backup and Power Interface Peripheral Clocks */
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_BKP | RCC_APB1Periph_PWR, ENABLE);

    /* Backup Domain Reset */
    BKP_DeInit();

#ifdef USE_LSE_FOR_RTC

    /* Enable 32.768 kHz external oscillator */
    RCC_LSEConfig(RCC_LSE_ON);

    /* Wait for LSE to become ready */
    while (RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET) continue;

/////////////////////////////////////////////////////////////////////
//// When 'USE_LSE_FOR_RTC' defined, code stops in previous call ////
//// whilst waiting for LSERDY flag to assert.                   ////
/////////////////////////////////////////////////////////////////////

    /* Set LSE as RTC clock source */
    RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);

#elif defined USE_LSI_FOR_RTC

    /* Enable 32.000kHz internal oscillator */
    RCC_LSICmd(ENABLE);

    /* Wait until LSI is ready */
    while (RCC_GetFlagStatus(RCC_FLAG_LSIRDY) == RESET) continue;

    /* Select LSI as RTC Clock Source */
    RCC_RTCCLKConfig(RCC_RTCCLKSource_LSI);

#endif

    /* RTC Enabled */
    RCC_RTCCLKCmd(ENABLE);

    /* Wait for RTC registers synchronisation */
    RTC_WaitForSynchro();

/////////////////////////////////////////////////////////////////////
//// When 'USE_LSI_FOR_RTC' defined, code stops in previous call ////
//// whilst waiting for RSF flag to assert.                      ////
/////////////////////////////////////////////////////////////////////

    /* Wait for last RTC operation to finish */
    RTC_WaitForLastTask();

...

------------------------------------------------------------------------------

Any clues or suggestions, Anyone, please?

Boz.

Parents Reply Children
No data