cancel
Showing results for 
Search instead for 
Did you mean: 

Failing to initialize BLE on a custom STM32WB55CGU6 board

Jaws404
Associate II

Hello,

I’m trying to create a simple program to test BLE functionality of my board. The board does not have HSE but it has LSE. I'm not sure if that is a problem. I'm using PlatformIO for the programming, configurations and building/flashing. 

When I upload the program to board it goes to infinite loop on

 

if (!BLE.begin()) {
 while (1); 
}

 

more specific on

 

__WEAK void shci_cmd_resp_wait(uint32_t timeout)
{
  for (unsigned long start = millis(); (millis() - start) < timeout;)
  {
    if (CmdRspStatusFlag == SHCI_TL_CMD_RESP_RELEASE)   // <---- looping here
    {
      break;
    }
  }
  return;
}

 


This could be result of multiple reasons. Some things I have tested are:

1. Use STM32CubeProgrammer to flash 
stm32wb5x_FUS_fw.bin to address 0x080EC000 
stm32wb5x_BLE_HCILayer_fw.bin to address 0x080E0000
and set application code target address to 0x08000000
as per release notes

CubeProgrammer is able to read FUS infos and also start wireless stack

Jaws404_0-1740082876966.png

2. Generate linker script with STM32CubeIDE and use it
3. Optimize platformio.ini to include and exclude certain stacks
4. Configure my custom board
5. Set clock configurations in variant_SAVI.cpp
6. Set BLE specific setting in app_conf_custom.h

However it always still seems to get stuck in the same loop even I update settings or code.
I would be really grateful if someone is able to point out the problem, be it hardware or software related.

Here you can find my project files and schematic:
https://github.com/nikorainto/custom-board-STM32WB55CGU6

1 ACCEPTED SOLUTION

Accepted Solutions
Lubos KOUDELKA
ST Employee

Hello,
HSE is crucial for RF functionality, without HSE RF cannot be used on STM32WB55.
Please check AN5290 and AN5165 for more details and guidance about STM32WB design including RF.

View solution in original post

3 REPLIES 3
Lubos KOUDELKA
ST Employee

Hello,
HSE is crucial for RF functionality, without HSE RF cannot be used on STM32WB55.
Please check AN5290 and AN5165 for more details and guidance about STM32WB design including RF.

Big thank you! I was 90% sure this is the case but was not able to verify it completely and also I'm not really good at embedded electronics.

rikvalentini
Associate

Hi Lubos I have the same problem

I hav a custom board STM32WB55CGU6 that I want to programme within Arduino IDE environment. Everything working fine besides BLE. The board is equipped with a 32KHz RTC quartz and a 32MHz for HSE. I have uploaded the files with STM32CubeProgrammer

 

stm32wb5x_BLE_Stack_full_fw.bin

with start address 

0x080D0000

and in sequence

stm32wb5x_BLE_HCILayer_fw.bin

with start address

0x080E0000

I want to use the STM32duino library. I am not able to initalize the begin function

// begin initialization
if (!BLE.begin()) {
Serial.println("starting BLE failed!");
while (1);
}
 

The script get stacked at this line and do not print any debug message as it is supposed to do. I also tried the example of library and my own code. Any Hint ? thanks Rik