AnsweredAssumed Answered

STM32F439 RTC Problem

Question asked by bhavsar.nipam on Jul 3, 2016
Latest reply on Jul 5, 2016 by FTITI.Walid
Hello All,

Micro-controller: STM32F439 With LSE(32.768 KHz)
Standard Peripheral Driver Version: V1.6.1
Problem: RTC routine Stuck

Description:
We are currently working on RTC and implemented the code as per available in standard peripheral examples directory. RTC works properly on one board so we decided to test on more hardware boards. After testing those boards, the results are not that we expected. Out of 10 boards, 6 boards have no problem with RTC and 4 boards are facing issues with RTC even though all the boards are assembled in same assembly house.

After debugging on those 4 boards, we found that at the time of initialization of RTC, it stucks at below points.
1) It stucks in while condition.

/* Enable the LSE OSC */
  RCC_LSEConfig(RCC_LSE_ON);
  
  /* Wait till LSE is ready */  
  while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
  {
  }

2) Stucks in do..while condition

/* Set the Initialization mode */
    RTC->ISR = (uint32_t)RTC_INIT_MASK;
    
    /* Wait till RTC is in INIT state and if Time out is reached exit */
    do
    {
      initstatus = RTC->ISR & RTC_ISR_INITF;
      initcounter++;  
    } while((initcounter != INITMODE_TIMEOUT) && (initstatus == 0x00));
    
Connected 22 pF with 32.768 KHz crystal at hardware side attached here. I have double checked that all hardware components are soldered properly.

I cannot decide that whether this issue is related to Hardware side or Firmware side.

How can I debug these issues?  

Any help in this case would be highly appreciated.

Thanks,
Nipam

Attachments

Outcomes