Requesting a WAKE example
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
Issue の Python 例、特に ULP、src_to_binary、mem32、machine.deepsleep から始め、続いて 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
micropython/micropython-esp32-ulp のほかの issue
-
Release 1.3.0オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
micropython/micropython-esp32-ulp#96 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
micropython/micropython-esp32-ulp#86 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 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
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
letsencrypt/cp-cps#353 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DOI-USGS/pywatershed#421 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python-pillow/Pillow#10087 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信