Param Error code in DSPS device code

17 posts / 0 new
Last post
asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
Param Error code in DSPS device code


我正在使用DSP设备模式代码进行应用程序。我的代码的一般目的是根据我的主机MCU板状态机更改广告字符串。有时我看到BLE从某种原因停止传输广告数据包。我看到,在GAPM_CMP_EVT_HANDLER()函数中,参数 - >状态为0x43(GAP_ERR_COMMAND_DISALLED),然后更改为0x44(GAP_ERR_CANCELED)。您可以帮助获取这些状态的可能原因,以及如果您认为它可能与我所拥有的广告停止传输有关吗?

short code explanation:
在我的代码中,当我收到主机MCU的广告修改请求时(通过UART)对话框MCU发送通告停止请求并等待GAPM_CMP_EVT_HANDLER函数调用以获取操作标志。一旦到达,它会使用通告字符串的新值发送通告启动请求(主要字符串中的字节上的更改)并等待GAPM_CMP_EVT_HANDLER调用以获取操作标志。
Thanks

关键词:
设备:
MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi asalhuv,

I suppose that在执行更改时发生此事件advertising string.广告字符串经过有效性切ck 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.

Thanks MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
Hi and thanks for your answer

Hi and thanks for your answer,
关于第1个选项:
如果广告字符串错误,它是否认为发送GAP_ERR_ADV_DATA_INVALID?

I will check out the not stopping advertise option.
one more thing: I assume that GAP_ERR_CANCELED message is sent after I call the advertise stop function, right?
thanks
Amir

MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi asalhuv,

是的,在无效的数据字符串中,您应该得到一个gap_err_adv_data_invalid。是的,首先取消广告过程,然后获取Gap_err_Canceled消息。

Thanks MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
OK thanks

OK thanks
我有一个最后一个问题。如果一切顺为确定,就会出现这些步骤:
1. I have canceled the advertise with the stop advertise function
2. Got the GAP_ERR_CANCELED (in the param->status register) from the Kernel
3.然后我称之为启动函数并修改了广告字符串
4.我的问题 - 之后应该在Param->状态登记中的内核响应是什么?
再次感谢

MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi asalhuv,

You mean what is the message that the kernel sends when the advertising starts ? After you send the GAPM_START_ADVERTISE_CMD you dont get any message from the kernel, the operation is going to continue (unless is a directed advertising) until you stop advertising (response with a GAPM_CMP_EVT) or you receive a connection request (GAPC_CONNECTION_rEQ_IND). Please have a look at the RW_BLE_GAP_IS.pdf for more information.

Thansk MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
嗨and thanks for your answer

嗨and thanks for your answer. In my case, after a while (could be from 10 minutes to 24 hours) the advertising stops from some reason. I see this flow of occurrences:
1.我的主机MCU发送新的广告修改请求(我可以在我想要的时候触发它)。
2.我得到了请求并调用stop_adv()函数,然后在gapm_cmp_evt_handler()函数中获得Param-> Status == Gap_err_Canceled。
3.我获得此状态后,我调用ADV_START()函数并修改通告字符串,然后不调用GAPM_CMP_EVT_HANDLER()函数。
在我们的转换之后,我认为这是应该是正确的程序,但我仍然没有看到我的BLE扫描应用程序中的任何广告数据包。你能想到任何可以帮助我调试/解决这个问题的东西吗?
Thanks
Amir

MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi asalhuv,

更改广告字符串的程序是正确的:

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

2)停止宣传 - 发出GAPM_CANCEL_CMD

3)接收广告已停止的GAPM_CMP_EVT

4) Change the advertising string and start advertising once more.

我想你在取消广告时得到GapM_CMP_EVT_Handler(),而不是Gap_err_Canceled,你得到了Gap_err_command_disallow。尝试连接智能代码段工具并检查您的设备是否肯定是在重新启动广告不起作用时肯定的(没有RX,TX活动),您可以在发生此事件时检查设备的状态。我试图修改DSP项目以获得GAP_ERR_COMMAND_DISALLED,当我连接到设备时,我似乎正在收到此错误,我尝试开始通告,但一旦我断开连接,设备就可以再次通告。

Thanks MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
Hi

Hi
我会尝试,但我检查一下,我得到了上面4步中描述的确切程序。我没有得到gap_err_command_disogped。我会尝试使用智能片段工具,但我仍然很高兴知道是否有另一个标志或任何其他指示,对于RF启动广告。目前我需要进行期刊重置,但解决方案不会持续批量生产。
thanks

MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi asalhuv,

Considering your first post i thought that your problem was that you were getting GAP_ERR_COMMAND_DISALLOWED when you trying to re-advertise instead of GAPM_CANCEL_CMD and your device just stoppped advertising. You can use the arch_last_rwble_evt_get() in order to get the last BLE event that your device went through. Please check the beacon reference design in the app_asynch_trm() function in the app_sleep.h file. It uses this function to count the advertising events.

Thanks MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
Hi

Hi
I did tracked the last status in rwble_last_event, and it seems ok: it is getting a few 0x02 (BLE_EVT_RX) and 0x03 (BLE_EVT_RX) until I am getting the 0x04 (BLE_EVT_END). I assume (according to beacon project) that BLE_EVT_TX and afterwards BLE_EVT_END means that this 1 count of advertise.But still after a while I don't see the packets over the Air. I have a few inputs that maybe can help you to help me:
1.我不使用任何外部振荡器 - 我取消了与cfg_ext_sleep和cfg_deep_sleep的#undef的两个睡眠
我取消了SW和HW UART流量控制(没有足够的针)
3. I use development debug
再次感谢你的帮助,我真的很感激

MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi 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?

Thanks MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
嗨,我很抱歉没有

嗨,我很抱歉没有understand you last sentence (with the BLE_EVT_END), can you please explain again. When I did the debug the BLE_EVT_END was a temporary state and after it reached the break point again it was with state RX or TX. If it is mention that the state is TX, isn't it suppose to be that advertise has surely occurred? Even if I solve this issue , I want to be able to know if the BLE transmitting or not.

MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi asalhuv,

When the advertising occurs the function should return the states in the following order TX/RX/TX/RX/TX/RX/BLE_END_EVT (this is the cycle of an advertising event - it will return the other states as well since its awakening but you are not interested in that, CSNT_EVT and SLP etc) so every successfull advertising event should end with BLE_END_EVT. In my previous post i mentioned that you can track the full cycle of the advertising procedure by keeping the last and the current BLE event. If the state of your device doens't change to the above states and doesn't complete the above cycle you will be able to know that your device isn't advertising. By tracking only TX is only advertising in one channel and not a full advertise operation, you can track that as well if you want to.

Thanks MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49
Hi and thanks for your answer

Hi and thanks for your answer. I tried to see what happen with the original code: I used the version DSPS 3.150.2 with this changes:
1. #undef CFG_EXT_SLEEP (was #define)
2. #undef CFG_UART_HW_FLOW_CTRL (was #define)

我上传FW通过UART端口,CRC还可以。单位开始传输但过一段时间后,它会停止与我的固件版本相同。

As I mentioned before, I am not using an external oscillator, and in my setup I have couple of units about 8 units that the distance between them is ~30cm, inside each unit there are ZigBee transmitters (about 5 CM from the BLE module) that Occasionally transmit data. Maybe this will help you help me.
thanks

MT_dialog
Offline
Last seen:3 months 59 min ago
Staff
加入:2015-06-08 11:34
Hi asalhuv,

Hi asalhuv,

When you say you dont use an external oscillator you mean, you dont use any external oscilator, not even the XTAL16 ? The XTAL16 is mandatory for the 580 as the datasheet indicates you can omit only the XTAL32 external oscillator when you are in buck mode, in boost mode the XTAL32 is mandatory as well. Sorry for not noticing your indication in post 11 earlier.

Thanks MT_dialog

asalhuv
Offline
Last seen:2年9个月前
加入:2015-10-22 09:49


I use MURATA module with your 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,因为我在早期帖子中描述。
我尝试了SDK 5的DSP(你发表的新一个),现在看起来更好,但我会肯定只在星期天时才知道我再次检查一下。
也许我值得检查这个问题,我会在星期天再次更新。