⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support。We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8个帖子/ 0新
Last post
florent
Offline
Last seen:3年6个月前
加入:2017-08-08 11:42
da 14580调试模式到自主

Hi dialog,

I am currently working on a project which use a DA 14580. The goal of my system simple : i send data ( packet of 20 octets ) through an SPI link to the DA14580. Then i use the beacon mode to send this data ( placing the data from the SPI reads in the advertising string ) and i am able to receive all that data with my mobile phone's bluetooth scanner. I work on IAR for the global code ( collect data from sensor and send them to SPI flash link ), and I load a binary file for the Bluetooth configuration at the beginning of my code, through the SPI . The binary file is created when i build my Bluetooth program on U vision ( I use basic program provide by Dialog Semiconductor for the beacon mode ).

我的问题是系统在调试模式下正常工作。因此,当我使用IAR启动系统时,BLE模块正确启动并正确发送数据。但是当我尝试在没有调试模式的情况下进行时,它不起作用。我重置系统,因此代码开始从开头运行,但BLE模块不会发送任何数据。

The system works like this :
微控制器唤醒,并初始化BLE模块。当微控制器已准备好发送数据时,它将唤醒信号发送到BLE模块,启动其配置。然后微控制器通过SPI闪光灯将数据发送到BLE模块。然后BLE模块通过信标模式发送数据,并在完成时睡眠。

So what I would like to know is what is the difference between the debug mode and the autonomous mode ?
解决这个问题的任何想法让我知道。

此致,
佛罗伦特

关键词:
设备:
MHv_Dialog
Offline
Last seen:2个月2周前
工作人员
加入:2013-12-06 15:10
Hi Florent,

Hi Florent,

This appears to be a sleep mode issue. As an experiment, to either confirm or rule this out, please disable sleep in your DA14580 firmware and let me know whether this works.

也请让我知道下面的g:

  1. 您使用哪种类型的睡眠模式(深睡眠或延长睡眠)?
  2. When you say "debug mode"... Do you mean with the J-Link attached?
  3. 你的唤醒机制 -​​ 它是使用唤醒定时器吗?(“正常”GPIO中断在睡眠期间不会工作)
  4. 您在描述中使用短语“SPI Flash”。我可以假设你的意思是说SPI接口,没有涉及的闪存?

/ mhv.

florent
Offline
Last seen:3年6个月前
加入:2017-08-08 11:42
Hi Dialog,

Hi Dialog,

After some test, I saw that the issue is a bit different. Indeed, I just send only one data ( to be sure I put a LED each time that I send one + I receive only the first data through the BLE scanner), and then the BLE module seems to be stuck.

1. I use extended sleep.
2. Yes, debug mode is when I run the code with the J-Link module with IAR.
3.我的唤醒机制是一个外部唤醒,微控制器我使用时发送信号(sys_wakeup),当我想发送数据包时,在从微控制器接收信号时,BLE模块存在中断。但是在使用此设备时,它在“调试”中完美地工作,似乎至少有一次没有“调试”模式。
是的,我想说SPI接口抱歉。

问候,
佛罗伦特

MHv_Dialog
Offline
Last seen:2个月2周前
工作人员
加入:2013-12-06 15:10
Hi Florent,

Hi Florent,

当您使用调试器时,您真的永远不会睡眠状态(真实的睡眠模式在DA14580中关闭控制器,因此在启用睡眠时不可能调试)。正如您所说,当您自动运行代码时,代码开始执行后,设备将保持令人醒着,这就是为什么在设备睡眠之前看到一个或两个广告的原因。

使用扩展睡眠模式工作需要两件事:

  1. You must have a sleep clock defined to match your hardware. If you have an external 32k768Hz crystal, then this should work right away. If you do not have an external crystal, you must define CFG_LP_CLK to LP_CLK_RCX20 in the file da1458x_config_advanced.h (line 28)
  2. 在睡眠期间,普通的GPIO中断不会触发唤醒。您将不得不使用唤醒定时器(有关详细信息,请参阅“UM-B-051第10.7节”)

如果有这些帮助,请告诉我。

/ mhv.

florent
Offline
Last seen:3年6个月前
加入:2017-08-08 11:42
Hi Dialog,

Hi Dialog,

So if I understand well, it is not possible to go to sleep mode in debug. It seems weird, cause when I am in debug, I run the code on the u-processor which have a binary file in input linker ( On IAR ). So I don't really run/debug the BLE module, I just load this binary file, which is used only one time, at the beginning of my program to initialize the BLE module through the SPI.

So if sleep mode doesn't work in debug, how it is possible that I manage to receive the values on my smartphone BLE scanner when I shake my board ( I have an accelerometer which send a signal though GPIO when it detect a vibration, and then I send some data, and this GPIO signal wake up the BLE module with an interuption) in debug mode ?

而且,你告诉我使用唤醒定时器,所以这意味着我可以真正控制我用我的U-processor发送数据时,导致摇动不会有效,原因是GPIO信号?

谢谢你的帮助,
此致,
佛罗伦特

MHv_Dialog
Offline
Last seen:2个月2周前
工作人员
加入:2013-12-06 15:10
Hi Florent,

Hi Florent,

让我们退一步一点:-)

请详细解释您的调试模式。您是否使用DA14580(J-Link)上的串行推控器,或者您不是,如果是的话,则是调试器附加的吗?

You can use the debugger in sleep mode, but the device will not actually go to sleep (as this would de-attach the debugger as the controller is powered off).

为了在没有安装调试器的情况下使用睡眠模式,您需要将睡眠时钟配置为匹配您的硬件,如上所述。否则设备不会从睡眠中醒来。

唤醒定时器实际上是设备上的硬件块,允许您在输入GPIO更改状态时从睡眠模式唤醒控制器。有关详细信息,请参阅参考手册(UM-B-051)。一旦您的加速度计切换其中断输出引脚/引脚,这将允许您唤醒DA14580。

/ mhv.

florent
Offline
Last seen:3年6个月前
加入:2017-08-08 11:42
Hi Dialog,

Hi Dialog,

通过调试模式我的意思是:我在Micro-Processor(ADUCM3029)上使用SWD,并且该微处理器通过SPI链路将一些数据发送到BLE模块。该微处理器还具有作为输入的二进制文件,该文件是BLE模块的配置,并在代码的开始时发送此配置。所以否,DA14580未附加到J-Link模块,我刚刚在微处理器上使用SWD来向BLE模块向数据包发送步骤。

So each time that I want to test one of my BLE code, I compile on u-vision the BLE code, it create a binary file, then I linked this one through AIR with the code for the ADUCM3029, and then I debug the ADUCM3029 with SWD.

So the problem is that when I don't connect the J-link module to the rest of microprocessor, the DA14580 only send one data, and go to sleep one time ( I debug it with a LED).

所以外部唤醒正在工作,但只有一次。
谢谢,
佛罗伦特

MHv_Dialog
Offline
Last seen:2个月2周前
工作人员
加入:2013-12-06 15:10
Hi Florent,

Hi Florent,

Thanks for the detailed explanation.

Here is a list of things to look into:

  1. Your wake-up scheme must utilize the wake-up timer hardware block in order to wake the device up from sleep. A standard GPIO interrupt will not work unless it happens while the DA14580 is awake (it remains awake for 2 seconds after boot-up and will wake up for any Bluetooth event which likely explains why it works once). Please see UM-B-051 section 10.7 for details.
  2. Waking up from sleep takes some time and you should implement some sort of handshaking or a fixed delay in order to make sure that the SPI interface on the DA14580 is fully initialized before you start sending data.
  3. I cannot explain why your observations are different when the host processor is attached to a debugger, but this could indicate timing issues and potentially realetd to bullet 2 above

/ mhv.