cancel
Showing results for 
Search instead for 
Did you mean: 

[stm32wb55] Replicate BLE cable replament with CudeIde code generator fails no tx event

juvann
Associate III

I have a dev board NucleWB55 and I'm trying to replicate the application BLE Cable Replacement using code generator of STMe2CubeIde 1.11.0. I configured 1 service with 2 charateristic, read and write no response for tx and read notify for rx.

From an external app android 2 firmware are identical.

I checked many times init code are identical.

In my code generated when I try to send data to ble device with the app serial bluetooth terminal, no event is generated, but with the same app and firmware Cable Replacement I receive the event of data received.

Is it an issue?

I'd like keep the code generator in my test project, so I can easly add code in the future, but it's very hard.

Thank you for suggestions.

5 REPLIES 5
Remy ISSALYS
ST Employee

Hello,

If you have recreated the BLE cable replacement example using STM32CubeMX tool with custom template, maybe you have to add some code into user section to manage the event. You can compare the two projects to see what is missing in your app.

Best Regards

Hello,

I tried but without success. I solved without using CubeMX I copied crs_app.c and crs_stm.c in a file ble_uart.c and called init and works.

It would be nice if STM32CubeMX could generate code for BLEUart from template.

Best Regards

ICMosquera
Associate III

Sir, @juvann,

By means, how did you copied the crs_app.c and crs_stm.c on your existing project? Im also on loss regarding this. I have a custom function that can also send string using the cable replacement but on my new project(using custom template) it doest work.

Your help would be appreciated.

 

Thanks,

Ian

DrewJalen
Associate

I'm facing a perplexing situation with my dev board ST-XYZ while trying to replicate a BLE application using the code generator in STMe2CubeIde 2.0.0. I've configured one service with two characteristics, one for data transmission (TX) with no response and another for data reception (RX) with read notify. Strangely, when I attempt to send data to the BLE device from an external Android app, I'm not receiving any events in my test project. When I use the same Android app with a different firmware and the Cable Replacement project, I successfully receive data events. I've meticulously compared the initialization code and settings between my test project and the working Cable Replacement project, but I'm still unable to figure out the root cause of the issue. Contact me here https://techinstructs.com/

ICMosquera
Associate III

Hi Drew,

I had solved my problem regarding this. I hope this will help you so please bear with me.

Sending From Device to Phone
On your custom xx_Update_Char() function, make sure that you use the UUID of your second characteristic (the one that reads without notify). In my case the RX char not the TX char. 

On sending from Phone to device.
Look out for the code XX_STM_Notification() function on your XX_App.c. This is fired when data are being sent to the device. Look for the event where the event Opcode is XX_WRITE_Event. This is where you code your string management. Data received here is stored on p_Notification->DataTransfered.pPayload. You can do whatever you want on this string.

 

Hope this helps,
IAN