cancel
Showing results for 
Search instead for 
Did you mean: 

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?

sçıtı.1
Associate II
 
5 REPLIES 5
sçıtı.1
Associate II

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 Employee

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

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 Employee

Hello,

Did you change the advertising packet?

Best Regards

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