Pre defined Default pin state on wake-up from Deep Sleep

⚠️
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.
20个职位/0个新职位
Last post
拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
Pre defined Default pin state on wake-up from Deep Sleep

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?

谢谢

拉朱

设备:
PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

请你澄清一下,并为我提供更多的投入,你想完成什么?如果我理解正确,您想进入睡眠状态,一旦设备唤醒,引脚应设置为高>或您想保持高引脚状态,而芯片处于睡眠模式?

谢谢, PM_Dialog

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
Hello 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

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

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

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
Hello 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

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

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

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

我的固件在闪存里(DA14586)。

谢谢

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

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

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

我可以知道如何在启用深度睡眠模式的同时从Flash执行代码吗?

如果不可能,可行的替代方案是什么?

谢谢

Regards

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

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:

  • EXTENDED sleep without OTP copy
  • DA14585/6: Only the SystemRAM corresponding of the image size stays switched on

  • 使用OTP copy延长睡眠:有OTP copy(如果从OTP引导)。
  • DA14585/6:只有32kB的系统RAM保持打开状态。OTP必须烧掉才能测量深度睡眠电流。

  • 深度睡眠模式:有OTP拷贝(如果从OTP引导)
  • DA14585/6: Only the wakeup controller or the POR circuit remains switched on depending on the option selected.
  • This mode can be used for the shipping or hibernation mode. A BLE connection cannot be maintained.

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

  • 同时,通过可编程的BLE定时器唤醒系统,
  • Asynchronously, via an external interrupt (input).

当选择深度睡眠模式时,DA14585/6可通过1种方式唤醒:

  • Asynchronously, via an external interrupt(input) either from the Power-On-Reset (POR) circuit of from the wake up controller

谢谢, PM_Dialog

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
谢谢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

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

您可以将数据存储到保留RAM中,以便在睡觉时保留它们。请检查一下房间SW Example: DA14585/586 Detect the Source of the Reset举例说明如何做到这一点。关于最后一个问题,您不需要任何其他额外的配置。

谢谢, PM_Dialog

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
谢谢for the excellent

谢谢你的好榜样,

基于这个例子,代码会针对任何重置条件的原因再次引导(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

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

正如在前面的评论中提到的,设备在进入睡眠前保留pin的状态,但不保留pin的配置或功能。当设备唤醒时,执行periph_init()函数,以便在每次唤醒中重新配置管脚,管脚返回其默认应用程序状态。在进入睡眠状态时,如果GPIO为高电平,它将在睡眠期间保持高电平,并将在唤醒时由periph_init()函数重新配置。您必须在应用程序中了解pin的最后状态,以便在唤醒时重新应用该值。

谢谢, PM_Dialog

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
But, The example code

但是,示例代码将经历重置,并且GPIO状态也将重置为零。

谢谢

当做

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

据我所知,你想保持GPIO状态时睡觉,不是吗?

谢谢, PM_Dialog

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
Yes,

Yes,

睡眠模式是深度睡眠,外部唤醒。

So, Upon wake up, the system will undergo a reset thus setting GPIO to zero(reset state).

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

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

拉朱古尔苏拉杰
Offline
Last seen:6个月2周前
Joined:2018-12-12 16:09
是的,正确。I would like to

是的,正确。我想保留的状态the pin after a SW reset.

谢谢

拉朱

PM_Dialog
Online
Last seen:7分15秒前
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

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