STM32WB Service not being created due to "Out of Memory" error (0x98)
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?