Hello Dialog,
I have a hardware configuration that requires a port pin to be set/high on wakeup from wither POR or from Deep Sleep.
Since, a reset always sets GPIO to '0' state, is there any way to use an assembly instruction that will be executed as first instruction on boot due to wakeup from Deep Sleep?
谢谢
拉朱
设备:
Hi rajucoolsuraj,
请你澄清一下,并为我提供更多的投入,你想完成什么?如果我理解正确,您想进入睡眠状态,一旦设备唤醒,引脚应设置为高>或您想保持高引脚状态,而芯片处于睡眠模式?
谢谢, PM_Dialog
Hello Dialog,
The sleep is to Deep Sleep.
On sleep the pin state is defined High/Low.
Upon wakeup from Deep Sleep, the Pin state should be retained.
How to achieve the above requirement?
Regards
拉朱
Hi rajucoolsuraj,
The state of the pin before going to sleep, is retained but not the configuration or the functionality of the pin. when the device wake's up the periph_init() function is called in order to re-configure the pins in each wakeup and the pins return their default application state. So, if any of the GPIOs is high before going to sleep, it will stay high during sleep, and will be reconfigured in wake up by the periph_init() function.
谢谢, PM_Dialog
Hello Dialog,
I have specifically mentioned the sleep mode as - Deep Sleep.
对于深度睡眠,代码总是在从外部中断唤醒时执行硬件重置。
我有一个要求,应该-继续/恢复代码执行从深度睡眠醒来。
May I know if such a requirement facilitation is feasible in the deep sleep mode?
谢谢
Regards
拉朱
Hi rajucoolsuraj,
You mentioned the deep sleep mode, so let me aske you something in order to understand you requirement. Have you burnt the OTP?
谢谢, PM_Dialog
Hello Dialog,
我的固件在闪存里(DA14586)。
谢谢
拉朱
Hi rajucoolsuraj,
Normally, when the device is in deep sleep mode the OTP should be burn. However, by defining the CFG_DEVELOPMENT_DEBUG macro da1458x_config_basic.h, you could emulate the deep sleep mode and the OTP mirroring to System RAM. Again, the state of the pin before going to sleep, is retained but not the configuration or the functionality of the pin.
谢谢, PM_Dialog
Hello Dialog,
我可以知道如何在启用深度睡眠模式的同时从Flash执行代码吗?
如果不可能,可行的替代方案是什么?
谢谢
Regards
拉朱
Hi rajucoolsuraj,
Could you please clarify your question? What do you mean with “resume code execution while deep sleep mode is enabled”?
The DA14585/6 has 3 sleep modes available:
However, by defining the CFG_DEVELOPMENT_DEBUG macro da1458x_config_basic.h, you could emulate the deep sleep mode and the OTP mirroring to System RAM.
In the EXTENDED sleep modes, theDA14585/6 can be woken up in 2 ways
当选择深度睡眠模式时,DA14585/6可通过1种方式唤醒:
谢谢, PM_Dialog
谢谢Dialog,
我希望有一个SystemRAM状态保留,这样当需要唤醒时,系统会恢复其主循环执行,而不是在深度睡眠时进行系统重置。
我在闪存里有应用程序代码。因此,基于上述选项,无OTP复制的延长睡眠模式是在不活动期间节省电源的唯一选项。
Is there any additional power saving settings that can be included into the Extended Sleep mode without OTP copy configuration ?
谢谢
Regards
拉朱
Hi rajucoolsuraj,
您可以将数据存储到保留RAM中,以便在睡觉时保留它们。请检查一下房间SW Example: DA14585/586 Detect the Source of the Reset举例说明如何做到这一点。关于最后一个问题,您不需要任何其他额外的配置。
谢谢, PM_Dialog
谢谢你的好榜样,
基于这个例子,代码会针对任何重置条件的原因再次引导(NMI/硬故障/SW);
The requirement is to not only know the cause of reset, but also keep the state of a GPIO as it was before reset.
Regards
拉朱
Hi rajucoolsuraj,
正如在前面的评论中提到的,设备在进入睡眠前保留pin的状态,但不保留pin的配置或功能。当设备唤醒时,执行periph_init()函数,以便在每次唤醒中重新配置管脚,管脚返回其默认应用程序状态。在进入睡眠状态时,如果GPIO为高电平,它将在睡眠期间保持高电平,并将在唤醒时由periph_init()函数重新配置。您必须在应用程序中了解pin的最后状态,以便在唤醒时重新应用该值。
谢谢, PM_Dialog
但是,示例代码将经历重置,并且GPIO状态也将重置为零。
谢谢
当做
拉朱
Hi rajucoolsuraj,
据我所知,你想保持GPIO状态时睡觉,不是吗?
谢谢, PM_Dialog
Yes,
睡眠模式是深度睡眠,外部唤醒。
So, Upon wake up, the system will undergo a reset thus setting GPIO to zero(reset state).
Hi rajucoolsuraj,
As I mentioned, the state of the pin before going to sleep is retained. So, if I understood correctly, you would like to retain the state of the pin after a SW reset?
谢谢, PM_Dialog
是的,正确。我想保留的状态the pin after a SW reset.
谢谢
拉朱
Hi rajucoolsuraj,
Can you please indicate from where the device boots up? From the System-RAM ore from SPI Flash? If it boots from System-RAM, after the reset, the firmware will be lost so you have to download it again, A possible solution is to store the state of the pin into the un-initialized area of the Retention-RAM, and pass this value in the periph_int when configuring the GPIO.
谢谢, PM_Dialog