cancel
Showing results for 
Search instead for 
Did you mean: 

External Clock 32khz hangs the CPU.

Ephraimoved
Associate III

Dear Sir.

we have some identical boards based on STM32U585 . The RTC is configured to produce

32.768 KHZ at pin PA8.

On one board the same code will not pass the code will not pass the

  /* Wait till LSE is ready */

   while (READ_BIT(RCC->BDCR, RCC_BDCR_LSERDY) == 0U)

   {

    if ((HAL_GetTick() - tickstart) > RCC_LSE_TIMEOUT_VALUE)

    {

     return HAL_TIMEOUT;

    }

   }

  1. Is it possible that the External clock is not working.
  2. Is there a way to tell with some code that the External oscillator is working.

Please Advise

9 REPLIES 9
Javier1
Principal

I am a bit confused, did you mean :

The RTC is configured to produce

32.768 KHZ at pin PA8.

The PA8 pin is configured as RCC_MCO? and my master clock is taken from the LSE interface

If this is the case, how certain are you the microcontroller is receiving the LSE clock in the first place?

we dont need to firmware by ourselves, lets talk
Ephraimoved
Associate III

Hi.

I accidently upload the question before adding some code.

Yes you are correct the RCC_MCO toggles at 32.768 khz,

On other board the CPU is stuck at the same configuration.

is this a custom board? maybe post some pcb pictures (detail of your LSE xtal)

"If this is the case, how certain are you the microcontroller is receiving the LSE clock in the first place?"

is your board running ? even if you scant see anything in Pa8

we dont need to firmware by ourselves, lets talk
Ephraimoved
Associate III

Hi.

It is a custom board .

Attached schematic of CPU.

On one board PA8 produce 32.768 khz. On other board the CPU is stuck .

Ephraimoved
Associate III
 

Use longer or infinite timeout, LSE startup may take tens of seconds. Try different LSE drive strength, see RCC_BDTR. Read AN4759.

JW

Ephraimoved
Associate III

Hi.

 __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); cahnged to

__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_HIGH);

/* Wait till LSE is ready */

   while (READ_BIT(RCC->BDCR, RCC_BDCR_LSERDY) == 0U)

   {

    if ((HAL_GetTick() - tickstart) > 10000000UL)//RCC_LSE_TIMEOUT_VALUE)  // ephraim

    {

     return HAL_TIMEOUT;

    }

   } changed to RCC_LSE_TIMEOUT_VALUE 100000UL and than to 10000000UL .,

CPU is stuck.

Please Advise,

AScha.3
Chief II

try: set in Cube -> LSE osz. : hi drive

0693W00000SubO2QAJ.png 

low drive will not startup with some crystals.

(there is ANxxx about this problem, with list of tested crystals, running on low drive.)

If you feel a post has answered your question, please click "Accept as Solution".

Well then your LSE does not start.

Check for proper soldering (i.e. if there are no bad solder joints). Wash the board from any soldering residui. Check if you've used proper capacitors and the crystal is OK.

JW