2024-11-13 08:45 AM
Hi,
I'm working with the nucleo-wb15cc board. The program itself is working great but I encounter issues everytime I unplug/replug the USB cable during operation:
The program reports HAL_TIMEOUT druing SystemClock_Config(). To be more specific, it gets stucked in the while loop here:
/* Check the LSE State */
if (RCC_OscInitStruct->LSEState != RCC_LSE_OFF)
{
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till LSE is ready */
while (LL_RCC_LSE_IsReady() == 0U)
{
if ((HAL_GetTick() - tickstart) > RCC_LSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}
}
else......
I see from the clock diagram that LSE is involved in RTC Clock Mux and RFWKP Clock Mux.
BOOT0 is pulled to GND according to schematic.
I figured out a way to go around the issue, of which I also don't understand the mechanism: by flashing the Heart_Rate example codes and reflashing my own codes, the program can run again without any issues. However, I need to reflash my codes twice because I'll get a hard fault after the first reflash. It works again after the second reflash.
My application: collecting data with ADC, using DMA with sampling rate defined by HAL_TIM, update Bluetooth characteristic in ADC_Cplt_Callback by sending the 12-bit ADC-value in 2 seperate bytes. I used the timer from HW_TS to have 5ms between each update. HSE&LSE: both bypass clock source.
Have a nice day :)