cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB Service not being created due to "Out of Memory" error (0x98)

BH.1
Associate II

I have used CubeMX to generate two sets of code, each for their respective MCU, for a simple bluetooth test for both a nucleo board with a STM32WB55RGV6 MCU and a custom board with a STM32WB55VEQ6 MCU. The bluetooth test consists of a GATT server with one service that has two characteristics.

Both MCUs are using the stm32wb5x_BLE_Stack_full_fw version 1.14.1.1 binary.

It is important to note that I can connect to both boards using the ST BLE Toolbox Iphone application. This leads me to believe that this is not a hardware issue with the custom board.

When I load the code onto the nucleo board I am able to see the service and both characteristics. When I load the code onto the custom board I do not see the intended service, instead I see a service with the UUID FD44, and no characteristics.

When I step through the code on the custom board, aci_gatt_add_service() returns the error code 152 (0x98) when attempting to create my custom service. This error code corresponds to the error "out of memory" from AN5270.

The flash memory is the only difference between the STM32WB55RGV6 and the STM32WB55VEQ6. The test program only uses 40.5KB of memory, which is well below the 512KB of flash on the custom board with the STM32WB55VEQ6.

What could be causing the "out of memory" error on the custom board, but not the nucleo board?

4 REPLIES 4
Remy ISSALYS
ST Employee

Hello,

You can check the value of the following parameter in app_conf.h file to see if these parameters are set to the same value in each project:

CFG_BLE_ATT_VALUE_ARRAY_SIZE
 
CFG_BLE_NUM_GATT_ATTRIBUTES
 
CFG_BLE_NUM_GATT_SERVICES

Best Regards

BH.1
Associate II

@Remy ISSALYS​ - I have checked the parameters in each file. The parameters have the same value in each file.

The values are shown below:

#define CFG_BLE_ATT_VALUE_ARRAY_SIZE  (1344)
 
#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
 
#define CFG_BLE_NUM_GATT_SERVICES  8

In addition I am not seeing the error code 152 (0x98) appear any more. Instead, on the custom board I just see a service with the UUID FD44 and no characteristics. On the Nucleo board I am still seeing the correct bluetooth service and characteristics.

Remy ISSALYS
ST Employee

Hello,

According to release note, on your custom board the BLE Full stack must be flashed at 0x0805A000, can you check this point?

Can you try with an example available in STM32CubeWB package like BLE_HeartRate, to see if it's working as expected?

Best Regards

Hello Remy,

The issue has been resolved after making some changes to the hardware. Thank you for your help.