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
  • 5 replies
  • 84 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.

 

5 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
August 7, 2026

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