当DA14681开发板上的BLE连接启动时,I2C和SPI退出

了解更多FAQsTutorials

13个职位/0个新职位
Last post
jetsonindustries
Offline
Last seen:1年9个月前
加入:2016-12-06 08:36
当DA14681开发板上的BLE连接启动时,I2C和SPI退出

我们正在使用对话框DA14681 MCU、LIS331HH加速计和MMC3416磁强计开发物联网设备。

everything connects up well and we get readings from both sensors (accel via SPI and Magneto via I2C).

The moment we initiate BLE connection it all goes horribly wrong.

With the LIS accelerometer, For the initial 8 seconds of operation the accelerometer appears to give the correct readings via SPI, then only outputs 0 for all 3 axis. When testing using UART debugger we see a whole bunch of weird data which is clearly incorrect. When we swapped it over to 12C interface to test the UART debugger stopped after 8-10 seconds and gives us nothing.

I2C上的磁强计也出现了类似的问题。

Being a reasonably new component the DA14681 has been a bit of a nightmare, but I'm hoping someone has come across the same problem and there's something simple we've missed to fix this.

任何建议都非常方便!我附上了一些屏幕截图,这样你就可以看到发生了什么。

关键词:
设备:
STS\U对话框
Offline
Last seen:3年3个月前
加入:2017-06-06 09:26
请发送屏幕截图。

请发送屏幕截图。

jetsonindustries
Offline
Last seen:1年9个月前
加入:2016-12-06 08:36
https://drive.google.com/open
STS\U对话框
Offline
Last seen:3年3个月前
加入:2017-06-06 09:26
Hi,

Hi,

请用邮政编码发送文件。

谢谢,

斯塔夫罗斯

jetsonindustries
Offline
Last seen:1年9个月前
加入:2016-12-06 08:36
Hey Stavros images attached

Hey Stavros images attached in Zip

Attachment:
STS\U对话框
Offline
Last seen:3年3个月前
加入:2017-06-06 09:26
Hi,

Hi,

我相信问题的根源就在睡觉之后。默认情况下,我们的示例代码使用XTAL32K作为低功耗时钟before the system goes to sleep we wait roughly 8 seconds for the crystal to be stabilized. After that, the system can enter into sleep mode and here is where things end up to a nightmare. First of all we need some info and more specifically:

1. What version of the SDK and type of development kit is used?
2您是否使用我们的示例代码(例如ble\u adv)构建了源代码?
三。低功耗时钟(XTAL32K,RCX)的来源是什么?

下面是一些提示和步骤:

1我们强烈建议您使用pm_mode_extended_sleepas sleep mode.

2. Do you use adapters in order to access peripheral modules? Please note that adapters not only ensure exclusive access to a peripheral bus, but also CPM (power management unit) takes care of the various modules that are active, before force the system goes to sleep. So, if you use low level drivers instead of adapters, then the system is not aware for the existence of the e.g. SPI/I2C activity and upon getting sleep, it ends up to a mess.

I don't think that the issue is related with incorrect use of peripheral bus since you are able to read values. Also BLE activity doesn't seem to corrupt readings from sensors since you are able to get some values at the first 8 seconds.Please confirm it , if before the issue observed, there is normal BLE activity (advertising) using e.g. SmartSnippets Toolbox.

比尔,
STS\U对话框.

jetsonindustries
Offline
Last seen:1年9个月前
加入:2016-12-06 08:36
We are receiving a signal via

当传感器不工作时,我们通过蓝牙接收信号。

通过适配器访问外围设备。

DA1468x_DA15xxx_SDK_1.0.10.1072 Is the SDK version and for hardware we are using the DA14681 pro development kit.

我们的构建基于SDK的源代码-而不是定制编写的。

The clock settings are the same as the example code It is just 32.768KHz. RCX is disabled but we tested with it enabled and no change.

还有其他建议吗?

STS\U对话框
Offline
Last seen:3年3个月前
加入:2017-06-06 09:26
Hi,

Hi,

您使用适配器或任务的方式可能有问题。您使用的SDK示例代码是什么?如果在8秒钟后您尝试与设备建立任何连接并看到此故障,或者系统正在发布广告而未尝试连接到芯片,请告知我。

A few tips that might help:

1.It's better to use DMAs when using SPI/I2C functionality.They have better correspondence/functionality and take care of some situations e.g. when a higher priority task, interrupts the operation of the peripheral bus while still active.

2系统进入休眠状态后,如何读取传感器的值?如何配置系统,使其收到阅读时间的通知?您是否使用在固定时间段调用的RTOS计时器?如果使用任何延迟,必须特别小心。在RTOS中使用延迟时,任务实际上进入挂起模式。如果到了系统进入睡眠的时间(延迟时),CPM(电源管理单元)会看到任务被暂停,并强制系统进入睡眠(任务尚未完成其操作)

三。使用任何休眠模式时,UART外设必须与流量控制功能RTS/CTS一起使用。请注意,在DA14681芯片中只有UART2具有此功能。

比尔,

STS\U对话框.

jetsonindustries
Offline
Last seen:1年9个月前
加入:2016-12-06 08:36
When we delete out the pm

When we delete out the pm_mode_extended_sleep everything seems to work. It’s obviously related to that sleep call, is there another setting that could be used for this?

STS\U对话框
Offline
Last seen:3年3个月前
加入:2017-06-06 09:26
Deleting the aforementioned

Deleting the aforementioned macro (pm_mode_extended_sleep) the system never goes to sleep. There is别无选择如果你想使用睡眠模式。正如你第一次说的和怀疑的那样,睡觉后你的配置出了问题。请核实我的上述评论。否则我们就无能为力了。还有一些可能有助于解决问题的提示:

1. Where exactly do you configure the pins for the various functionalities (SPI/I2C/UART)? Do you use theperiph_init()function in order for the latter to be invoked in each wake up? If not, then the CPM does not reconfigure the pins to its previous state, after waking up. (the state they had before getting sleep)

2. Also, please check the peripheral bus when the device goes to sleep and examine if there is any interfacing with the sensors? (using a logic analyzer). If you get values like zero and irrelevant data I suppose that there is no interaction and you are just printing empty variables.

比尔,

STS\U对话框.

吉滕德拉普拉萨德
Offline
Last seen:1 year 11 months ago
加入:2017-10-02 10:38
Hello Dialog,

Hello Dialog,

I have followed above suggestions but still I am facing I2C issue after 8 seconds.

When I have debugging I2C code I found below function where program get stuck:
初始化事件(&i2c\U信号);

我正在读取磁强计(通过I2C接口)的数据在操作系统定时器触发事件每500毫秒。

Please find attached doc file for Magnetometer I2C driver code.
请找到附件调试截图。在这个截图中,调试在8秒后的第354行停止。

谢谢

Jitendra

Attachment:
吉滕德拉普拉萨德
Offline
Last seen:1 year 11 months ago
加入:2017-10-02 10:38
Hello Dialog,

Hello Dialog,

I have tried to read the "I2C_ENABLE_STATUS_REG" status before and after device goes in sleep mode. Before sleep mode "I2C_ENABLE_STATUS_REG"
status is "1" and after sleep mode "I2C_ENABLE_STATUS_REG" statu is "0".

然后,我将尝试通过使用“HW_I2C_REG_SETF(id,I2C_enable,CTRL_enable,1);”调用来启用I2C寄存器。但I2C的状态仍然是“0”。

Also, I tried gpio hardware configuration by using "hw_gpio_configure" after device goes in sleep mode.

任何帮助都将不胜感激。

当做,

Jitendra

MT_dialog
Offline
Last seen:1周3天前
Staff
加入:2015-06-08 11:34
Hi Jitendraprasad,

Hi Jitendraprasad,

我看不出任何明显的原因让设备在初始化init\u event()时陷入困境函数所做的只是创建一个信号量,而且我也无法从您所附的数据中得出有效的结论。我假设您以外设演示中的i2c功能为例,并将其转换为支持BLE的演示,显然在转换代码时出现了问题。

有一些论坛帖子涉及I2C交易,请查看下面的一些帖子,以防有所帮助:

https://support.dialog semiconductor.com/forums/post/dialog-smartbond-bl。。。

https://support.dialog semiconductor.com/forums/post/dialog-smartbond-bl。。。

谢谢MT_dialog