Topic

FAQ
Login Register
TLSR8251 sometime or permanently no scan response in slave connected state
Apr 15, 2022 23:48

/

A

/A

Hi everybody
TLSR8251 sometime or permanently has no scan response in slave connected state. What can be a reason of that?
When we for example change a code (reduce code in main cycle) then scan response works good.




12 replies
TL_Soyo Apr 18, 2022 11:08
0
/A


Hi,
   if u need scanning state machine in ConnSlaveRole ,u need pay attention to the time sequence,dont take up too much time in main cycle.

u can find the detail information at this link :http://wiki.telink-semi.cn/doc/an/AN-21112300-E_Telink%20B85m%20BLE%20Single%20Connection%20SDK%20Developer%20Handbook.pdf

Alexa [Author] Apr 18, 2022 15:50
0
/A

Thank you, Soyo.
But I meant another state: p.3.2.3.4 Idle+Advertising+ConnSlaveRole
And api function:
ble_sts_t blc_ll_setAdvParamInConnSlaveRole( u8 *adv_data, u8 advData_len, u8 *scanRsp_data, u8 scanRspData_len, adv_type_t advType, own_addr_type_t ownAddrType, u8 adv_channelMap, adv_fp_type_t advFilterPolicy);

We observed normally advertising data adv_data used as parameter in the function, but the scanRsp_data are absent at the moment.
But maybe your comment is related to ourcase too.
In any case it is strange that the advertising data are Ok, but the scan response no in some cases simulataneously. I suppose that ble library locks scan responses in some difficult situations, or maybe it is a library bug.

TL_Soyo Apr 18, 2022 16:27
0
/A

Hi,

    According to your information,if you use "p.3.2.3.4 Idle+Advertising+ConnSlaveRole" state machine,please use bls_ll_setScanRspData( (u8 *)tbl_scanRsp, sizeof(tbl_scanRsp)) to set response data and reference b85m_ble_remote demo project(http://wiki.telink-semi.cn/tools_and_sdk/BLE/B85M_SINGLE_BLE_SDK.zip).

   And function "blc_ll_setAdvParamInConnSlaveRole" is used to "3.2.5.3 Advertising in ConnSlaveRole" state machine.

Alexa [Author] Apr 18, 2022 21:38
0
/A

Thank you, Soyo
I learned again SDK handbook and b85m_ble_remote demo. I've tryed the above mentioned api functions in many combinations, but result was the same - negative.
So, we consider Slave Role of our device in Connected state with some Master. In that connected state there is only one api function, which can help us with slave advertising, it is blc_ll_setAdvParamInConnSlaveRole. In other cases (without usage of this function) no any slave advertising at all.
1) So this blc_ll_setAdvParamInConnSlaveRole   function must be used in slave role when slave is in connected state with some master.
2) Further, if I use bls_ll_setScanRspData function additionally to the (1) then no any changes, that is no any scan response. And I think this bls_ll_setScanRspData function should be used only when slave is in disconnected state.
3) When we delete some code from main cycle, that is we reduce the intensity of calculations, then all works good with usage only one api function blc_ll_setAdvParamInConnSlaveRole. And that variant works exactly when our slave is in connected state with some master.
That is my experimental results with TLSR8251.
And about b85m_ble_remote demo, this demo does not use scan responses in slave connected state. This demo uses only ble notifications in connected state. Am I right?

TL_Soyo Apr 18, 2022 23:57
0
/A

Hi Alexa,

   You are right ,  and u want to Adv in connected state,and response other device active scan,u need reference handbook :p.3.2.5.3 Advertising in ConnSlaveRole,and follow b85m_feature_test demo code ,the FEATURE_TEST_MODE == TEST_ADVERTISING_IN_CONN_SLAVE_ROLE part .


Alexa [Author] Apr 19, 2022 00:05
0
/A

Hi Soyo,
I did exactly as in your fragment in previous message. Really I based my code on this example. But the considered problem is still and precisely in slave connected state.



TL_Soyo Apr 19, 2022 00:30
0
/A

Hi Alexa,

    So,the only problem is ur main loop cost to much time ,u need consider the time sequence between every connection interval ,and you already reduced your code now.

Alexa [Author] Apr 19, 2022 18:37
0
/A

Hi Soyo,
During meantime I've experimented with intensity of calculations in main cycle. I found out more strange thing.
When I added the following functions inside user_init_normal()  (it is called before main cycle as you know):

flash_read_page(0x73000, 16, my_read_data);
flash_erase_sector(0x73000);

then the above our considered problem arises. If I deleted these functions then scan response in connected state is Ok.
What can you say about that?




TL_Soyo Apr 20, 2022 11:06
0
/A


Hi Alexa,

   We add the same code in the feature test project,and it work ok,

    Could you provide minimal project with this problem to us ,you can send to email: shuyou.zhou@telink-semi.com

Alexa [Author] Apr 20, 2022 15:29
0
/A

Hi Soyo,
I am afraid that if I create minimal project then it will not have this problem. But I will try. Thank you for your efforts with my problem.



Alexa [Author] Apr 25, 2022 16:01
0
/A

Hi Soyo,
I'll return to this problem today. Previous my attempts with minimal project b85m_feature_test demo code where the FEATURE_TEST_MODE == TEST_ADVERTISING_IN_CONN_SLAVE_ROLE  were with positive result (scan response was good at connected state). But then I modifyed the program code to usage style with periodically (for example 1 s time period) changes of scan response data (advertisng data were constant), and found out that sometime sent data were paused. It was not stable result, that is why I will try to get a stable result (for example when no any changes each second at all).
When I did that I have an idea with a question to you, is it allowed in general to change data each second with the function
blc_ll_setAdvParamInConnSlaveRole( (u8 *)tbl_advData_test, sizeof(tbl_advData_test),
(u8 *)tbl_scanRsp_test, sizeof(tbl_scanRsp_test),
ADV_TYPE_CONNECTABLE_UNDIRECTED, OWN_ADDRESS_PUBLIC, BLT_ENABLE_ADV_ALL, ADV_FP_NONE) ?
May be that my periodical usage of this function is a reason of my problem. Maybe telink api library allows change (set) response data only one time at connection procedure?



Alexa [Author] Apr 28, 2022 23:47
0
/A

Hi Soyo,

I've created the minimal project example and sent a e-mail to your address (above) with code as you asked me earlier.
It is definitly strange that only scan response data are stopped at some conditions at connected state, but advertising is good at the same time. Details are in my e-mail.