Skip to main content
gocchan
Associate III
June 25, 2026
Solved

How to develop software for a custom board without a 32kHz Xtal.

  • June 25, 2026
  • 6 replies
  • 124 views

Hello,
I'm prototyping a custom board equipped with a WBA23KE and developing its software.
Since this custom board doesn't have a 32kHz crystal, I modified the code based on BLE_p2pServer, referencing the description on the following website.
LSEクリスタルなしでSTM32WBA上でRFアプリケーションを動かす方法 - stm32mcu
However, the HAL_RTC_Init() function on line 615 of the attached main.c fails and goes into ErrorHandler().
How should I modify the code?

Best answer by gocchan

I discovered that it works even without directly editing the code in CubeIDE; you just need to configure it correctly in CubeMX and generate the code.

I think all you need to do is avoid selecting LSE in the Clock Configuration in MX.

 

6 replies

Pavel A.
June 25, 2026

In line 323 HAL_PWR_EnableBkUpAccess() is commented out. Uncomment  it.

 

gocchan
gocchanAuthor
Associate III
June 29, 2026

I commented it out, but the situation didn't change.

gocchan
gocchanAuthorBest answer
Associate III
July 23, 2026

I discovered that it works even without directly editing the code in CubeIDE; you just need to configure it correctly in CubeMX and generate the code.

I think all you need to do is avoid selecting LSE in the Clock Configuration in MX.

 

ClaudioVertemara
ST Employee
August 7, 2026

Hi ​@gocchan,

I believe you already figured it out, but please find below a helpful Wiki article in case you still need it.

https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WBA_without_LSE_crystal

Kind regards,
Claudio

Explorer II
August 7, 2026

The hyperlink in his post is the Japanese version of the Wiki page.
Maybe some configuration wrong with the clock tree.

Laurent LOUAZON
ST Employee
August 20, 2026

Hello,

Please note that LSI2 option is not available for stm32wba2;
Wiki https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WBA_without_LSE_crystal is only valid for STM32WBA5 and STM32WBA6.
If willing to use STM32WBA2 without LSE Xtal, you should use HSE/1000 for low speed clock but you will not get low power mode.

 

Regards
Laurent