Requesting a WAKE example
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python
调研方向
从 issue 中的 Python 示例开始,重点关注 ULP、src_to_binary、mem32 和 machine.deepsleep,然后检查 repository 中现有的示例和文档,了解 WAKE 的用法。确定所示的 deep-sleep 流程是否可行,并记录一个最小可运行示例,包括 WAKE 触发后用户应该观察到的现象。
由索引模型根据 Issue 内容生成。
描述
I would like an example of how to use WAKE because I'm not quite sure how it's supposed to work. I'll contribute one if I can, but right now it doesn't work. Should it?
#
# Example of putting the main processor to sleep then waking it up
# via the ULP after a while
#
from esp32 import ULP
from machine import mem32
import machine
from esp32_ulp import src_to_binary
source = """\
#define RTC_CNTL_LOW_POWER_ST_REG 0x3FF480c0
#define RTC_CNTL_RDY_FOR_WAKEUP BIT(19)
entry:
MOVE r0, 2000
loop:
WAIT 40000 // at 8 MHz this is 5 msec, if we do this 1000 times that's 5 seconds
SUB r0, r0, 1
jump is_rdy_for_wakeup, eq
jump loop
is_rdy_for_wakeup: // Read RTC_CNTL_RDY_FOR_WAKEUP bit
#
# This test was described in https://github.com/espressif/esp-idf/issues/8341
# See reference manual 31.19.
#
# The main issue with this is that it will hang if the main CPU wasn't in deep sleep.
#
READ_RTC_FIELD(RTC_CNTL_LOW_POWER_ST_REG, RTC_CNTL_RDY_FOR_WAKEUP)
AND r0, r0, 1
JUMP is_rdy_for_wakeup, eq // Retry until the bit is set
WAKE // Trigger wake up
HALT // Stop the ULP program
"""
#
# Compile the ULP code
#
binary = src_to_binary(source)
load_addr, entry_addr = 0, 0
ULP_MEM_BASE = 0x50000000
ULP_DATA_MASK = 0xffff # ULP data is only in lower 16 bits
ulp = ULP()
ulp.load_binary(load_addr, binary)
#
# The ULP starts out asleep (halted), so set a timer to wake it
# up the first time.
#
# ulp.set_wakeup_period(0, 50000) # use timer0, wakeup after 50.000 cycles
mem32[ULP_MEM_BASE + load_addr] = 0x1000
ulp.run(entry_addr)
print("going to sleep")
# I think this should enable ULP wakeup
mem32[ 0x3ff48038 ] = 0x200 << 10
machine.deepsleep()
#
# We won't ever reach this, because WAKE is going to cause the main
# processor to reset and start over at the beginning.
#
print("I am awake again")
- 主要语言
- Python
- 星标
- 142
- 派生
- 25
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
micropython/micropython-esp32-ulp 的其他 Issue
-
Release 1.3.0未关闭
难度 4/5 3-5 天 新手友好度 35/100
micropython/micropython-esp32-ulp#96 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 25/100
micropython/micropython-esp32-ulp#86 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
micropython/micropython-esp32-ulp#83 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 30/100
micropython/micropython-esp32-ulp#76 · 1 条评论 ·
查看 micropython/micropython-esp32-ulp 的全部 Issue
相似的 Issue
-
namespace operations
难度 1/5 1 小时以内 新手友好度 82/100
EclipseFdn/open-vsx.org#13573 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
collective/icalendar#1854 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
rancher/rancher-ai-agent#412 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
TUDelftGeodesy/DePSI#134 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
HenriquesLab/rxiv-maker#335 ·