cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

STM32L0x2 LSE CSS trigger

Staly.1
Associate III

i'm using STM32L072,how to trigger the LSECSS interrupt?

i've got HAL_RCCEx_EnableLSECSS(),HAL_RCCEx_EnableLSECSS_IT(), but the flag RCC_IT_LSECSS never set when LSE error comes up.

plz give a clue or the flow of LSECSS

7 REPLIES 7

Read out and check/post content of relevant RCC registers.

JW

hi JW,

thank you for reply,

i try to check RCC->CSR ,firstly the value is 0x1c052303.the register value changed into 0x1c054303 when LSE error occured.

back to the normal , there is not effect to set CSSLSEON bit. it's alway keep this value 0x1c054303 .

what's wrong with it?

I don't have a 'L0 at hand to try now.

From description in RM in LSE Clock Security System subchapter of RCC chapter:

The software MUST then reset the CSSLSEON bit and stop the defective 32 kHz oscillator

by resetting LSEON bit.

So, try to write 0 into CSSLSEON bit, ignoring that it's 0 already, then write 0 to LSEON.

Also, your original complaint was, that there's no interrupt - have you had a look at the RCC_CIFR.CSSLSEF and is RCC_CIER.CSSLSE set and is EXTI19 configured in EXTI, and the interrupt from it is enabled in NVIC and the address of ISR set at 0x0000_0048 in the interrupt vector table?

JW

Staly.1
Associate III

thanks for your reply,

i try to CLEAR_BIT(RCC->CSR, RCC_CSR_LSECSSON)

CLEAR_BIT(RCC->CSR, RCC_CSR_LSEON) ,

but the LSEON seems to be locked. no effects.

about the interrupt ļ¼Œ 

This function handles RTC global interrupt through EXTI lines 17, 19 and 20 and LSE CSS interrupt through EXTI line 19

so i just only enable HAL_NVIC_EnableIRQ(RTC_IRQn);ā€‹

ā€‹

ā€‹

> but the LSEON seems to be locked. no effects.

RTC reset should work (RCC_CSR.RTCRST).

JW

hi JW

yeah, RCCRST it 's work to clear the flag.

about the interrupt , i try to

CLEAR_BIT(RCC->CIFR,RCC_CIFR_CSSLSEF),

SET_BIT(RCC->CIER, RCC_CICR_LSECSSC);

enable the interrupt RCC_EXTI_LINE_LSECSS(EXTI_IMR_IM19)

and HAL_NVIC_EnableIRQ(RTC_IRQn)

then the interrupt could't trigger when LSE error

hi, JW

i 've triggered the LSE CSS interrupt.but the error trigger not very effective .

thank you for your help:smiling_face_with_smiling_eyes: