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
Rajucoolsuraj.
Offline
Last seen:5个月3周前
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?

谢谢

raju.

设备:
PM_Dialog
Offline
Last seen:2 days 6 hours ago
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

您能否澄清并为我提供更多的投入,以便您想要完成的内容?如果我理解正确,你想在设备醒来时进入睡眠状态,请将PIN设置为高电平>或者您希望在芯片处于睡眠模式时保持高引脚状态?

谢谢, PM_Dialog

Rajucoolsuraj.
Offline
Last seen:5个月3周前
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

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
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

Rajucoolsuraj.
Offline
Last seen:5个月3周前
Joined:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

I have specifically mentioned the sleep mode as - Deep Sleep.

对于深度睡眠,代码始终在外部中断唤醒时执行HW复位。

我有一个要求 - 继续/恢复从深睡眠时唤醒的代码执行。

May I know if such a requirement facilitation is feasible in the deep sleep mode?

谢谢

Regards

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
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

Rajucoolsuraj.
Offline
Last seen:5个月3周前
Joined:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

我在闪存中有我的fw。(DA14586)。

谢谢

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
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

Rajucoolsuraj.
Offline
Last seen:5个月3周前
Joined:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

我可以知道如何恢复代码执行,同时启用深度睡眠模式以及Flash的代码执行?

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

谢谢

Regards

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
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副本延长睡眠:有OTP副本(如果从OTP引导)。
  • DA14585 / 6:仅32KB的SystemRAM保持接通。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).

选择深度睡眠模式时,可以在1way中唤醒Theda14585 / 6:

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

谢谢, PM_Dialog

Rajucoolsuraj.
Offline
Last seen:5个月3周前
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

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

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

谢谢, PM_Dialog

Rajucoolsuraj.
Offline
Last seen:5个月3周前
Joined:2018-12-12 16:09
谢谢for the excellent

谢谢你的优秀之例,

基于该示例,代码再次启动任何重置条件的原因。(nmi / hardfault / 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

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

正如在先前的评论中提到的那样,设备在睡眠前保持引脚的状态,但不是PIN的配置或功能。当设备唤醒时,执行PERIPH_INIT()函数,以便在每个唤醒中重新配置引脚,并且引脚返回其默认应用程序状态。如果要睡觉,如果GPIO很高,它会在睡眠期间保持高,并且将通过PERIPH_INIT()函数唤醒重新配置。您必须在您的应用程序中知道您的PIN的最后状态,以便在唤醒时重新应用该值。

谢谢, PM_Dialog

Rajucoolsuraj.
Offline
Last seen:5个月3周前
Joined:2018-12-12 16:09
But, The example code

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

谢谢

问候

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
Staff
Joined:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

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

谢谢, PM_Dialog

Rajucoolsuraj.
Offline
Last seen:5个月3周前
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
Offline
Last seen:2 days 6 hours ago
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

Rajucoolsuraj.
Offline
Last seen:5个月3周前
Joined:2018-12-12 16:09
是的,正确。I would like to

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

谢谢

raju.

PM_Dialog
Offline
Last seen:2 days 6 hours ago
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