Skip to main content
Associate
December 20, 2025
Question

NUCLEO-F401RE + x-cube-ble1: Hard Fault

  • December 20, 2025
  • 7 replies
  • 899 views

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

7 replies

Issamos
Lead III
December 20, 2025

Hello @BareMetaler 

I don’t think this issue is related to the IDE version. Are you using a personal project or one of the available examples?

Best Regards.

II

Associate
January 7, 2026

I'm using the x-cube-ble1 demo program that I downloaded. To test the program, I installed the ST BLE Sensor app on my my iPhone, then subsequently loaded the nRF Connect app, but haven't tried that yet because of how the program is jumping straight to the HAL-Init() > HardFault_Handler().

KnarfB
Super User
December 20, 2025

The HAL source code version is independent of the IDE version. 

HAL_Init does only the most basic initialization and is not specific to a demo.

So your HW+SW setup may have some general issue.

I doubt that changing the IDE version may fix that, but you may try.

The IDE comes with a hard fault analyzer and you may dig into that

or start with a new empty project to verify your HW+SW setup.

hth

KnarfB

Associate
January 7, 2026

I downloaded the BLE demo as a way to verify my HW-SW setup. What you do recommend I do?

gbm
Principal
December 20, 2025

Oh, that's quite simple as soon as you realize that "to avoid going down any unnecessary rabbit holes" is the same as "to avoid ChatGPT".

Stay away from AI-generated stuff, use the official ST demo code. Also, the proper platform for modern BLE development is STM32WB series.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Associate
January 7, 2026

So you're saying that my NUCLEO-F401RE won't work to do a simple BLE demo?

I am using the ST demo code that I downloaded from the STMicroelectronics site. Where else would I get it?

Andrew Neil
Super User
January 7, 2026

@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

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
December 20, 2025

@BareMetaler wrote:

HAL-Init() which goes directly to the HardFault_Handler()


What do you mean by that?

Have you stepped into HAL_Init() to see exactly where the Hard Fault happens, and what causes it?

 

Debugging Cortex-M (including STM32) Hard Faults.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
December 20, 2025

@BareMetaler wrote:

ChatGPT. It recommends Version 1.19.0. Is this correct?


It is out of date - v2.0.0 was released on 18 November:

STM32CubeIDE 2.0.0 released

 

Note that the big difference between v2.0.0 and v1.x.x is that CubeMX is no longer integrated - it is now just a standalone tool:

STM32CubeIDE 2.0.0 workflow tutorial

 

So this means that a lot of tutorials & documentation (both ST's and 3rd parties) are now out-of-date.

In that respect, you might find it easier to use an earlier version of CubeIDE - such as v1.19.0

 

Note that you can have multiple versions of CubeIDE all installed at the same time and working independently - you just need to keep a separate workspace for each.

 

If you want to use AI, ST's own "Sidekick" might be a better bet:

STM32 Sidekick: the AI-powered tool that accelerates your design journey

How to use STM32 Sidekick

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
January 7, 2026

Let me start over here. I need to know if I can even get there from here, one or zero, yes or no. I just bought these items through Digikey, brand new out of the box.

 

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

Associate
January 13, 2026

There are 2 videos, one has music background, the other spoken word. I went through the music one using the NUCLEO-F401RE. The only problem I had was that the app_bluenrg_ms.c errored in when I built the app, saying that the #include "stm32f4xx_hal_tim.h" was unresolved. I dug in and found that it should ultimately be included via main.h. I commented it out, compiled and figured what's the worst that could happen, but it connected to the ST BLE iPhone app doing the Environmental simulation. 

I received the NUCLEO-L476RG and may try it also following the same procedure because I'm lead to believe any of the NUCLEO boards should work. What I want to do is move on and use the MEMS board. My goal is to get started with BLE and IoT.