LSE no se habilita

0

Estoy usando una pastilla azul con STM32F103C8 y estoy tratando de depurar mi programa, pero cada vez que se apila en la activación del reloj LSE (LL_RCC_LSE_IsReady ()! = 1)

Tengo la siguiente configuración de reloj del sistema:

/* Set FLASH latency */
/* How many clock cycles should SYSCLK wait to access flash memory */
LL_FLASH_SetLatency(LL_FLASH_LATENCY_2);

/* Enable HSE oscillator */
LL_RCC_HSE_Enable();
while (LL_RCC_HSE_IsReady() != 1) {
};

/* Enable LSE oscillator */
LL_PWR_EnableBkUpAccess();
LL_RCC_ForceBackupDomainReset();
LL_RCC_ReleaseBackupDomainReset();
LL_RCC_LSE_Enable();
while (LL_RCC_LSE_IsReady() != 1) {
};

/* Main PLL configuration and activation */
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE_DIV_1, LL_RCC_PLL_MUL_9);
LL_RCC_PLL_Enable();
while (LL_RCC_PLL_IsReady() != 1) {
};

/* Sysclk activation on the main PLL */
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL) {
};

/* Set APB1 & APB2 prescaler*/
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_2);
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);

/* Set systick to 1ms in using frequency set to 72MHz */
LL_Init1msTick(72000000);

/* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */
LL_SetSystemCoreClock(72000000);

¿Alguien puede entender por qué?

    
pregunta thodkatz

1 respuesta

2

Encuentro la solución:

LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
LL_PWR_EnableBkUpAccess();
LL_RCC_ForceBackupDomainReset();
LL_RCC_ReleaseBackupDomainReset();
LL_RCC_LSE_Enable();

Primero debo habilitar el bus de alimentación periférico (LL_APB1_GRP1_EnableClock (LL_APB1_GRP1_PERIPH_PWR))

    
respondido por el thodkatz

Lea otras preguntas en las etiquetas