2022-09-06 12:09 AM
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;
}
}
Please Advise
2022-09-06 12:16 AM
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?
2022-09-06 12:22 AM
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.
2022-09-06 12:27 AM
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
2022-09-06 12:46 AM
2022-09-06 12:47 AM
2022-09-06 12:54 AM
Use longer or infinite timeout, LSE startup may take tens of seconds. Try different LSE drive strength, see RCC_BDTR. Read AN4759.
JW
2022-09-06 02:41 AM
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,
2022-09-06 03:41 AM
try: set in Cube -> LSE osz. : hi drive
low drive will not startup with some crystals.
(there is ANxxx about this problem, with list of tested crystals, running on low drive.)
2022-09-06 11:46 AM
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