Param Error code in DSPS device code

17个帖子/ 0新
最后一篇
Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
Param Error code in DSPS device code

你好
我am using the DSPS device mode code for my application. The general purpose of my code is to change the advertise string according to my host MCU board state machine. Sometimes I see that the BLE stops transmitting advertise packets from some reason . I see that in the gapm_cmp_evt_handler() function the param->status is 0x43 (GAP_ERR_COMMAND_DISALLOWED) and afterwards it changes to 0x44 (GAP_ERR_CANCELED). can you please help about what are the possible reasons for getting these statuses and if you think that it may be related to the advertise stop transmission which I have?

短代码说明:
我n my code when I am receiving a advertise modification request for the host MCU (via UART) the dialog MCU send advertise stop request and waits for the gapm_cmp_evt_handler function call to get the operation flag. once it reached, it send advertise start request with the new values of the advertise string (changes on byte in the MAJOR string) and wait for gapm_cmp_evt_handler call to get the operation flag.
Thanks

Keywords:
Device:
mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

我suppose thatthis incident happens when you perform a change on the广告字符串。The advertising string goes through a validity check when its time to be transmitted over the air, perhaps the string that you are feeding to the 580 isn't a valid one (a strange flag or something like that) that would cause your device not to advertise. Or perhaps you are issuing and advertising command without canceling the previous one.

谢谢mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
你好and thanks for your answer

你好and thanks for your answer,
regarding the 1st option:
我sn't it suppose to to send GAP_ERR_ADV_DATA_INVALID if the advertising string is wrong?

我会查看没有停止的广告选项。
还有一件事:我假设在我召唤广告停止功能后发送GAP_ERR_CANCELED消息,对吧?
谢谢
阿米尔

mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

Yes, in an invalid data string you should get a GAP_ERR_ADV_DATA_INVALID. And yes first you cancel the advertising procedure and then you get the GAP_ERR_CANCELED message.

谢谢mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
好,谢谢

好,谢谢
我have One last question. If everything goes OK and these steps occurs:
1.我已经取消了停止宣传功能的广告
2.从内核获取GAP_ERR_CANCELED(在PARAM->状态寄存器中)
3. Then I Called the start advertise function and modified the advertise string
4. MY QUESTION - what is the Kernel response should be in the param->status register afterwards?
再次感谢

mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

您的意思是内核在广告启动时发送的消息是什么?发送GAPM_START_ADVERTESE_CMD后,您不会从内核获取任何消息后,操作将继续(除非是指示的广告),直到停止广告(使用GAPM_CMP_EVT)或接收连接请求(GAPC_CONNECTION_REQ_IND)。有关更多信息,请查看RW_BLE_GAP_IS.PDF。

Thansk mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
嗨,谢谢你的答案

嗨,谢谢你的答案。在我的情况下,经过一段时间(可以从10分钟到24小时),广告从某种原因停止。我看到这种出现的流程:
1. My host MCU send a new advertise modification request (I can trigger it whenever I want).
2.我get the request and call the stop_adv() function, then I get param->status==GAP_ERR_CANCELED in the gapm_cmp_evt_handler() function.
3. After I am getting this status , I call the adv_start() function and modify the advertise string , then the gapm_cmp_evt_handler() function is not being called.
following our conversion, I assume that this is the right procedure that should be, but still I don't see any advertise packets in my BLE scanning App. Can you think about anything that could help me debug/solve this?
Thanks
阿米尔

mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

The procedure of changing the advertising string is correct:

1) Start advertise - issue a GAPM_START_ADVERTISE_CMD and continue advertising until you decide to stop

2) Stop advertise - Issue a GAPM_CANCEL_CMD

3) Receive the GAPM_CMP_EVT that the advertising has stopped

4)更改广告字符串并再次启动广告。

我suppose that you get the gapm_cmp_evt_handler() when you cancel the advertising and instead of GAP_ERR_CANCELED you get the GAP_ERR_COMMAND_DISALLOWED. Try to connect to the smart snippets tool and check that your device for sure isn't advertising (no rx, tx activity) when re-initiating advertising isn't working also you can check the status of your device when this incident occurs. I ve tried to modify the DSPS project in order to get theGAP_ERR_COMMAND_DISALLOWED, it seems that i am getting this error when i am connecting to the device and i try to start advertise but as soon as i am disconnected the device is able to advertise again.

谢谢mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
你好

你好
我will try, but I checked it well, I get the exact procedure that you described in the 4 steps above. I am not getting the GAP_ERR_COMMAND_DISALLOWED. I will try to use the smart snippets tool but still I would be happy to know if there is another flag or any other indication, for the RF start advertising. currently I will need to do periodical resets, but is solution will not last for mass production.
谢谢

mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

考虑到你的第一篇文章,我认为你的问题是你在尝试重新打造而不是GapM_Cancel_cmd和你的设备刚刚停止广告时,你正在获得Gap_err_command_disogped。您可以使用ARCH_LAST_RWBLE_EVT_GET()以获取您的设备通过的最后一个BLE事件。请在app_sleep.h文件中查看app_asynch_trm()函数中的信标参考设计。它使用此功能来计算广告事件。

谢谢mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
你好

你好
我确实在rwble_last_event中追踪了最后一个状态,似乎可以获得几个0x02(ble_evt_rx)和0x03(ble_evt_rx),直到我得到0x04(ble_evt_end)。我假设(根据信标项目),BLE_EVT_TX和之后BLE_EVT_END意味着这1次广告数。但仍然在一段时间之后,我没有看到空中的数据包。我有一些输入可能可以帮助您帮助我:
1. I don't use any external oscillator - I canceled the two sleep with #undef of CFG_EXT_SLEEP and CFG_DEEP_SLEEP
2.我canceled the SW and HW UART flow control (don't have enough pins)
3. I use development debug
Thanks again for your help, I really appreciate it

mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

The points that you mention shouldn't affect the advertising procedure of the 580, it shouldn't just stop advertising. Can you please issue advertise stop, advertise start and modify the string by using a timer and not send a command through the external MCU in order to isolate the problem. Perhaps the MCU affects somehow your system and causes to hault BLE activity somehow. Also if you check if there is BLE activity by tracking the BLE_EVT_END as the beacon snippet does and when there is no activity to issue a start advertise command, is the command executed or you have to reset the stack in order for your device to start advertise?

谢谢mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
你好我am sorry didn't

嗨,我很抱歉不明白你最后一句话(用ble_evt_end),你能再次解释一下。当我执行调试时,BLE_EVT_END是临时状态,再次到达断点后,它与状态Rx或Tx。如果提到该状态是Tx,它不是假设是肯定发生的广告吗?即使我解决了这个问题,我也希望能够知道是否发送或不发送。

mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

当广告发生时,函数应该以下列顺序返回状态Tx / Rx / Tx / Rx / Tx / Rx / BLE_END_EVT(这是广告事件的周期 - 它将返回其他州,因为您的觉醒对此不感兴趣,CSNT_EVT和SLP等)因此每个成功的广告活动应该以BLE_END_EVT结尾。在我上一篇文章中,我提到通过保持最后一个和当前的BLE事件来跟踪广告过程的完整周期。如果您的设备状态无更改为上述状态,则无法完成上述循环,您将能够知道您的设备不是广告。通过跟踪只有TX只是在一个频道中进行广告而不是完整的广告操作,您也可以跟踪,如果您想要。

谢谢mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
你好and thanks for your answer

嗨,谢谢你的答案。我试图看看原始代码发生的事情:我使用Version DSPS 3.150.2使用此更改:
1. #undef cfg_ext_sleep(是#define)
2. #undef cfg_uart_hw_flow_ctrl(是#define)

我am uploading the FW via UART port and CRC is OK. the unit start to transmit but after a while, it stops same as my Firmware version.

正如我之前提到的,我不使用外部振荡器,在我的设置中,我几个单元约为8个单位,它们之间的距离为约30cm,在每个单元内部有ZigBee发射器(距离BLE模块约5厘米)偶尔传输数据。也许这会帮助你帮助我。
谢谢

mt_dialog.
离线
最后一次露面:2个月4周前
职员
加入:2015-06-08 11:34
你好Asalhuv.,

你好Asalhuv.,

当你说你不使用外部振荡器时,你不使用任何外部静脉器,甚至不是xtal16?对于580,XTAL16是强制性的,因为数据表指示您只能在降压模式下省略XTAL32外部振荡器时,XTAL32也是强制性的。对不起,没有注意到早些时候的第11篇帖子中的指示。

谢谢mt_dialog.

Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
你好

你好
我和你使用村田模块r embedded chip (type ZY) which including the Xtal16. I think that the DSPS version 3.0.8 has some problem under loaded environment:
当我在周末(只有一个模块)在我家中在我的房子里测试它一切都好,它一直在运行3天。当我开始在工作中进行测试时,即将发出3天(我们有许多BLE模块{至少30},ZigBee发射器和WiFi),广告后一段时间停止,即使是参考FW,因为我在早期帖子中描述。
我tried the DSPS of SDK 5 (the new one you published), and for now it looks better, but I will know for sure only in Sunday when I will check it out again.
Maybe I worth checking this issue out, I will update again on Sunday.