wwwheihei 发表于 2018-7-26 17:19:00

stm32f0待机模式用rtc闹钟唤醒问题,急

本帖最后由 wwwheihei 于 2018-7-26 17:44 编辑

stm32f0待机模式用rtc闹钟唤醒问题,第一次正常,可以进入睡眠,第二次唤醒重启后执行 PWR_EnterSTANDBYMode();就直接重启了,没办法进入睡眠什么情况?

wwwheihei 发表于 2018-7-26 17:21:22

本帖最后由 wwwheihei 于 2018-7-26 17:25 编辑

收←◆Uboot Start...

Read upgrade mark
A,Waiting to enterAPP

jump to APP

APP START...
运行中......!

收←◆2018-07-26 4 00:00:02
运行中......!

收←◆2018-07-26 4 00:00:05
运行中......!

收←◆2018-07-26 4 00:00:07
运行中......!

收←◆2018-07-26 4 00:00:10
运行中......!

19:46.328]收←◆2018-07-26 4 00:00:12//进入睡眠
20:33.750]收←◆Uboot Start...               //唤醒重启

Read upgrade mark
A,Waiting to enterAPP

jump to APP

APP START...
运行中......!

收←◆2018-07-26 4 00:00:02
运行中......!

收←◆2018-07-26 4 00:00:05
运行中......!

收←◆2018-07-26 4 00:00:07
运行中......!

收←◆2018-07-26 4 00:00:10
运行中......!

20:46.593]收←◆2018-07-26 4 00:00:12
20:46.703]收←◆Uboot Start...               //直接重启了没进入睡眠

Read upgrade mark
A,Waiting to enterAPP

jump to APP

APP START...
运行中......!

收←◆2018-07-26 4 00:00:02
运行中......!

收←◆2018-07-26 4 00:00:05
运行中......!

收←◆2018-07-26 4 00:00:07
运行中......!

收←◆2018-07-26 4 00:00:10
运行中......!

收←◆2018-07-26 4 00:00:12
收←◆Uboot Start...

Read upgrade mark
A,Waiting to enterAPP

jump to APP

APP START...
运行中......!

收←◆2018-07-26 4 00:00:02
运行中......!

收←◆2018-07-26 4 00:00:05
运行中......!

butterflyspring 发表于 2018-8-3 14:34:41

你调试一下,在hardfualt上面打个断点看看..或者uart输出也行.如果是hardfulat,可以用附件看看那是什么原因.如果也不是hardfualt,也输出我们寄存器,看看上次复位原因是啥

wwwheihei 发表于 2018-8-3 15:22:11

butterflyspring 发表于 2018-8-3 14:34
你调试一下,在hardfualt上面打个断点看看..或者uart输出也行.如果是hardfulat,可以用附件看看那是什么原因. ...
好像是f0和f4在进入待机模式时候必须重新设置rtc,不然不正常,唤醒不了,我加了那几行代码正常了

butterflyspring 发表于 2018-8-3 15:30:21

wwwheihei 发表于 2018-8-3 15:22
好像是f0和f4在进入待机模式时候必须重新设置rtc,不然不正常,唤醒不了,我加了那几行代码正常了 ...

具体是那几行?让别人也可以学习学习..:)

wwwheihei 发表于 2018-8-3 15:48:56

本帖最后由 wwwheihei 于 2018-8-3 15:53 编辑

butterflyspring 发表于 2018-8-3 15:30
具体是那几行?让别人也可以学习学习..
//ϵͳ½øÈë´ý»úģʽ
void Sys_Enter_Standby(void)
{               
      u32 tempreg;                     
   
         RCC->AHB1RSTR|=0X01FE;      
          while(WKUP_KD);                        
         RCC->AHB1RSTR|=1<<0;   
      
       ///////////////////////////////////////////////////////////////////////////////
      RCC->APB1ENR|=1<<28;      
      PWR->CR|=1<<8;                     
      
      RTC->WPR=0xCA;
      RTC->WPR=0x53;
      tempreg=RTC->CR&(0X0F<<12);
      RTC->CR&=~(0XF<<12);      
      RTC->ISR&=~(0X3F<<8);      
      PWR->CR|=1<<2;            
      RTC->CR|=tempreg;            
      RTC->WPR=0xFF;

///////////////////////////////////////////////////////////////////////////////////////////////////////////               
      Sys_Standby();      
}



wwwheihei 发表于 2018-8-3 15:50:22

butterflyspring 发表于 2018-8-3 15:30
具体是那几行?让别人也可以学习学习..

就是这几句话了

dutu-1 发表于 2018-8-3 19:46:54

谢谢分享
页: [1]
查看完整版本: stm32f0待机模式用rtc闹钟唤醒问题,急