STM32F407 RTC 无法进行断点调试问题请教

2019-07-20 07:32发布

硬件环境:STM32F407ZE(使用金点原子例程RTC工作正常)
软件环境:KEIL5
RTC配置如下:
static void RTC_Config(void)
{
  /* Enable the PWR clock */
  RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);

  /* Allow access to RTC */
  PWR_BackupAccessCmd(ENABLE);

  /* Reset RTC Domain */
  //RCC_BackupResetCmd(ENABLE);
  //RCC_BackupResetCmd(DISABLE);

  /* Enable the LSE OSC */
  RCC_LSEConfig(RCC_LSE_ON);

  /* Wait till LSE is ready */  
  while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
  {
  }

  /* Select the RTC Clock Source */
  RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);

  /* Configure the RTC data register and RTC prescaler */
  /* ck_spre(1Hz) = RTCCLK(LSI) /(AsynchPrediv + 1)*(SynchPrediv + 1)*/
  RTC_InitStructure.RTC_AsynchPrediv = 0x7F;
  RTC_InitStructure.RTC_SynchPrediv  = 0xFF;
  RTC_InitStructure.RTC_HourFormat   = RTC_HourFormat_24;
  RTC_Init(&RTC_InitStructure);

  /* Set the time to 00h 00mn 00s AM */
       
  RTC_TimeStruct.RTC_H12     = RTC_H12_AM;
  RTC_TimeStruct.RTC_Hours   = 0x11;
  RTC_TimeStruct.RTC_Minutes = 0x55;
  RTC_TimeStruct.RTC_Seconds = 0;  
  RTC_SetTime(RTC_Format_BCD, &RTC_TimeStruct);
       
        //RTC_GetTime(RTC_Format_BCD, &RTC_TimeStruct);       
}
问题如下:
1.png
388行  *(__IO uint8_t *) BDCR_ADDRESS = RCC_LSE_ON;断点调试为灰 {MOD},单步调试整个switch语句跳过;
查看汇编如下:
2.png
请教该问题原因?




友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。