Skip to main content
Visitor II
December 20, 2025
Question

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

  • December 20, 2025
  • 6 replies
  • 164 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

    This topic has been closed for replies.

    6 replies

    Graduate II
    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

    Visitor II
    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().

    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

    Visitor II
    January 7, 2026

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

    Graduate
    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.

    Visitor II
    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?

    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

    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.

    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

     

    Visitor II
    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