Unable to set clock frequency above 32MHz
Hey guys,
Im running into some issues with trying to set the clock speed of my stm32wb55 chip above 32MHz on my custom board.
Here is my baremetal startup code that works using MSI as sysclk
void __attribute__((naked)) Reset_Handler()
{
__asm__("ldr r0, =_estack\n\t"
"mov sp, r0");
// Copy data section from flash memory to ram
uint32_t data_section_size = _edata - _sdata;
memcpy(_sdata, _sidata, data_section_size*4);
// Zero out bss
uint32_t bss_section_size = _ebss - _sbss;
memset(_sbss, 0, bss_section_size*4);
// Set Interrupt Vector Table Offset
SCB->VTOR = (uint32_t)interrupt_vector_table;
rcc_reset();
RCC->CR &= ~(RCC_CR_MSIRANGE);
// RCC_MSI_CLOCK_SPEED_32MHz = 0xa
RCC->CR |= RCC_MSI_CLOCK_SPEED_32MHz << RCC_CR_MSIRANGE_Pos;
main();
}However if I change line 20 to this:
// RCC_MSI_CLOCK_SPEED_48MHz = 0xB
RCC->CR |= RCC_MSI_CLOCK_SPEED_48MHz << RCC_CR_MSIRANGE_Pos;My program will refuse to run. Trying to step through with gdb after this line will result in a SIGTRAP.
I get the same results if I configure the PLL clock to anything greater than 32MHz and use that as my sysclk.
Any thoughts on this? Could it be an unstable power supply on my custom board?

