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
嗨jun-ichi 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
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
嗨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.
Hi!
>>我也想你正在使用睡眠,所以你正在使用什么样的睡眠?
- >我已经使用了“延长睡眠”模式。
If Extended Sleep is used, are there any differences in RAM status depending on the debugging environment?
问候,
Jun-ichi
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
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
嗨jun-ichi tobe,
您能否尝试更清楚地描述你想要完成的事情,这是你的问题吗?对不起,但我无法理解哪个是你的问题。关于Q1,正如您之前在上一篇文章中提到的那样,您将查明您的问题。那是对的吗?现在你想要做什么?您从SPI Flash启动,您正在使用外部MCU才能将命令发送到DA14585中?关于当前的消耗,问题是从SPI闪光嘘?我明白了吗?
Thanks, PM_Dialog