fix: correctly deinit rcc before hse sw
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#ifndef _FUNCONFIG_H
|
||||
#define _FUNCONFIG_H
|
||||
|
||||
#define FUNCONF_USE_HSE 1
|
||||
// #define FUNCONF_USE_HSE 1
|
||||
#define FUNCONF_SYSTEM_CORE_CLOCK 120000000
|
||||
#define FUNCONF_PLL_MULTIPLIER 15
|
||||
// #define FUNCONF_PLL_MULTIPLIER 15
|
||||
#define FUNCONF_SYSTICK_USE_HCLK 1
|
||||
|
||||
#endif
|
||||
|
||||
12
main.c
12
main.c
@@ -29,13 +29,21 @@
|
||||
struct netif g_netif;
|
||||
static volatile int g_httpd_is_initialized = 0;
|
||||
|
||||
int clock_init(void);
|
||||
void led_init(void);
|
||||
void lwip_stack_init(void);
|
||||
|
||||
static void set_sysclk_to_120mhz_from_hse(void) {
|
||||
volatile uint32_t startup_counter = 0;
|
||||
uint32_t startup_counter = 0;
|
||||
|
||||
RCC->INTR = 0x009F0000; // clear PLL, CSSC, HSE, HSI and LSI ready flags.
|
||||
// switch processor back to HSI so we don't eat dirt.
|
||||
RCC->CFGR0 = 0;
|
||||
// disable PLL so we can play with it.
|
||||
RCC->CTLR &= ~RCC_PLLON;
|
||||
// not sure why, need to reset here, otherwise PLLXTPRE is set.
|
||||
RCC->CFGR0 = RCC_PLLSRC;
|
||||
|
||||
// enable HSE
|
||||
RCC->CTLR |= RCC_HSEON;
|
||||
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user