2025-12-19 4:19 PM - last edited on 2025-12-20 1:45 AM by Andrew Neil
I’m attempting to learn BLE and IoT and have purchased the following boards to get started.
NUCLEO-F401RE MCU brd
X-NUCLEO-IDB05A2 BLE Expansion brd
Downloaded:
STM32CubeIDE Version: 2.0.0 Build: 26820_20251114_1348 (UTC)
STM32CubeMX Version: 6.16.1
x-cube-ble1 BLE Demo
The main program calls HAL-Init() which goes directly to the HardFault_Handler()
My preliminary conclusion is that Version 20.0.0 is not compatible with the demo program based on help I sought on ChatGPT. It recommends Version 1.19.0. Is this correct?
May need to back up and start from scratch and would appreciate a point in the right direction to avoid going down any unnecessary rabbit holes.
Thank you, BareMetaler
2026-01-07 10:16 AM
@BareMetaler wrote:So you're saying that my NUCLEO-F401RE won't work to do a simple BLE demo?
Did you read the description of the X-CUBE-BLE1 ?
It says that the ready-to-go demo is for NUCLEO-L476RG - so you're going to have to do some work to adapt it for a NUCLEO-F401RE...
As @KnarfB said, HAL_Init() occurs very early in the system startup, so the problem is unlikely to be anything to do with the BLE - it won't have reached anything to do with that.
You need to find where & why it's going wrong in HAL_Init()
See also: Debugging Cortex-M Hard Faults
2026-01-07 11:11 AM
Andrew,
Thanks a million. It looks like I need to quite crying and do some reading first but at least I'm headed in the right direction. Adapting the F401RE is a little over my head at this point. I stepped through the code and got to the HAL_Init() failure but really didn't understand where to go from there. There's no code in the HardFault_Handler() other than an infinite loop statement. At least Chatgpt got me here and now I can start heading down the right path. I'll order the L476RG and chalk it up to experience. There are many opportunities locally with STM32 controllers, BLE and IoT. I have had exposure to STM32's on my last assignment but it was with SOMs designed by Emcraft, so hopefully I won't be too much of a drag on the forum. I will try to verify the hardware with the correct board and report back.
2026-01-07 4:51 PM
Andrew,
> Did you read the description of the X-CUBE-BLE1 ?
Am I missing something?
https://www.st.com/en/embedded-software/x-cube-ble1.save-bookmark.html
"Learn how to use the X-CUBE-BLE1 expansion software package for STM32Cube.
Discover the steps required to generate a BLE sample application
With STM32CubeMX using a NUCLEO-F401RE, a X-NUCLEO-1DB05A1 and the
STBLESensor app for Android and iOS."
2026-01-08 1:27 AM
2026-01-08 9:52 AM
Andrew,
If you click the link I provided in my last post, you will see that it goes to the same page shown in the screen shot you've provided.
The sentence you've underlined has the term 'NUCLEO-L476RG' yet both instructional videos at the bottom of the page only reference the NUCLEO-F401RE. One word vs 2 instructional videos. Please forgive my ignorance as I'm new here, but how is it intuitively obvious which one to use?
Just to clarify my own thinking, are you saying that if I use the NUCLEO-L476RG, that I would not have to go through the configuration process shown in the videos that use the NUCLEO-F401RE?
Thank you for your patience.
2026-01-08 9:59 AM
I see.
I don't know what's going on there, then.
2026-01-08 10:02 AM
If I use the NUCLEO-L476RG, do I not have to go through the configuration process shown in the videos that use the NUCLEO-F401RE?
2026-01-08 10:18 AM
I'm just going by the text I highlighted - it suggests that there is a ready-to-go example for NUCLEO-L476RG.
As I said before, that doesn't mean that the X-NUCLEO-1DB05A1 cannot be used on any other Nucleo - just that some extra work may be required.
Have you studied the User Manual UM1873, "Getting started with the X-CUBE-BLE1 Bluetooth Low Energy software expansion for STM32Cube" ?
via: https://www.st.com/en/embedded-software/x-cube-ble1.save-bookmark.html#documentation
2026-01-08 11:15 AM
Well, there is a pdf that came with the x-cube-ble1 download that has the same title (Getting started with the STMicroelectronics X-CUBE-BLE1 software package for STM32CubeMX) but it isn't the UM1873.
I grabbed the UM1873. I see what you mean by there being a little work involved and I think that's what's covered in the videos that go through a whole project configuration, assigning pins and clock rates on the NUCLEO-F401RE. I've got the NUCLEO-L476RG on order anyway.