[ STM32WB5MMG ] : CPU2 stuck in non discovery state....
Hi,
I have a custom board with a STM32WB5MMG module.
This board is very simple. It is a Bluetooth dongle which act as an intermediate between and a serail bus for an other board.
In some case, almost one time in 10, at power up, the dongle still stuck in a state where it can't connect to the counterpart.
------------------------------------------
The program is based on "Custom Template" from the "Server Mode" in the STM32_WPAN configuration.
For now, the behaviour is very simple :
- I have a server named FS.01 (Bluetooth short local name)
- I have a scanner named HS.01 (Bluetooth short local name)
- the scanner search FS.01, connect to it , discover all services associated and wait data from server through notifications.
------------------------------------------
As you could see in the log below (I add some makers [?] for clarity) :
- the start of the MCU is going well
- [1] the program still some several seconds at "** START GENERAL DISCOVERY (SCAN) ** ". When the program working correctly, I could see the discovery of multiples devices around me.
- [2] after the timeout, the program receive the event "ACI_GAP_PROC_COMPLETE_VSEVT_CODE", and the value of BleApplicationContext.DeviceServerFound is different from 0x01.
- If I do nothing, the program still stuck in this state.
- I try differents solutions to solve it.
- [3] initialy, I try to call NVIC_SytemReset. The main program reboot but I still stuck without to see any server
- [4] I try to call "aci_gap_terminate" without any visible results.
- [5] I try to call "aci_hal_stack_reset" without any visble results.
Connect <CR><LF>
> search server FS.01 ...<CR><LF>
Wireless Firmware version 1.16.0<LF>
Wireless Firmware build 4<LF>
FUS version 1.2.0<LF>
>>== SHCI_SUB_EVT_CODE_READY<LF><CR>
>>== WIRELESS_FW_RUNNING <LF>
>>== DBGMCU_GetRevisionID= 2001 <LF><CR>
>>== DBGMCU_GetDeviceID= 495 <LF><CR>
Success: SHCI_C2_BLE_Init command<LF><CR>
Start Ble_Hci_Gap_Gatt_Init function<LF><CR>
Success: hci_reset command<LF><CR>
Success: aci_hal_write_config_data command - CONFIG_DATA_RANDOM_ADDRESS_OFFSET<LF>
Random Bluetooth Address: d9:b2:4d:ad:9c:3b<LF>
Success: aci_hal_write_config_data command<LF><CR>
Success: aci_hal_write_config_data command<LF><CR>
Success: aci_hal_set_tx_power_level command<LF><CR>
Success: aci_gatt_init command<LF><CR>
Success: aci_gap_init command<LF><CR>
Success: aci_gap_set_io_capability command<LF><CR>
Success: aci_gap_set_authentication_requirement command<LF><CR>
Success: aci_gap_configure_whitelist command<LF><CR>
Success: aci_hal_set_radio_activity_mask command<LF><CR>
-- P2P CLIENT INITIALIZED <LF>
mm evt released: 0xFF subevtcode: 0x9200 buffer addr: 0x20000100<CR><LF>
** START GENERAL DISCOVERY (SCAN) ** <CR> [1]
[2]
> SERVER NO FOUND <LF><CR> // the programm didn't found a corresponding server
...RESET <LF><CR> // try some actions to "reset" the processus [3]
server not found : success to terminate procedure<LF><CR> // [4]
> Success to reset stack<LF> // call aci_hal_stack_reset() [5]--------------------------------------
The only solution which work is to power down / power up the MCU.
But the other board which communicate with the processor STM32WB5MMG can't cut the power line. Thant why I search a "software" solution.
On differents posts on this forum, I saw we can't reset the CPU2.
But to my opinion, I need a solution like a "reset" on CPU2. But how ? Do you have a solution ?
