cancel
Showing results for 
Search instead for 
Did you mean: 

Struggling with Example Application. Heart Rate not broadcasting. No main loop.

JWieb
Associate III

Using the latest STM32WB V1.13.1 Firmware Package I can't seem to get any of the example BLE applications to run.

I have upgraded the co-processor firmware and FUS accordingly.

Trying to run this application I imported into STM32CubeIDE and compiled. Set my debugger and run.

STM32WB5MM-DK\Applications\BLE\BLE_HeartRate

I get the following output on my UART terminal

Wireless Firmware version 1.13.0
Wireless Firmware build 5
FUS version 1.2.0
 
SHCI_SUB_EVT_CODE_READY - WIRELESS_FW_RUNNING 
DBGMCU_GetRevisionID= 2001

The OLED display says "ST BLE HEART RATE"

But the application appears to be frozen and not advertising. Verified with 2 phones using ST BLE Sensor and nRF Connect apps. No Advertising.

So from there i added a printer into the main loop.

if (timerTick + 1000 < HAL_GetTick()){//should print 1HZ
     APP_DBG_MSG("%d LOOP\n", HAL_GetTick());
}

But nothing gets printed. Where can i go from here?

2 REPLIES 2
TDK
Guru

Does APP_DBG_MSG work at all?

> if(HAL_GetTick() % 1000 == 0){ //should print 1HZ

> APP_DBG_MSG("%d LOOP\n", HAL_GetTick());

> }

Not a reliable code here.

If your main loop gets ran more than once per ms, that statement will get print out potentially many many times. If it gets ran less than once per ms, that statement may never run.

It would be better to reliably set a flag once per second and print out and clear the flag when it's set.

If you feel a post has answered your question, please click "Accept as Solution".
JWieb
Associate III

Thanks for the fast response @TDK​. I quickly revised my printer with a variable since i though that might be the case. See above.

APP_DBG_MSG does work. I start the program with APP_DBG_MSG ("Begin").

I found the source of the problem to be a corrupt co-processor binary. I re flashed stm32wb5x_BLE_Stack_full_fw.bin and its adverting now!

The UART terminal now outputs

Wireless Firmware version 1.13.0
Wireless Firmware build 5
FUS version 1.2.0
 
SHCI_SUB_EVT_CODE_READY - WIRELESS_FW_RUNNING 
DBGMCU_GetRevisionID= 2001 
 
Device Information Service (DIS) is added Successfully 000C
Manufacturer Name Characteristic Added Successfully  000D 
Heart Rate Service (HRS) is added Successfully 000F
Heart Rate Measurement Characteristic Added Successfully  0010 
Sensor Location Characteristic Added Successfully  0013 
Control Point Characteristic Added Successfully  0015 
First index in 0 state 
Successfully Start Fast Advertising 
4325 LOOP

This is mostly troubleshooting for any future google searches.