是否可以使用ULP唤醒ESP-Woom32?考虑替代方案

发布于 2025-02-11 12:09:01 字数 767 浏览 2 评论 0原文

我买了一些标有esp-wroom32模块的板。 Esptool报告该版本为:

Chip is ESP32D0WDQ6 (revision (unknown 0xa))
Chip ID: 0xbc78e36d10fd

看起来旧。

我编写了一些ULP测试程序,除了唤醒指令外,一切都按预期工作,似乎根本没有起作用。我觉得这可能是一个旧的硬件限制,但我不确定。

在调用Machine.Deepsleep(0)之前,我确保启用了唤醒源:

mem32 [0x3ff48038] = 0x200<< 10

无济于事。我还尝试从ULP本身启用ULP唤醒:

write_rtc_reg(rtc_cntl_wakeup_state_reg,21,11,0x200);

也不起作用。搜寻,似乎在ULP唤醒稳定之前,这种芯片可能是来自。基于此,我认为该模块不支持ULP上的唤醒,我必须将ULP的输出接线到RESET PIN,以使主CPU唤醒。这仍然可以让我使用ULP进行更复杂的唤醒。我真正想要的是在适当的软件调试时间或经过一定的时间之后醒来GPIO PIN过渡。用例是我想立即报告状态变化的输入,但是如果没有状态变更,我仍然想偶尔醒来,以便让接收者知道我还活着。

将别针返回重置似乎还不错,但是在我这样做之前,有人有更好的主意吗?例如,(在Micropython中)Machine.Deepsleep(1000)工作,并且默认情况下使用计时器0。是否可以让ULP程序不断将计时器推回直到希望CPU醒来?

I bought some boards that have modules labeled ESP-WROOM32. esptool reports the version as:

Chip is ESP32D0WDQ6 (revision (unknown 0xa))
Chip ID: 0xbc78e36d10fd

which seems old.

I wrote a few ULP test programs and everything works as expected except for the WAKE instruction, which doesn't seem to work at all. I have a feeling it might be an old hardware limitation, but I'm not sure.

Before calling machine.deepsleep(0) I made sure that the wake-up source was enabled:

mem32[ 0x3ff48038 ] = 0x200 << 10

that didn't help. I also tried enabling ULP wakeup from the ULP itself:

WRITE_RTC_REG(RTC_CNTL_WAKEUP_STATE_REG, 21, 11, 0x200);

which also didn't work. Searching around, it seems like this chip might be from before the ULP wakeup was stable. Based on that, I am thinking this module doesn't support wake on ULP, and I have to wire an output from the ULP back to the reset pin to get the main CPU to wake up. This will still let me use the ULP to do a more complicated wake-up. What I'm really looking for is to wake up on a GPIO pin transition, after a suitable software debounce time, or after a certain amount of time has elapsed. The use case is an input where I want to report a change of state immediately, but if there is no state change, I still want to wake up every once in a while to let the receiver know I'm still alive.

Wiring a pin back to reset doesn't seem too bad, but before I do it, does anyone have a better idea? For example, (in micropython) machine.deepsleep(1000) works, and by default uses timer 0. Would it work to just have the ULP program keep pushing that timer back until it wants the CPU to wake up?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尾戒 2025-02-18 12:09:01

我做了这项工作。主要问题是在Micropython方面 - 我正在使用v1.19.1,但是我需要的更改实际上是在过去的5天中进行的。在此更新之前,我认为在设置它之后,在RTC_CNTL_WAKEUP_STATE_REG中清除了ULP标志。我无法弄清楚原因;我将源代码跟踪到一些ESP-IDF代码,并带有此评论:

// TODO: move timer wakeup configuration into a similar function
// once rtc_sleep is opensourced.

不过,每晚使用最新的Micropython,您只需致电:

ESP32.Wake_On_Ulp(true)

,并且一切都按预期工作。现在,在ULP中的唤醒指令之后,我将重置一个正确的标志集:

rst:0x5(deepsleep_reset)

这为即使在Micropopython World中即使在Micropython World中也打开了许多有趣的,非常低的功率可能性。

我不确定我是否能够解决这个问题,但是Micropython团队为我弄清楚了。对他们表示敬意。

I made this work. The main issue was on the micropython side - I was using v1.19.1 but the changes I needed were actually made in the last 5 days. Before this update I think that something would wipe out the ULP flag in RTC_CNTL_WAKEUP_STATE_REG after I set it. I wasn't able to figure out why; I traced the source code up to some ESP-IDF code with this comment:

// TODO: move timer wakeup configuration into a similar function
// once rtc_sleep is opensourced.

With the latest micropython nightly, though, you can just call:

esp32.wake_on_ulp(True)

and everything works as expected. Now, after a WAKE instruction in the ULP, I get a reset with the right flag set:

rst:0x5 (DEEPSLEEP_RESET)

This opens up a lot of interesting, very low power possibilities even within the micropython world.

I wasn't sure I was going to be able to figure this out, but the micropython team figured it out for me. Kudos to them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文