Skip to main content
Visitor II
February 23, 2026
Question

stm32wb55: Read characteristic value in BLE application

  • February 23, 2026
  • 1 reply
  • 207 views

I have established BLE advertisement and connection is established successfully between ST BLE toolbox and the stm32wb55 based board.

I am unable to read the chateristic value from the st ble tool box.

My code is 

in custom_app.c   file

I2C_HandleTypeDef hi2c1;
 int sizecharwrite;
 uint8_t my_value =5;
 float adc_voltage_ble = ADS1115_readSingleEnded_AIN0(&hi2c1);

 uint8_t pPayload;
 sizecharwrite=snprintf( ble_voltage,sizeof(ble_voltage),"%0.2f", adc_voltage_ble );

 if (sizecharwrite < 0 || sizecharwrite >= sizeof(ble_voltage)) {
 // Error or truncation
 return;
 }
 memcpy(pPayload,&ble_voltage, sizeof(ble_voltage));
 
In the cutom_stm.c    file
 aci_gatt_update_char_value(CustomChemdetectHdle,
 CustomCharwriteHdle,
 0, /* charValOffset */
 SizeCharwrite, /* charValueLen */
 (uint8_t ) pPayload);

Edited to apply source code formatting - please see How to insert source code for future reference.

1 reply

ST Technical Moderator
March 30, 2026

Hello @sound,

Ensure the characteristic is configured with the 'Read' property and correct permissions. 

You can follow the guidelines in the ST wiki articles: 

I advise you to monitor the debug Output logs for errors during characteristic read requests.

 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks