DSPS设备代码中的参数错误代码

17个帖子/ 0新
最后一篇
Asalhuv.
离线
最后一次露面:2 years 9 months ago
加入:2015-10-22 09:49
DSPS设备代码中的参数错误代码

你好
I 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?

短代码说明:
In 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.
谢谢

Keywords:
Device:
mt_dialog.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

我想是的this incident happens when you perform a change on the广告字符串。当广告字符串在空中传输时,它会经过有效性检查,也许您输入到580的字符串不是有效的字符串(奇怪的标志或类似的东西),这会导致您的设备不做广告。或者您正在发布和发布命令,而没有取消上一个命令。

谢谢mt_dialog.

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

嗨,谢谢你的回答,
regarding the 1st option:
Isn't it suppose to to send GAP_ERR_ADV_DATA_INVALID if the advertising string is wrong?

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

mt_dialog.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

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
好,谢谢

好,谢谢
I 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.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

您的意思是内核在广告启动时发送的消息是什么?发送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. I 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?
谢谢
阿米尔

mt_dialog.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

The procedure of changing the advertising string is correct:

1) 开始播发-发出GAPM\u Start\u advertise\u CMD并继续播发,直到您决定停止

2) Stop advertise - Issue a GAPM_CANCEL_CMD

3) Receive the GAPM_CMP_EVT that the advertising has stopped

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

我想是的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
你好

你好
I 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.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

考虑到你的第一篇文章,我认为你的问题是你在尝试重新打造而不是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. I canceled the SW and HW UART flow control (don't have enough pins)
3.我使用开发调试
谢谢again for your help, I really appreciate it

mt_dialog.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

你提到的要点不应该影响580的广告程序,它不应该只是停止广告。为了隔离问题,请使用定时器发出advertise stop、advertise start和修改字符串,不要通过外部MCU发送命令。也许MCU会以某种方式影响您的系统,并以某种方式导致可拖动的活动。另外,如果您通过跟踪BLE\u EVT\u结束来检查是否有BLE活动,如信标代码段所做的,并且当没有活动发出开始播发命令时,是否执行了该命令,或者您必须重置堆栈才能让设备开始播发?

谢谢mt_dialog.

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

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

mt_dialog.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

当广告发生时,函数应该以下列顺序返回状态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
嗨,谢谢你的回答

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

I 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.
离线
最后一次露面:3个月42分钟前
职员
加入:2015-06-08 11:34
你好,旭化成,

你好,旭化成,

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

谢谢mt_dialog.

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

你好
我使用村田模块与您的嵌入式芯片(ZY型),其中包括Xtal16。我认为DSPS版本3.0.8在加载环境下有一些问题:
当我测试了它在我的房子里在周末(only one module) everything was OK, and it keep transmitting for 3 days.As soon as I started testing at work (where we have many BLE modules{at least 30}, ZigBee transmitters, and WIFI), the advertising stops after a while, even with the reference FW as I described in earlier post.
I 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.