Correctly check PLL readiness

This commit is contained in:
Alexander Heldt
2024-12-30 11:46:10 +01:00
parent a1c43ad21c
commit a63527a997
5 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@@ -150,7 +150,7 @@ system_clock_init:
ldr r3, .L5
ldr r3, [r3]
.loc 1 54 47 discriminator 1
and r3, r3, #131072
and r3, r3, #33554432
.loc 1 54 10 discriminator 1
cmp r3, #0
beq .L3

View File

@@ -2288,7 +2288,7 @@ static void system_clock_init(void) {
while (!(((struct rcc *) (0x40023800U))->CR & (1 << 17)));
while (!(((struct rcc *) (0x40023800U))->CR & (1 << 25)));
((struct flash *) (0x40023C00U))->ACR |= (1 <<10);

Binary file not shown.

View File

@@ -51,7 +51,7 @@ static void system_clock_init(void) {
// Wait indefinitely for PLL to be ready
// TODO indicate error/timeout somehow?
while (!(RCC->CR & RCC_CR_HSERDY_READY));
while (!(RCC->CR & RCC_CR_PLLRDY_LOCKED));
// Enable caching of instructions and data
FLASH->ACR |= FLASH_ACR_DCEN_ENABLE;