Skip to main content
sçıtı.1
Associate II
Nov 19, 2022 9:30 AM UTC
Question

P2P server and P2P Client pair on STM32WB does not work when both are a stm32wb board but works when central is mobile. What should I do?

..

This topic has been closed for replies.

5 replies

sçıtı.1
Associate II
Nov 19, 2022 9:35 AM UTC

I want to add details:

As I said in the question, they work well when the central is mobile and the peripheral is stm32wb board. However, when central is another stm32wb board they do not communicate. 

When I try the p2p_server & p2p_client examples on different boards I could run and even modify the code without problem, they communicated well.

What might be the problem? In which file, should I make configurations, app_ble.c, custom_app.c ... etc.?

I think problem is here:

case ACI_GAP_PROC_COMPLETE_VSEVT_CODE:
 {
 aci_gap_proc_complete_event_rp0 *gap_evt_proc_complete = (void*) blecore_evt->data;
 /* CHECK GAP GENERAL DISCOVERY PROCEDURE COMPLETED & SUCCEED */
 if (gap_evt_proc_complete->Procedure_Code == GAP_GENERAL_DISCOVERY_PROC
 && gap_evt_proc_complete->Status == 0x00)
 {
 	 HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, RESET);
 APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE_COMPLETED\n\r");
 /*if a device found, connect to it, device 1 being chosen first if both found*/
 if (BleApplicationContext.DeviceServerFound == 0x01 && BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_CLIENT)
 {
 APP_DBG_MSG("-- Device Found\n\r");
 UTIL_SEQ_SetTask(1 << CFG_TASK_CONN_DEV_1_ID, CFG_SCH_PRIO_0);
 }
 else {
 APP_DBG_MSG("-- Device not Found\n\r");
 }
 }
 } break;

 This is the Debug LOG:0693W00000WIsoJQAT.pngFinally, I want to add a block diagram of the example, you can refer to the blocks for convenience.

0693W00000WIsoYQAT.png

Remy ISSALYS
ST Technical Moderator
Nov 21, 2022 9:11 AM UTC

Hello,

Did you try with the latest STM32CubeWB package (v1.14.1) with reference binaries for BLE_p2pServer and BLE_p2pClient? Ensure that BLE_p2pServer is in advertising mode before start scanning phase.

Best Regards

sçıtı.1
Associate II
Nov 25, 2022 6:03 AM UTC

Yes, I did and this is not actually the case, let me simplify: While My custom server on STM32 and the client on a mobile phone are connecting, my custom server and client on STM32WB do not connect. 

Remy ISSALYS
ST Technical Moderator
Nov 30, 2022 8:45 AM UTC

Hello,

Did you change the advertising packet?

Best Regards

sçıtı.1
Associate II
Dec 1, 2022 11:26 AM UTC

hi, I am sorry, I could not understand what should I do. What do you mean by changing advertising packet?