cancel
Showing results for 
Search instead for 
Did you mean: 

HSE RDY high without HSE clock ?

Aditya Mall
Associate II
Posted on April 29, 2018 at 13:55

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-f401re
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on April 29, 2018 at 18:52

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2
Posted on April 29, 2018 at 18:52

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 29, 2018 at 19:32

Hi Clive,

Thanks a lot for clearing this, it was silly of me not review the schematics datasheet before.. lol