I have 20 prototype custom boards, using STM32WB15CCU6E.
Some of them advertise, some no (about 50%).
If I program HeartRate binary, all advertise.
Based on a clean project, I just added 1 service with 2 characteristics.
The log generated by the BLE is always the same, generating or not advertisings, and
seems ok to me.
Modulo BLE Comecou a Rodar
Modulo BLE Inicializado ??? delay: 10
Wireless Firmware version 1.15.0
Wireless Firmware build 3
FUS version 1.2.2
>>== DBGMCU_GetRevisionID= 2000
>>== DBGMCU_GetDeviceID= 494
Success: SHCI_C2_BLE_Init command
==>> Start Ble_Hci_Gap_Gatt_Init function
Success: hci_reset command
Success: aci_hal_write_config_data command - CONFIG_DATA_PUBADDR_OFFSET
Public Bluetooth Address: 80:e1:21:13:f8:22
Success: aci_hal_write_config_data command - CONFIG_DATA_IR_OFFSET
Success: aci_hal_write_config_data command - CONFIG_DATA_ER_OFFSET
Success: aci_hal_set_tx_power_level command
Success: aci_gatt_init command
Success: aci_gap_init command
Success: aci_gatt_update_char_value - Device Name
Success: aci_gatt_update_char_value - Appearance
Success: hci_le_set_default_phy command
Success: aci_gap_set_io_capability command
Success: aci_gap_set_authentication_requirement command
==>> End Ble_Hci_Gap_Gatt_Init function
Success: aci_gatt_add_service command: pro_svc
Success: aci_gatt_add_char command : CHAR_TX
Success: aci_gatt_add_char command : CHAR_RX
Success: aci_hal_set_radio_activity_mask command
==>> aci_gap_set_discoverable - Success
==>> Success: Start Fast Advertising
a_AdvData : 08 09 3f 3f 3f 46 38 32 32
Yes, the debugger runs and also my aplication runs (serial port communicates).
HSE trimming : replaced the crystal between boards, same resuult of no advertising.
Tried to write some values into HSE trimming register, no result.
Tried some projects, some boards advertise (70%), some not.
My reference HEX file : BLE_HeartRate_reference.bin -> always advertise in all boards.
Starting new projects from STM32CubeMX, always get some boards not advertising.
I copied BLE_HeartRate as an example, modified it with STM32CubeMX to custom, added my
2 characteristics, then it wired in all my 41 boards.
I was not exceeding code memory, nor RAM, nor stack.
Tried dozens of projects, always arox. 30% of boards not advertising.
Using both crystals of 32MHz and 32,768KHz
At this time, after I converted BLE_HeartRate project, is running well.
Near 1 month trying until now.
IDE : 1.12.0, build : 14980_20230301_1550 (UTC)
installed originally as 1.3.0, and updated itself
Stack : tried 1.15.0 and 1.16.0, same results
Attached STM32WB15CCUX_FLASH_proj_ok.ld (from project that runs advertising OK)
STM32WB15CCUXE_FLASH_proj_nok.ld (from projects that some units don't advertise).
Tried to set bigger spaces for stack and/or heap, no different results.
Just received a notice that our manufacturer has just tested more 120 units with firmware revision OK, with advertising OK.
In STM32WB15CCUXE_FLASH_proj_nok.ld file, there is an extra dot for MB_MEM2 section:
*(.MB_MEM2) ; instead of *(MB_MEM2) ;
Due to this, the buffers that need to be in SRAM2 are not placed there, so your application doesn't work. It will be corrected in the next release.