KW36 wireless uart demo connection issue: will disconnected immediately from the phone

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KW36 wireless uart demo connection issue: will disconnected immediately from the phone

1,402 Views
zhi_wang
Contributor III

Hi ,

i have test the glucose demo with Android app(like nrf conenct), it works fine.

but with the wireless uart demo, the connection will immediately terminated when the connection established. 

when using the iphone, the log from lightblue shows the service are all discovered. the disconnect request is send by the kw36. 

here is the log from kw36 uart:

----------------------------------------------------------------------------------- serial port log -----------------------------------------

Wireless UART starting as GAP Central, press the role switch to change it.

Switched role to GAP Peripheral.

Advertising...
Connected to device 0 as slave.
Disconnected from device 0.

Advertising...
Connected to device 0 as slave.
Disconnected from device 0.

Advertising...
Connected to device 0 as slave.
Disconnected from device 0.

Advertising...
Connected to device 0 as slave.
Disconnected from device 0.

Advertising...
Connected to device 0 as slave.
Disconnected from device 0.

Advertising...

----------------------------------------------------------------------------------------------

attention: i have tested 5 times, as log shows

so the problem is absolutely connection issue, not the state/button setting of the kw36. 

i have a TI sniffer log, but it seems no use。

pastedImage_1.png

Regards,

Labels (3)
Tags (1)
4 Replies

1,064 Views
Jingsai_Lu
NXP Employee
NXP Employee

Hi Ziv,

You are using nrf connect app to connect wirelss uart app, right?

If yes, that is expected.

you can see the reason in the function void BleApp_StateMachineHandler(deviceId_t peerDeviceId, appEvent_t event) implement,

        case mAppExchangeMtu_c:
        {
            if (event == mAppEvt_GattProcComplete_c)
            {
                /* update stream length with minimum of maximum MTU's of connected devices */
                (void)Gatt_GetMtu(peerDeviceId, &tempMtu);
                tempMtu = gAttMaxWriteDataSize_d(tempMtu);

                mAppUartBufferSize = mAppUartBufferSize <= tempMtu ? mAppUartBufferSize : tempMtu;

                /* Moving to Service Discovery State*/
                maPeerInformation[peerDeviceId].appState = mAppServiceDisc_c;

                /* Start Service Discovery*/
                (void)BleServDisc_FindService(peerDeviceId,
                                              gBleUuidType128_c,
                                              temp.pUuidObj);
            }
            else
            {
                if (event == mAppEvt_GattProcError_c)
                {
                    (void)Gap_Disconnect(peerDeviceId);
                }
            }
        }

The board will start to find uart service from your cell phone after connect and exchange MTU, which means you need to add a wireless uart service with proper 128 bit UUID on your phone like attached picture.

pastedImage_1.png

1,064 Views
zhi_wang
Contributor III

Hi Jingsai,

very thanks. :smileyhappy: 

i have searched the "Gap_Disconnect" and found the course. for i found the Iot toolbox (iphone version) is working fine, just others have this issue.

Regards,

Ziv

0 Kudos

1,064 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Ziv,

We are working on this issue, could you please confirm the gapPairingParameters_t that you have?

Did you set bonding and paring flag as 1?

Do you set gSecurityMode_1_Level_4_c and Secure connections as TRUE?

Regards,

Mario

0 Kudos

1,064 Views
zhi_wang
Contributor III

Hi Mario,

thanks for your response.

what i am using is the original demo code from the sdk.

pastedImage_1.png

actually i have doubted the connection parameters request from the app(iphone/ android), once i have sniffered a log that 

the app send the request, but have not found the accept message from slave. and then disconnected. 

pastedImage_4.png

the above code segment is from BleConnManager_GapPeripheralEvent.

besides, there should be a problem in function BleConnManager_GapCentralEvent:

pastedImage_5.png

in the central role, if the gConnUpdateAlwaysAccept_d is set to 0 and the connection interval min = 6, then the result is false. the judgement of the value logic need to check.

Regards,

Ziv

0 Kudos