2018-04-29 04:55 AM
I am using the Nucleo-64 board F401RE, as the name suggest comes with STM32F401RE.
The board doesn't have an external clock (X3 mentioned on the board) and still the HSE RDY register gets enabled , which is actually hardware enabled as per datasheet.
int main(void)
{ RCC_TypeDef *pRCC; pRCC = RCC; /** 1) Turn on the HSE Oscillator, by accessing the RCC clock control register (RCC_CR) * 2) Select HSE as the system clock, by accessing the RCC clock configure register (RCC_CFGR) */ //1) Turning on RCC_CR by enabling 16 bit. pRCC->CR |= (1 << 16); /** We need to wait after the HSE register is enabled for the HSE to become stable, * This status is show by HSE RDY (Ready) register which enabled by the MCU. (17th bit). */ //wait!! till HSE RDY becomes 1 while(! (pRCC->CR & (1 << 17)) ); HSE gets enabled and the code gets out of the loop
//2) Toggling the SW register to [0 1] (SW1 and SW0) on RCC_CFGR for switching HSE as system clock
pRCC->CFGR &= ~(0x3 << 0); //clearing the first two bits sw1 and sw0, best practice pRCC->CFGR |= (0x1 << 0); //As per datasheet 01:HSE enable, setting first bit as 0 return 0;}https://community.st.com/tags♯/?tags=nucleo-64
‌https://community.st.com/tags♯/?tags=nucleo-f401re
‌https://community.st.com/tags♯/?tags=hse%20issue
‌#nucleo-64 #hse-issue #nucleo-f401reSolved! Go to Solution.
2018-04-29 09:52 AM
The NUCLEO will by default have an 8 MHz signal applied to the OSC_IN pin from the MCO (PA8) pin of the ST-LINK.
Review Manual and Schematic.
Ready in this context is signal at OSC_IN
2018-04-29 09:52 AM
The NUCLEO will by default have an 8 MHz signal applied to the OSC_IN pin from the MCO (PA8) pin of the ST-LINK.
Review Manual and Schematic.
Ready in this context is signal at OSC_IN
2018-04-29 12:32 PM
Hi Clive,
Thanks a lot for clearing this, it was silly of me not review the schematics datasheet before.. lol