使用外部中断输入从外部睡眠异步唤醒

了解更多FAQsTutorials

8个职位/0个新职位
Last post
Tobe君一
Offline
Last seen:1 month 3 weeks ago
加入:2016-04-01 10:39
使用外部中断输入从外部睡眠异步唤醒

Hello support,

我正在考虑使用外部中断input of DA 14585 to asynchronously return (from exteded sleep) using external MPU.
我指的是文档(Training\u 04\u Sleep mode configurations and power measurement\u 0.pdf)。(第9页)

SDK:6.0.8.509。
The external MPU and DA 14585 are connected using SPI I/F.

我有两个问题。

Q1. During exteded sleep
Behavior is different between Keil-uVision debugging operation and actual operation.
First I set to "exteded sleep" when DA 14585 is not communicating, and set action from restore DA 14585 from Sleep state by using port interrupt.

I would like to communicate with SPI immediately after returning. ,
In uVision and J-LINK debugging environment, it works without problems.
Next, if I write this program to the external SPI flash and let it operate standalone, it will stop working. (It will not return.)
Looking at the current value, it looks like DA14585 has recovered. However, SPI communication with external microcomputer seems not to be done.
Are there any differences in the operation between the debugging environment (Keil - uVision and J - LINK) and the real environment (using flash)?
(For example, in the debugging environment, the power supply of the RAM is not actually turned off.)

(2) Bluetooth communication in progress
If I do a return operation using port interrupts in the same way during Bluetooth communication,
调用函数lld\u sleep\u compensate\u func(在rwble.c中),
然后它在最后一行以ASSERT\u警告(0)停止。
This phenomenon occurs in both the debugging environment (uVision and J-LINK) and the real environment (using flash).
是不是睡眠时间太短了?或者你有什么要考虑的?
你能告诉我解决办法吗。

In addition to the above information, if necessary items, please request to us.

当做,

Jun-ichi

设备:
PM_Dialog
Offline
Last seen:4天3小时前
Staff
加入:2018-02-08 11:03
嗨,Tobe君一,

嗨,Tobe君一,

If I am able to understand what you want to accomplish in your project is to wake the DA14585 up using an external MPU interrupt? Could you please clarify what you are trying to? Also, could you please make clear what do you mean with “return” that you mentioned in your first question? Do you mean wake the device up? Did I understand correctly? And your problem is that you are not able to wake up the DA14585? If you follow the DEVELOPMENT_DEBUG definition you will be able to see that there are not any differences between he debugging environment (Keil - uVision and J - LINK) and the real environment and the RAM is powered off. Regarding your second question, be aware that if this assertion hits then the LP ISR lasts longer than the time that has been reserved via LP_ISR_TIME_XTAL32_CYCLES and LP_ISR_TIME_USEC. Could you please let me know if you have any transactions of the SPI into the periph_init() function and they takes too long?

Thanks, PM_Dialog

Tobe君一
Offline
Last seen:1 month 3 weeks ago
加入:2016-04-01 10:39
Thank you for your comment.

Thank you for your comment.

关于Q1
What I want to accomplish is to asynchronously wake sleeping[Extended sleep] DA 14585 using external MCU and external interrupt.

(a) In Keil's debug mode, DA14585 could wake up from sleep.
(b) 另一方面,如果FW写入DA14585的外部SPI闪存,则无法将DA14585从睡眠状态唤醒。

(a)和(b)在操作上有什么区别?
How can I make it work correctly in environment (b)?
Or, how can I verify whether RAM is on or off in the environments (a) and (b)?

当做,

Jun-ichi

MT_dialog
Offline
Last seen:1个月2周前
Staff
加入:2015-06-08 11:34
嗨,一君,

嗨,一君,

Well, if the 585 is able to boot properly from flash then it shouldn't have any difference between running the code from the flash or when debugging regarding the wake up procedure. If the device doesn't wake up when you are booting from flash perhaps you should check if the device is actually booting (do you advertise when the device boots up ? do you have
any indication that the device has booted ?). I suppose also that you are using sleep, so what kind of sleep you are using ? Have you tried to boot from flash with no sleep used ? Is it
那样运作?另外,当从flash启动时(睡眠时),您应该能够连接到设备上,以检查设备是否卡在断言或硬故障上。

What you can also try is to burn the ble_app_sleepmode in flash (it has a similar functionallity to what i suppose that you do, it goes to sleep and wakes up from an external interrupt). So try to wake the example of the SDK while burned in flash and check if its working on your side.

谢谢你的对话

Tobe君一
Offline
Last seen:1 month 3 weeks ago
加入:2016-04-01 10:39
Hi!

Hi!

>>我想你也在使用睡眠,那么你在使用什么样的睡眠呢?
-->我使用了“延长睡眠”模式。

If Extended Sleep is used, are there any differences in RAM status depending on the debugging environment?

当做,

Jun-ichi

Tobe君一
Offline
Last seen:1 month 3 weeks ago
加入:2016-04-01 10:39
Hi!

Hi!
About Question 2:
在从睡眠中醒来的过程中,包括SPI通信
and as you indicated, I found that it took too long !

It was solved by correcting the corresponding part.

谢谢您!

Jun-ichi

Tobe君一
Offline
Last seen:1 month 3 weeks ago
加入:2016-04-01 10:39
Hello !

Hello !

I report the test environment about Q1( During exteded sleep)

基本示例项目:ble\u app\u peripheral
SPI处理:在“SPI\u hcl.c”中实现

I will describe the procedure.
[主机MPU(SPI主)→DA 14585(从)]
1) Wake up DA 14585 using port interrupt.
2) 调用函数arch\u set\u sleep\u mode(arch\u sleep\u OFF)唤醒。
3) 在DA 14585通信后,设置端口中断并调用函数arch\u set\u sleep\u mode(arch\u EXT\u sleep\u OTP\u COPY\u ON)
把它设为长时间睡眠。

[SPI transmission from DA14585 (slave) to host MPU (SPI master)]
当DA14585执行蓝牙通信时,它输出可怕的信号并执行SPI通信。
此时,DA14585不会更改睡眠设置。

Result (current measurement)
[当项目写入SPI flash并执行时]
When calling arch_set_sleep_mode (ARCH_SLEEP_OFF); in the port interrupt,
the current consumption increases from about 400 uA to 600 uA in a few seconds and the DA 14585 will NOT accept SPI communication from the host MPU.
在消耗电流为400 uA时发送播发启动命令时,播发启动。
如果我在关闭ARCH\u SLEEP\u之后调用wdg\u freeze(),电流似乎暂时不会增加。
因为几秒钟后就不正常了,我以为看门狗定时器在工作。
The wdg_freeze function seems to be effective,I think.

这只是当我写的FW到SPI闪存。

[Run with Keil's debugger]
After port interrupt, SPI command is accepted.
之后,DA14585还可以执行蓝牙通信。

根据执行环境的不同,差异在哪里?内存设置?生成设置?

当做,

Jun-ichi

PM_Dialog
Offline
Last seen:4天3小时前
Staff
加入:2018-02-08 11:03
嗨,Tobe君一,

嗨,Tobe君一,

你能不能试着更清楚地描述一下你想完成什么,你的问题是什么?对不起,我不明白哪一个是你的问题。关于Q1,正如你在上一篇文章中提到的,你已经解决了你的问题。对吗?现在你想做什么?从SPI闪存引导,使用外部MCU向DA14585发送命令?关于目前的消费,问题是当嘘声从SPI闪存?我理解对了吗?

Thanks, PM_Dialog