cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3 Wake up from stop mode.

arganasss
Associate II
Posted on April 24, 2014 at 15:18

The original post was too long to process during our migration. Please click on the attachment to read the original post.
4 REPLIES 4
chen
Associate II
Posted on April 24, 2014 at 17:13

Hi

Please refer to the Reference manual for the part you are using for details.

Stop mode can only be exited by Exti (well that is true for STM32F4 parts)

ie the RTC alarm IRQ will not wake the processor.

The RTC alarm can be linked to EXTI line 17.

arganasss
Associate II
Posted on April 24, 2014 at 17:29

I'm using STM32f303xC if that's what you asked. So okey, i understood that example wrong, but still here i lined RTC to EXTI line 17. If i remove EXTI interrupt which i lined to PA.00 , then the code seems to work and processor goes to stop mode and wakes up. But when i try to use both at the same time, something seems to go bad.

chen
Associate II
Posted on April 24, 2014 at 18:19

Hi

''but still here i lined RTC to EXTI line 17. If i remove EXTI interrupt which i lined to PA.00 , then the code seems to work and processor goes to stop mode and wakes up. But when i try to use both at the same time, something seems to go bad.''

There should be no reason why you cannot have more then 1 EXTI IRQ.

The code example did not look like it was linking the RTC to EXTI Line17 properly

Here I am linking PA9 (for USB VBUS) to EXTI line18 :

  /* Connect EXTI Line18 to PA9 pin (USB power) */

  SYSCFG_EXTILineConfig( EXTI_PortSourceGPIOA, EXTI_PinSource9 );

  EXTI_ClearITPendingBit(EXTI_Line18);

  /* Configure EXTI Line18 */

  EXTI_InitStructure.EXTI_Line = EXTI_Line18;

  EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;

  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;

  EXTI_InitStructure.EXTI_LineCmd = ENABLE;

  EXTI_Init(&EXTI_InitStructure);

  /* Enable and set EXTI18 Interrupt priority */

  NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );

  NVIC_InitStructure.NVIC_IRQChannel = OTG_FS_WKUP_IRQn;

  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = IRQ_PRIORITY_USB;

  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;

  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

  NVIC_Init(&NVIC_InitStructure);

arganasss
Associate II
Posted on April 25, 2014 at 10:01

I did this for EXTI interrupt for PA.00 because im using external line for this, but are you sure that i have to do the same thing for RTC? It's internal line. I can see that it has to be connected to EXTI line 17, but SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex) , where GPIOX (X=A,B....) and Pinsourcex(x=0..15), so i dont think it's possible to do what you say and this configuration

// EXTI17 line configuration

    EXTI_ClearITPendingBit(EXTI_Line17);

    EXTI_InitStructure.EXTI_Line = EXTI_Line17;

    EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;

    EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;

    EXTI_InitStructure.EXTI_LineCmd = ENABLE;

    EXTI_Init(&EXTI_InitStructure); 

is enough for EXTI configuration part. Unless i understand this pretty bad.