cancel
Showing results for 
Search instead for 
Did you mean: 

How to use timer interrupt to trigger the sending of BLE data every specified second for STM32WB5MMG using STM32CubeIDE?

SWong.10
Associate II

Hi,

I'm using STM32WB5MMG and want to send 8-bit data through BLE every specified duration (e.g. 1s). I have tested the Bluetooth and timer interrupt separately and both works fine. However, when I tried to trigger the Bluetooth using timer interrupt as shown in the following code, both stop working.

0693W00000YAOY8QAP.pngThe error is:

0693W00000YAX34QAH.png 

8 REPLIES 8
Javier1
Principal

>>send data through BLE every specified duration (e.g. 1s)

Youre talking about BLE characteristic notification.

How long is your data?

we dont need to firmware by ourselves, lets talk

Hi,

The data is 8-bit. I have tested the Bluetooth separately and it is able to send data successfully. The problem is when I tried to use timer interrupt to trigger the Bluetooth. Or is there other methods to send the data every specified second without using timer?

I'm quite new to this and any reply would be appreciated.

Thanks.

Remy ISSALYS
ST Employee

Hello,

You can look BLE_HeartRate example available in STM32CubeWB package which allow to send heart rate measurement to the smartphone each second through BLE using a timer (see TimerMeasurement_Id) which trig a task (see CFG_TASK_MEAS_REQ_ID) that send data each second.

Best Regards

Hi SWong,

I am sorry to intrude your thread question. I am trying to implement the BLE communication with STM32WB5MMGH with my customer board. I am able to load BLE_HeartRate example that I got from STM32 example successfully, but when I tried to implement my own custom template because I don't want to use HeartRate BT SIG, I never successfully get BLE advertises nor seen by ST BLE tool box.

Can you please give me some advices or suggestions about your approach how did you do implement BLE on your application?

Hi Remy,

May I ask if there is any video or any document showing how to develop a simple BLE using custom template that can send and receive data from ST BLE tool box for STM32WB5MMG mcu?

Remy ISSALYS
ST Employee

Hello,

You can look this wiki page which describes how to generate a Bluetooth® Low Energy (BLE) server custom application for STM32WB55RG MCU using STM32CubeMX software.

Best Regards

Jtron.11
Senior

Remy,

Thank you for your pointer. Just for my confirmation, the STM32WB5MMG will work exactly like STM32WB55RG MCU if I follow the wiki page? I already tried it before I asked the question anyway. Is there any additional step I need to do extra for STM32WB5MMGx?

Also, is there any github so I can download the source code as the wiki page example?

The reason I asked because after I follow the steps and the code was generated, I still see there is a missing function call  APPD_Init(); under APPE_Init() function.

Remy ISSALYS
ST Employee

Hello,

Yes, the STM32WB5MMG will work exactly like STM32WB55RG MCU. There isn't additional step for STM32WB5MMGx. The source code generated with STM32CubeMX tool describes in the wiki is available in STM32CubeWB Package see BLE_Custom project.

You can also find some examples running on the discovery kit which embeds the STM32WB5MMG in the STM32CubeWB package.

Best Regards