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

⚠️
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.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8个帖子/ 0新
Last post
Jun-ichi Tobe
Offline
Last seen:6 months 1 week ago
加入:2016-04-01 10:39
使用外部中断输入异步从Exted睡眠中唤醒

Hello support,

我正在考虑使用外部中断input of DA 14585 to asynchronously return (from exteded sleep) using external MPU.
我指的是文档(training_04_sleep模式配置和电源测量_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_sleep_compensate_func(在rwble.c中),
然后它在最后一行上停止使用Assert_warning(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:3小时25分钟前
Staff
加入:2018-02-08 11:03
嗨jun-ichi tobe,

嗨jun-ichi tobe,

如果我能够了解您想要在项目中完成的内容是要使用外部MPU中断唤醒DA14585?你能澄清你想要的东西吗?此外,您可以明确您在第一个问题中提到的“返回”的意思是什么意思?你的意思是唤醒设备吗?我明白了吗?你的问题是你无法唤醒DA14585?如果您遵循Development_debug定义,您将能够看到他调试环境(Keil - Uvision和J - Link)之间没有任何差异,并且RAM关闭电源。关于您的第二个问题,请注意,如果此断言命中,则LP ISR持续时间长于通过LP_ISR_TIME_XTAL32_CYCLES和LP_ISR_TIME_USEC保留的时间。如果您对Periph_init()函数有任何交易,请您告诉我吗?

Thanks, PM_Dialog

Jun-ichi Tobe
Offline
Last seen:6 months 1 week 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被写入DA 14585的外部SPI闪存,则无法从睡眠状态唤醒DA 14585。

(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:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Jun-Ichi,

嗨Jun-Ichi,

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.

谢谢mt_dialog.

Jun-ichi Tobe
Offline
Last seen:6 months 1 week 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

Jun-ichi Tobe
Offline
Last seen:6 months 1 week 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

Jun-ichi Tobe
Offline
Last seen:6 months 1 week ago
加入:2016-04-01 10:39
Hello !

Hello !

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

基础示例项目:BLE_APP_PERITITALAL
SPI处理:在“SPI_HCL.C”中实施

I will describe the procedure.
[主机MPU(SPI Master)→DA 14585(奴隶)]
1) Wake up DA 14585 using port interrupt.
2)调用函数ARCH_SET_SLEEP_MODE(ARCH_SLEEP_OFF)唤醒。
3)DA 14585通信后,设置端口中断并调用函数ARCH_SET_SLEEP_MODE(ARCH_EXT_SLEEP_OTP_COPY_ON)
并将其设置为延长睡眠。

[SPI transmission from DA14585 (slave) to host MPU (SPI master)]
当DA14585执行蓝牙通信时,它会输出变量信号并执行SPI通信。
此时,DA14585不会更改睡眠环境。

Result (current measurement)
[将项目写入SPI闪存并执行时]
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.
在消耗电流的同时发送广告启动命令时,已启动广告。
如果我在调用Arch_sleep_off后调用wdg_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:3小时25分钟前
Staff
加入:2018-02-08 11:03
嗨jun-ichi tobe,

嗨jun-ichi tobe,

您能否尝试更清楚地描述你想要完成的事情,这是你的问题吗?对不起,但我无法理解哪个是你的问题。关于Q1,正如您之前在上一篇文章中提到的那样,您将查明您的问题。那是对的吗?现在你想要做什么?您从SPI Flash启动,您正在使用外部MCU才能将命令发送到DA14585中?关于当前的消耗,问题是从SPI闪光嘘?我明白了吗?

Thanks, PM_Dialog